← Back to work
Lab build: an invoice extractor that flags every low-confidence field for review
A portfolio lab build on Tessera (a fictional SaaS): upload an invoice, get review-ready structured JSON with per-field confidence. Accuracy graded on the third-party SROIE benchmark.

- Role
- Solo build (Claude Code)
- Stack
- Next.js · TypeScript · Anthropic SDK · Claude Haiku 4.5 · Zod
- 77.8%SROIE field exact-match (30 receipts, 90 fields)
- 93.3%Total-amount field accuracy
The problem
Extracting invoices with an LLM is easy to demo and hard to trust: a confident-but-wrong model will happily return a clean-looking total that doesn't actually add up.
The approach
- Upload a PDF or image and extract to a Zod-validated schema via Claude Haiku 4.5 using tool use, so the API enforces the output shape instead of us parsing free text.
- Gave every field a confidence badge that is the worst of two independent signals: the model's own high/medium/low, and deterministic code checks (line items must sum to the total; dates must parse).
- Made the field table editable, re-running the deterministic checks live, then exporting the corrected header + line items to CSV.
- Graded the pipeline with an eval (npm run eval) over 30 real receipts from the third-party ICDAR-2019 SROIE dataset: field-level exact-match accuracy after normalization, exiting non-zero below 75%.
The results
A review-first extractor where a confident-but-wrong model can't paint a field green if the numbers don't reconcile, and whose accuracy is measured against an independent, third-party benchmark rather than invoices we wrote ourselves.
Have a process like this eating your team's time?
Book a 15-minute fit call →