Does a fine-tuned small vision model beat a frontier API on GST invoices?
Every backend reads the same held-out invoices through the same pipeline, prompt, validators and repair loop. This page explains how that is measured. Only numbers from a recorded run appear here, each with where it came from.
No benchmark results are published yet
evals/run.py has measured them; nothing on this page is estimated or typed in by hand.OCR engine pilot
Before building the OCR plus LLM backend, two OCR engines were compared on how many of the label values they read. An LLM can only extract what the OCR actually read.
| Engine | Documents | Key values recovered | Seconds per page |
|---|---|---|---|
| RapidOCR | 50 | 99.2% | 2.18 |
| Tesseract | 50 | 83.3% | 0.79 |
| Profile | RapidOCR | Tesseract |
|---|---|---|
| Clean | 100.0% | 89.0% |
| Office scan | 98.6% | 90.2% |
| Photocopy | 99.1% | 75.4% |
| Phone photo | 98.2% | 72.3% |
| Stained | 100.0% | 92.7% |
| Low light | 100.0% | 70.4% |
Provenance Synthetic data Local CPU
Produced by evals/ocr_pilot.py --n 50 on 50 synthetic invoices, run once on the developer's laptop CPU. Committed as evals/results/ocr_pilot.json. Metric: the share of key label values (GSTINs, invoice number, HSN codes, line taxable values, totals) that appear verbatim in the OCR text. Seconds per page depend on that machine and are not a production latency. RapidOCR was chosen for the OCR plus LLM backend.
How a run is measured
Test data
Synthetic invoices rendered from 25 HTML templates that imitate real Indian invoices: Tally prints, NIC e-invoice printouts, thermal receipts, bilingual Hindi letterheads, pharma distributor bills. Twenty templates are used for training; five are held out entirely, so the unseen-template score measures generalisation, not memory.
Pages are degraded the way real ones are: office scans, photocopies, phone photos with perspective and shadows, coffee stains, low light. Labels are exact by construction, and every synthetic invoice passes the validators.
A separate set of real invoices, redacted before storage, is used only for testing, never for training. A CI check fails if any of them appears in a training manifest.
Metrics
- Field F1
- Per header field, after normalising formats (ISO dates, amounts to 2 decimals, GSTIN case, place of supply by state code).
- Line-item F1
- Predicted and true rows are paired by description similarity and amount (Hungarian matching), then scored field by field.
- Whole invoice right
- Both GSTINs, invoice number, date, taxable value, every tax total and the grand total all correct.
- Valid first pass and after repair
- Share of extractions that pass every GST validator before and after the single repair attempt.
- Cost per 1,000 invoices
- Token usage times the provider's list price, or GPU-hour price over measured throughput. Cold starts are reported separately.
What this cannot tell you
- Synthetic templates are approximations; scores on real invoices are the number to trust.
- Handwritten-only bills, credit notes and export invoices are out of scope.
- The real test set is small, so differences of a few points between backends are within noise.
- GPU costs depend on the provider's price at run time and on batch size; both are recorded with each run.