Lakewright solutions / brief

Extract scanned PDFs and images into Apache Iceberg with self-hosted OCR

Scanned invoices, faxes, and forms become searchable, structured rows in Iceberg — OCR runs on your own GPU with your own vision model, so documents with PHI or PII never leave your environment.

How does the pipeline decide what needs OCR?

PDF profiling reads page count and text-layer presence. Born-digital PDFs extract text directly; scanned ones render page images for the vision model. Images (TIFF/JPEG/PNG) route straight to OCR. Document metadata (kind, pages, dimensions) lands as inventory tables either way.

The steps

export LAKEWRIGHT_LLM_BASE_URL=http://your-gpu:11434/v1  # your model
lakewright scan  s3://document-dump      # flags needs_ocr per file
lakewright approve plans/claim_scans.plan.yaml
lakewright load  plans/claim_scans.plan.yaml --rest $CATALOG

FAQ

Which models?Any OpenAI-compatible vision endpoint — reference setup is qwen3-vl on a single local GPU box.
Email attachments?.eml/mbox files expand automatically: message inventory plus every attachment routed through the same pipeline.

The question that matters

"Which vendors send us invoices with no purchase order number, and what is the exposure?"

Evidence that was previously invisible, because it lived inside images.

The assistant totalled invoices where the PO field came back empty from OCR, grouped by vendor, and returned both the count and the summed value — a control gap in plain numbers. In the sample data the exposure concentrates in a handful of vendors, which usually means a process difference at their end rather than widespread indiscipline, and that is a solvable conversation.

Two honest notes it surfaced without prompting: a small number of documents scored low on OCR confidence and are worth a human glance before they enter a dispute, and each figure links back to the page it was read from, so anyone challenging a number can look at the actual invoice image rather than argue about the extract.

Want this run against your data?

We start with a read-only scan and an inventory report — no installation on your systems, nothing leaves your environment. Most engagements produce findings the team didn't know about in the first afternoon.

Start a conversation