Skip to content

Notes from a hybrid OCR + LLM invoice pipeline

Rehan Sathio

Status
Pilot complete
Date
2026
Tags
Document AI · OCR · LLM extraction

01Pipeline

  • pdfplumber for digital PDFs; Tesseract OCR (PSM 6, 300 DPI) for scans.
  • Gemini 2.5 Flash with strict JSON prompt templates for vendors, invoice numbers, currencies, taxes and line items.
  • JSON logs and multi-sheet Excel output with duplicate validation.

02The interesting question

Accuracy is not the hard part on eight invoices. Knowing when the extraction is wrong, without a human checking every field, is. That question now drives a lot of my reading in document AI.