---
title: "Dharma Field Extractor: Any Document In, Structured Fields in JSON Out"
description: "The Dharma Field Extractor is a 2-billion-parameter model that takes a document image and returns structured JSON by open extraction or by following an exact schema. In open mode it recognizes labels, values, and tables from layout; in schema-directed mode it uses the caller’s key names and types, returning null for absent fields and filling table rows. It was fine-tuned from DharmaOCR-LITE v1.1 via a LoRA adapter on 43,384 field-level annotations drawn from public, Brazilian, and multilingual sources. On a 546-document benchmark covering three extraction scenarios, the Field Extractor scored a field-level F1 of 0.834, beating Claude Opus 5’s 0.816 and GPT-5.6 Luna’s 0.741, while its self-hosted cost ($2.24/hour on one L40S) was 6 to 147 times less per extraction than each API. This supports Dharma-AI’s thesis that a small model specialized on a bounded task outperforms general-purpose frontier models."
---

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

[Hugging Face](https://yomu.fyi/company/hugging-face) · Gabriel Pimenta de Freitas Cardoso, Paulo Henrique de Medeiros Araujo, Bruno Duarte, Francisco de Almeida Rocha Alves · Nov 4, 2026

**Type:** Announcement

## Summary

The Dharma Field Extractor is a 2-billion-parameter model that takes a document image and returns structured JSON by open extraction or by following an exact schema. In open mode it recognizes labels, values, and tables from layout; in schema-directed mode it uses the caller’s key names and types, returning null for absent fields and filling table rows. It was fine-tuned from DharmaOCR-LITE v1.1 via a LoRA adapter on 43,384 field-level annotations drawn from public, Brazilian, and multilingual sources. On a 546-document benchmark covering three extraction scenarios, the Field Extractor scored a field-level F1 of 0.834, beating Claude Opus 5’s 0.816 and GPT-5.6 Luna’s 0.741, while its self-hosted cost ($2.24/hour on one L40S) was 6 to 147 times less per extraction than each API. This supports Dharma-AI’s thesis that a small model specialized on a bounded task outperforms general-purpose frontier models.

## Context

OCR returns raw text without field mapping, forcing downstream systems to manually parse fields from unstructured output.

## Approach / What changed

The Field Extractor is built by training a LoRA adapter on the DharmaOCR-LITE v1.1 checkpoint using 43,384 examples across three streams: English multi-domain documents from the public web, Brazilian documents in Portuguese, and multilingual data covering other languages. Training covers both open extraction and schema-directed modes. The benchmark uses 546 documents across three scenarios (no schema, partial schema, schema with nonexistent fields) and scores field-level F1 multiplied by Levenshtein similarity and proportion of valid JSON.

## Takeaways

- The Field Extractor achieves higher field-level F1 than every frontier API tested while costing 6 to 147 times less per extraction.
- The model supports open extraction (finds all structural fields) and schema-directed extraction (outputs exact keys with types, null for missing).
- A 2-billion-parameter model fine-tuned on the specific task, DharmaOCR-LITE v1.1, beats frontier models, supporting the specialization thesis.

## FAQ

### How does the Field Extractor handle missing fields?

When a schema specifies a field not present in the document, the model returns null for that field instead of inventing a value, ensuring the output matches the schema exactly.

### What is the cost comparison between the Field Extractor and frontier APIs?

The Field Extractor runs on a single L40S GPU at $2.24/hour, making it 6 times cheaper than GPT-5.6 Luna and 147 times cheaper than GPT-5.6 Sol per extraction, though actual cost depends on deployment hardware and volume.

### What types of documents was the model trained on?

The training data includes receipts, invoices, forms, bank statements, IDs, and synthetic documents across English, Portuguese, and other European and Asian languages.

**Tags:** [Document AI](https://yomu.fyi/topic/document-ai), [LLMs](https://yomu.fyi/topic/llm), [OCR](https://yomu.fyi/topic/ocr)

- Source: [Hugging Face](https://huggingface.co/blog/Dharma-AI/dharma-field-extractor)
- Source URL: https://huggingface.co/blog/Dharma-AI/dharma-field-extractor
- Ingested by Yomu: 2026-11-04T18:01:08.371Z

[Read original post](https://huggingface.co/blog/Dharma-AI/dharma-field-extractor)
