ODIN
Real-time deepfake detection on YouTube, TikTok and X
Hover to spread the screens, click one to look closer, orSwipe through the screens, tap one to look closer, or flip through all 6.
A browser extension that checks a video for AI manipulation while it plays, backed by a scale-to-zero analysis pipeline on Google Cloud Run. Live in production.
- RoleSolo engineer: extension, orchestrator, AI agent, infrastructure and CI/CD
- Ownership265 of 286 commits
- StatusLive in production odinfinds.com
- WhenMay – Sep 2026 · Ledgercross
In numbers
- monthly idle floor after redesigning the queue
- $140 → $36
- agreement with ground truth on the controlled test set
- 94.2%
- Cloud Run services, all scaling to zero
- 3
- frames judged per Gemini call, as one contact sheet
- 20
The problem
Deepfakes spread faster than anyone can fact-check them, and the tools that exist ask you to download a clip, upload it somewhere and wait for a report. Nobody does that mid-scroll.
ODIN moves the check to where the video already is. One button on YouTube, TikTok or X gives a plain answer (Real, Deepfake or Not Sure) and marks the suspicious seconds on the seekbar.
How it works
step through it · each step is a noteHow a scan flows
- 01The content script grabs JPEG frames at 4 fps while the video plays and sends them in batches of 20.
- 02The orchestrator first asks check_first whether this exact video already has a verdict.
- 03Seen before: the cached verdict goes straight back. No upload, no model call, no cost.
- 04New video: frames go to Cloud Storage and a job id goes to Pub/Sub. Nothing polls, so the backend can sleep.
- 05Pub/Sub pushes the job. An atomic queued→running claim means a duplicate delivery can't bill Gemini twice.
- 06The agent tiles the 20 frames into a 5×4 contact sheet in memory and asks Gemini for one verdict.
- 07The verdict is cached for every future viewer, the frames are deleted, and the result streams back onto the seekbar.
What I built
- Built the Manifest V3 extension for Chrome, Edge and Firefox: 4 fps frame capture in the content script, a side panel for history and account, Google sign-in and seekbar markers for flagged seconds.
- Designed the orchestrator: a check-first cache answers known videos instantly; new ones go to Cloud Storage and Pub/Sub, and verdicts stream back over Server-Sent Events.
- Wrote the Gemini analysis agent, which tiles 20 frames into a 5×4 contact sheet in memory so one model call judges a whole batch.
- Measured the real idle bill, then rebuilt the queue from a polling worker to Pub/Sub push so every service runs at min-instances=0.
- Added Stripe trials and subscriptions, plus the marketing site, privacy policy and store listing for launch.
- Shipped CI/CD with Workload Identity Federation (no static GCP keys anywhere) and branch rulesets that block red merges, even from admins.
Decisions
Push, don't poll
The first plan kept a worker warm with min-instances=1 and CPU throttling off. Measured, that one flag cost $78 a month and the idle floor was $140.52. Pub/Sub push deleted the poll loop, so the backend sleeps until a job arrives and the floor fell to $35.77.
Exactly-once billing on an at-least-once queue
Pub/Sub can deliver the same message twice. The push handler claims a job with an atomic queued→running compare-and-set, so a redelivery acknowledges and exits instead of paying Gemini twice. After five failures a message moves to a dead-letter topic.
One model call per 20 frames
Sending frames one at a time multiplies latency and cost. The agent lays 20 frames out as a lossless 5×4 contact sheet in RAM (never written to disk), which also gives the model context between neighbouring frames.
Tests that can't reach production
An autouse fixture fails any backend test that touches real Cloud Storage. It exists because a live delete once escaped into a background thread while the suite still reported green.
Exactly-once billing on an at-least-once queue
- 01Pub/Sub guarantees at-least-once delivery, so the same job can arrive more than once.
- 02Only the delivery that wins the atomic queued→running claim is allowed to run.
- 03On success the verdict is stored and the message is acknowledged.
- 04A duplicate loses the claim and acknowledges without calling the model. No double charge.
- 05A real failure goes back to Pub/Sub and is retried with exponential backoff.
- 06After five failed attempts the message moves to a dead-letter topic for inspection instead of looping forever.
Stack
- ExtensionWXT, React, TypeScript, Manifest V3
- BackendFastAPI, PostgreSQL, Redis, Pub/Sub, SSE, Stripe
- AIGemini on Vertex AI, Contact-sheet batching
- InfraCloud Run, Cloud Storage, Workload Identity Federation, Doppler, GitHub Actions






