← Rohan Thomas
Vision AI

Alcohol Label Verifier

TTB compliance checks that used to be done by eye. Upload a label and get a field-by-field verdict in seconds.

Problem
TTB label approval means proving the artwork matches the application: brand, class, ABV, net contents, government warning. Doing it by eye is slow and error prone.
Built
Claude vision extracts what's printed on the label; deterministic TypeScript does every comparison. Single-label and batch-CSV modes.
Proof
Verdicts in 2 to 4 seconds against a sub-5s target. Every matching rule is unit tested without a single API call.

Context

Submitting an alcohol label for TTB approval means proving that what's printed on the bottle matches what's on the application: brand name, class and type, alcohol content, net contents, producer, and the exact government warning, down to the ALL-CAPS bold "GOVERNMENT WARNING:" prefix. Reviewers do this by eye, and mistakes mean rejections and fines.

I built this as a proof of concept against a realistic TTB review brief: could the visual comparison be automated without handing the compliance decision to a black box?

What I built

An upload flow where Claude's vision model does exactly one job: extract what is printed on the label into structured JSON via tool use. All matching happens in pure TypeScript: case and punctuation insensitive comparison, numeric parsing so "0.75 L" matches "750 mL" and "45%" matches "45.0% Alc./Vol.", and a government-warning validator that checks the body word for word plus the prefix's capitalization and bold weight separately.

Batch mode runs a CSV of applications against a folder of label images, five verifications in flight with live progress, and exports regulator-friendly CSV results. Image quality problems like glare, blur, and skew surface as review reasons instead of silent failures.

Decisions

  • The AI extracts; the code decides

    Claude never judges compliance. It only reads the label. Every matching rule is deterministic TypeScript, unit tested against fixed inputs with zero API calls, and tunable without touching a prompt. When a regulator asks why a label failed, there is a rule to point to.

  • Uncertainty demotes to review

    A glared or blurry photo may have corrupted extraction. Those cases return a review verdict with reasons, so the tool preserves human judgment instead of manufacturing false rejections.

  • Latency was engineered

    The brief had a hard sub-5-second requirement. Prompt caching on the system prompt and tool schema brings verdicts to about 3 or 4 seconds cold and about 2 seconds warm.

  • Minimal integration surface

    One outbound API call per verification, no database, and no stored images or PII. Everything is processed in memory and discarded. The whole deployment is one Next.js app and one environment variable.

  • Documented trade-offs over hidden ones

    The README states what the system can't do, like black box extraction risk and canonical-only warning matching, along with the mitigation for each. Compliance software earns trust by being explicit about its limits.

What this proves

This is how I turn a regulatory workflow into software: find the deterministic core, keep the model at the edges, test everything that can be tested, and surface uncertainty instead of hiding it. The same shape applies to any document-heavy compliance process.