Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Render 4 min read Case study mediumAdept

A PDF is not a string

Document ingestion for agents breaks because PDFs carry no structural markup, so naive text extraction scrambles multi-column layouts and tables, and frontier models lose accuracy on visual structure while returning flat text with no bounding boxes, confidence or provenance. LlamaParse splits ingestion into classification (document type plus confidence), parsing (layout-aware Markdown with OCR and preserved tables) and extraction (schema-driven JSON), so failures can be traced to a specific stage. The reference architecture on Render uses a thin Express upload service streaming progress over SSE, Render Workflows running five tasks (store, classify, parse, extract, store results), and four Postgres tables holding each intermediate output as an audit trail. Demos showed a receipt classified at 85% confidence and a 24-page bank statement fully parsed with five fields extracted.

Assumes: LLM-based extractionbackground job workflows

Related posts

  • Building document pipelines that actually scale

    Render mediumAdept

    A reference architecture for scalable document processing splits a monolithic upload-and-parse server into a thin web service, a Render Workflows orchestration layer, and a Postgres store. Five discrete TypeScript tasks (upload, classify, parse, extract, store) each run in an isolated instance with their own compute plan, timeout and exponential-backoff retry policy, so one large PDF cannot block unrelated requests and a failure doesn't restart the whole job. LlamaCloud Classify, LlamaParse's agentic tier and LlamaExtract handle document typing, layout-aware parsing to markdown and JSON-Schema field extraction. Results are optionally indexed for hybrid search and RAG, and progress streams to clients via Server-Sent Events.

  • Using AI Tools to Convert a PDF into Images

    Docker mediumAdept

    An LLM agent can convert a PDF into JPEG images by planning an ImageMagick `convert` call that runs in a Docker container, so nothing needs to be installed locally. Tools are defined in Markdown prompt files, distributed through Docker Hub and pulled from nixpkgs. Rather than hand-designing interfaces for each tool, the agent loops through running the tool, capturing errors, reading the tool's own documentation and retrying. One packaging gap, a missing Ghostscript dependency, still had to be fixed by hand in the image build.

  • Dharma Field Extractor: Any Document In, Structured Fields in JSON Out

    Hugging Face easyNovice

    Dharma-AI's Field Extractor is a 2B-parameter vision-language model, a LoRA adapter on DharmaOCR-LITE v1.1 trained on 43,384 field-annotated examples, that turns document images into typed JSON, either open-ended or filling a caller-supplied schema with nulls for missing fields. On a 546-document, 1,638-case benchmark scored by field-level F1 × Levenshtein similarity × valid-JSON rate, it reached 0.834, ahead of four frontier LLM configurations ranging from Claude Opus 5 (0.816) to GPT-5.6 Luna (0.741). Self-hosted on a single L40S, it cost an estimated 6–147× less per extraction than the API list prices. Held-out SROIE and FUNSD examples show correct handling of unlabeled addresses, blank fields and checkbox booleans.

  • Supercharge your OCR Pipelines with Open Models

    Hugging Face mediumAdept

    Vision-language-model-based OCR has moved well beyond plain transcription. Current open-weight models such as OlmOCR-2, Chandra, dots.ocr, DeepSeek-OCR, PaddleOCR-VL, Granite-Docling and Nanonets-OCR2 handle handwriting, tables, charts, formulas and layout grounding, and output DocTags, HTML, Markdown or JSON. Choose the output format by use case: layout-preserving formats for digital reconstruction, Markdown with image captions for LLM input, and JSON for programmatic use. Since performance varies widely by domain, evaluate candidates on your own representative documents alongside OmniDocBench, OlmOCR-Bench and CC-OCR. Open models are cheap to run, around $178 per million pages for OlmOCR-2 on an H100, and serve easily with vLLM behind an OpenAI-compatible client.

  • Finetuning olmOCR to be a faithful OCR-Engine

    Hugging Face mediumAdept

    TNG fine-tuned olmOCR-7B-0225-preview so it no longer drops headers and footers. The original model omits them by design because its training data targets LLM pretraining text, which makes it unreliable for business documents like invoices. The team used Qwen2.5-VL-72B-Instruct to generate an 8,000-document dataset capturing all page content, then trained with the open-source olmOCR pipeline on an 8xH100 node: 2.5 epochs, default hyperparameters, about 6 hours, with roughly two GPUs likely enough. Qualitative comparisons show the fine-tune extracts header and footer data while still parsing simple tables and multi-column layouts, though output quality can vary noticeably with sampling temperature.

The quest for software engineering knowledge.

Look:
Layout: