# TinyDoc > TinyDoc is an open-source Python engine that turns receipt and invoice images into schema-validated JSON with exact OCR-span evidence and per-field confidence. It runs local Qwen2.5-VL-3B or Qwen3-VL-2B-Instruct models through Ollama. It is not a TinyDoc-trained checkpoint. ## Key facts - Package: `pip install tinydoc` (0.3.2), Apache 2.0, Python 3.9+. - Readers: `qwen2.5vl:3b` (quality) and `qwen3-vl:2b-instruct` (fast); both Apache 2.0. - Output: JSON Schema-valid fields, per-field quote/page/bbox evidence, confidence, optional overlay PNG. - Runtime: local Ollama. No API key, no cloud, no telemetry. - Receipts: 0.9475 field F1 (3B) and 0.9200 (2B) on SROIE clean-100 — public train split, duplicate-filtered, not an external benchmark; 60% of the original set is leaked. - Invoices: 91.9% key-header / 65.7% fully correct (3B) and 93.5% / 71.8% (2B) on a synthetic 181-document, page-1-only benchmark. Not real supplier invoices. - Multipage: on 10 synthetic invoices (46 pages), all-pages gets 4/10 fully correct and 71.1% key-header, with two 8-page runaway failures; page-wise VLM gets 6/10 fully correct, 93.3% key-header, and 0.848 line-item F1, with zero parse errors. Adding deterministic reconciliation (last-page currency, arithmetic repairs, OCR-read printed totals accepted only when subtotal + tax == total) reaches 10/10 on the nine key-header fields, with an exact 95% CI of 69.2-100% at n=10. That is a pipeline result, not a pure VLM score; line-item F1 is 0.848, all lines are right on 1/10, page-wise is about 2x slower (70.7 s/doc p50, 16.1 s/page). A deterministic degraded copy of the same 46 pages completed 8/10 documents: 7/8 fully correct, 71/72 key-header (98.6%), 0.795 line F1, OCR consistent on all 10 final pages, and 2 page failures (one malformed JSON, one transient Ollama HTTP 500). The 0.3.2 SDK exposes the page-wise path; that is probe-quality, not a production multipage claim. - Real Portuguese probe: 200 real phone photos of receipts/simplified invoices (80% company, 20% personal), CC BY 4.0, human labels for five fields, split into a 100-document development set and a disjoint 100-document holdout. Qwen3-VL-2B-Instruct at 1400 px scores 72.0% field accuracy (419/582) and 22/100 fully correct on the held-out set with the preserve-printed-total merge fix shipped in 0.3.1; the development set scores 74.2% / 18, and the 0.3.0 merge scores 64.8% / 3/100 because it double-counts VAT on tax-inclusive receipts. The opt-in targeted tax retry re-reads only the final page at 2400 px and moves a fresh 100-document set (seed 44) from 401/570 = 70.4% to 411/570 = 72.1% and tax from 51/82 to 61/82, fully correct 19 to 21, with no field regression. The 0.3.2 lone-tax total fallback reclassifies a printed Taxa amount as the total when the page has no subtotal, no line items, and no total: seed-44 replay 401/570 to 404/570 and fully 19 to 22, and a targeted 28-document toll/parking stress set 111/139 to 114/139 and fully 4 to 7, with all 6 observed triggers correct. A representative seed-45 sample triggered it 0 times, so this is not a population estimate. Five fields only; not a B2B supplier-invoice benchmark. - DocVQA reading probe: 200 public images, one question per image, 768 px mirror, single reference. Qwen3-VL-2B-Instruct scores 0.829 ANLS and 0.765 exact match, 0 errors, 3.36 s p50. Not comparable to DocVQA leaderboard numbers; the set may be in pretraining. - Evidence coverage: 0.798 of non-empty fields. Grounding is OCR spans; VLM-predicted boxes failed the 0.70 gate (hit@0.5 0.04–0.20). - Confidence: field-level ECE 0.115–0.135 raw, 0.005–0.014 after document-grouped isotonic out-of-fold. Document-level confidence is not calibrated. Use for review routing, not as a probability. - Not measured: real B2B supplier invoices, real-document line items/flags/confidence. Flagging fails (0/7). The multipage probe is not a production claim, and DocVQA is a single-reference reading probe. ## Canonical sources - Source and issues: https://github.com/eulogik/TinyDoc-VLM - Package: https://pypi.org/project/tinydoc/ - Benchmarks and caveats: https://github.com/eulogik/TinyDoc-VLM/blob/main/docs/BENCHMARKS.md - System card: https://github.com/eulogik/TinyDoc-VLM/blob/main/docs/MODEL_CARD.md - Plan and evidence ledger: https://github.com/eulogik/TinyDoc-VLM/blob/main/docs/v3_plan.md - Demos and space: https://huggingface.co/spaces/eulogik/TinyDoc-VLM - Site: https://eulogik.github.io/TinyDoc-VLM/ ## Short answers - What is TinyDoc? A local-first extraction SDK and CLI for receipts and invoices, with cited output. - Does it ship a model? No. It uses third-party Qwen VLMs and adds the extraction and trust layer. - Does it need the cloud? No. Inference runs on a local Ollama server. - Is it production-ready? It is a developer preview. Real B2B supplier invoices are unmeasured; a 100-document Portuguese receipt/invoice probe is measured on five fields (held out: 72.0% field / 22/100 fully correct with the merge fix shipped in 0.3.1; development 74.2% / 18). Multipage is a 10-document probe (page-wise VLM 6/10; 10/10 key-header only with deterministic OCR reconciliation, ~2x slower), and flagging fails. - Is the confidence a probability? No. Field scores are for review routing; document scores are not calibrated. - Does it predict boxes? It returns OCR-span boxes as provenance. Model-predicted boxes did not meet the gate. - Does it handle multipage invoices? The eval harness can send every page or read page-wise: all-pages 4/10 fully correct, page-wise VLM 6/10 and 93.3% key-header on 10 synthetic documents. Deterministic reconciliation plus OCR totals reaches 10/10 key-header, but that is a pipeline result, not a pure VLM score; line items remain weak. A degraded copy completed 8/10 documents with 7/8 fully correct and 2 page failures. Page-wise is about 2x slower; the 0.3.2 SDK exposes the page-wise path, but it is probe-quality. - How accurate is it? 0.9475 receipt F1 (3B) on SROIE clean-100; 91.9%/65.7% invoice key-header/fully-correct (3B) on a synthetic page-1 probe; 72.0% field / 22/100 fully correct (2B, merge fix shipped in 0.3.1) on a held-out 100 real Portuguese receipts/invoices, five fields; development 74.2% / 18. The opt-in targeted tax retry moves a fresh 100-document set from 70.4% to 72.1% field accuracy (tax 51/82 to 61/82) with no field regression. The 0.3.2 total fallback moves the same set from 401/570 to 404/570 and fully 19 to 22, and a targeted toll/parking stress set from 111/139 to 114/139 and fully 4 to 7; a representative seed-45 sample triggered it 0 times. - How well does it read documents? On 200 public DocVQA images with one reference answer, 0.829 ANLS and 0.765 exact match (2B); a reading probe, not a leaderboard score. - What is planned? Validate the merge fix on the frozen seed-43 real-document holdout, test a receipt-aware/header-first prompt, then chunked page-wise latency work, a dedicated calibration split, and real B2B supplier-invoice evaluation. The preview already ships page-wise merge and OCR total reconciliation locally via `tinydoc ui` and `tinydoc invoice`. ## Citation `eulogik (2026). TinyDoc: Local-First Grounded Document Extraction. https://github.com/eulogik/TinyDoc-VLM`