Brazil's Dharma-AI Releases a 2B-Parameter Field Extractor: Document Images In, Structured JSON Out, Self-Reporting 0.834 Against Claude Opus 5's 0.816

Dharma-AI, a lab that builds small language models, released Dharma Field Extractor on the Hugging Face blog on November 4. The 2-billion-parameter model takes images of documents such as invoices, receipts, forms and IDs and returns structured JSON in either an open mode or a schema-directed mode, returning null for fields the document does not contain. It is built on a new 2B version of DharmaOCR-LITE, the OCR model the company released in April, with a LoRA adapter trained on 43,384 examples. On the company's own benchmark of 546 documents and 1,638 cases it scored 0.834; among the four general-purpose frontier configurations tested, the closest, Claude Opus 5, scored 0.816 and the lowest, GPT-5.6 Luna, 0.741. By the company's math, self-hosting on a single L40S makes each extraction roughly 6 to 147 times cheaper than the APIs, though the two sides are priced differently.

Not the whole page, just the fields

Dharma-AI, a Brazilian research lab focused on small language models, released Dharma Field Extractor on the Hugging Face blog on November 4. It targets the step after OCR: OCR returns everything printed on a page, but it does not say which string is the invoice number or which figure is the total, so someone still has to write code that maps values to fields. Field Extractor takes a document image and returns structured JSON directly.

It accepts two kinds of request. In open mode no schema is supplied, and the model works out from layout and context which parts of the page are label-and-value pairs or tables with headers, returning everything it finds. In schema-directed mode the caller specifies field names and types (string, number or boolean); the output contains exactly those keys, and a field that is not on the document comes back as null rather than an invented value. Invoice line items come back as an ordered list, each with its own quantity and amount. Dharma-AI says a single checkpoint handles all document types without per-type fine-tuning.

How it was trained and scored

The base model is DharmaOCR-LITE v1.1, a new 2B version of the OCR model the company released in April, already tuned with supervised fine-tuning and DPO. On top of it the team trained a LoRA adapter on 43,384 examples drawn from English multi-domain documents collected from the public web, real Brazilian Portuguese documents sourced internally, and a smaller share of other European and Asian languages.

The benchmark covers 546 documents across three scenarios, extracting every field with no schema, a partial schema with only real fields, and a schema that deliberately includes nonexistent fields, for 1,638 cases. The score is field-level F1 multiplied by the Levenshtein similarity of matched values and by the share of valid JSON outputs. Field Extractor scored 0.834; among four general-purpose frontier configurations, the closest, Claude Opus 5, scored 0.816 and the widest gap was GPT-5.6 Luna at 0.741. The frontier models ran with reasoning set to low, with Claude Opus 5 on adaptive effort. The public SROIE and FUNSD datasets in the benchmark were held out from training.

Read the cost comparison carefully

The blog says that per extraction, Field Extractor costs roughly 6 times less than GPT-5.6 Luna and up to 147 times less than GPT-5.6 Sol. The two sides are calculated differently, though: the API figures use measured token usage at published list prices, while Field Extractor's figure is GPU time on a single L40S at $2.24 per hour. Dharma-AI notes that this is not a sales price and that real cost depends on hardware, volume and latency needs.

All scores come from Dharma-AI's own benchmark and have not been independently reproduced, and the training data is mostly English and Brazilian Portuguese, so performance on Chinese and other languages is untested. The blog links to an online demo and does not say whether the weights are public. For teams that pull the same fields out of large volumes of paperwork every day and want the data to stay on their own machines, a specialized small model like this is worth benchmarking against their own samples.

via: Hugging Face blog: Dharma Field Extractor: Any Document In, Structured Fields in JSON Out