← Back
Hugging Face Blog

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

•8 min read•
#llm
Level:Advanced
For:AI Engineers
✦TL;DR

The Dharma Field Extractor is a 2‑billion‑parameter model that extracts user‑specified fields from any document image and returns typed, nested JSON, outperforming frontier LLMs on this task at a fraction of the cost. It can operate in an open mode (no schema) or a schema‑directed mode where exact field names and types are supplied. This enables high‑volume, low‑latency extraction pipelines without per‑type fine‑tuning. Engineers can replace generic OCR + prompting stacks with a single model checkpoint that directly produces downstream‑ready data.

⚡ Key Takeaways

  • 2‑billion‑parameter model that outperforms frontier LLMs on field extraction while costing less.
  • Supports two request patterns: open (no schema) and schema‑directed (exact field names and types).
  • Returns fully typed JSON with nested structures, including ordered lists for tables and null for missing fields.
  • No per‑document‑type fine‑tuning required; the same checkpoint handles invoices, IDs, medical requisitions, contracts, etc.
💡 Why It Matters

By delivering structured data directly from images, the Field Extractor eliminates the OCR + prompting loop, cutting latency and cost for high‑throughput enterprise workflows such as invoice processing or medical scheduling.

✅ Practical Steps

  1. Send a document image to the Field Extractor API, optionally including a JSON schema that defines the desired fields and their types, to receive structured JSON output.
  2. Choose open mode when the document’s contents are unknown, and schema‑directed mode when the downstream system requires exact field keys.

Want the full story? Read the original article.

Read on Hugging Face Blog ↗

More like this

Censored vs. Truncated Regression in Python, Explained

Towards Data Science•#llm

How Google Duplex evolved to also call businesses for you in Gemini

Google Research•#agents

Q&A: Enabling more human-like interactions and understanding in multimodal foundation models

MIT News AI•#llm

Welcome Inkling 2 Mini, Cutting-edge Performance for your Local Setup

Hugging Face Blog•#llm

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING