Understanding the Dharma Field Extractor for Document Processing
An overview of the Dharma Field Extractor model, detailing its architecture, dual extraction modes, benchmark performance, infrastructure costs, and limitations based on the Hugging Face blog post by Dharma AI.
According to the source blog post on Hugging Face (Dharma Field Extractor), the Dharma Field Extractor is a 2-billion-parameter document processing model. The source states that it is built on the DharmaOCR-LITE v1.1 base checkpoint and was optimized using supervised fine-tuning alongside Direct Preference Optimization (DPO).
The training process utilized a LoRA adapter across 43,384 examples. The source reports that this training data spans three distinct streams: English multi-domain data, Brazilian domain data in Portuguese, and a smaller multilingual share covering various European and Asian languages.
How It Works: Operational Modes
The source explains that the model supports two distinct operational modes for handling documents:
- Open Mode: Extracts key-value pairs without a predefined schema, relying instead on context and document layout.
- Schema-directed Mode: Enforces a strict output structure with defined data types (such as string, number, or boolean). If a field is missing, this mode returns
null.
For a concrete example, a developer processing an invoice can use Schema-directed mode to enforce an output that matches a strict database schema. If the invoice lacks a specific field, the model returns null for that key rather than inventing a value.
Why Developers Might Care
Developers building document-heavy pipelines often face high costs when using per-token frontier APIs. The source presents benchmark results from a 546-document evaluation (covering 1,638 total cases across three scenarios) where the model achieved a score of 0.834. According to the source, this outperformed several tested general-purpose frontier configurations, which ranged from Claude Opus 5 at 0.816 down to GPT-5.6 Luna at 0.741.
Regarding infrastructure, the source reports that self-hosting the model on a single L40S GPU costs $2.24 per hour. The source claims this setup yields a cost per extraction that is 6 to 147 times lower than the measured token-based pricing of the evaluated frontier APIs.
Limitations
Developers should consider several constraints noted in the source material:
- Infrastructure Expenses: The reported cost comparisons rely entirely on a specific setup using a single L40S GPU at $2.24 per hour. The source notes that actual self-hosted expenses will vary based on processing volume, deployment infrastructure, and latency requirements.
- Domain Boundaries: Although the model was trained across receipts, invoices, forms, bank statements, and IDs, the source measures its performance on a specific benchmark dataset. Performance on highly specialized, out-of-domain documents outside the training streams is not guaranteed by the source.