Sarvam Extract Pulls Structured Data From Long PDFs at 65% Less Cost
Sarvam Extract turns messy PDFs into structured JSON with citations, hitting 95.4 on ExtractBench at roughly a third of Gemini 3.8 Flash list cost.
Takeaways
- Sarvam launches Extract API, structured document extraction powered by Sarvam Vision 2.1.
- Advanced mode scores 95.4 on ExtractBench at ₹2.50 per page; Basic scores 94.4 at ₹1.
- On documents over 50 pages, scores 93 vs 28 for single-call Gemini 3.8 Flash.
- Locate-then-read architecture keeps a smaller model accurate on long tables and lists.
- Every value returns with confidence score, page number, and normalized bounding box.
- Supports 500-page files, English plus 22 Indian languages; API docs here.
Sarvam has released Sarvam Extract, an asynchronous document-extraction API that maps user-defined fields from PDFs into structured JSON. Each returned value includes its source page, bounding box, and confidence score.
The service runs on Sarvam Vision 2.1 and targets long, irregular documents such as bank statements, credit reports, sanctions lists, earnings presentations, and legal contracts. Developers define the required output with JSON Schema, including nested objects, arrays, and optional enums.
The benchmark claim, in numbers
On ExtractBench, LlamaIndex’s 370-document benchmark, Sarvam reports that Advanced mode scored 95.4 out of 100 at ₹2.50 per page, or $25 per 1,000 pages. Basic mode scored 94.4 at ₹1 per page, or $10 per 1,000 pages.
| Product and mode | ExtractBench score | Reported price per page |
|---|---|---|
| Sarvam Extract Advanced | 95.4 | ₹2.50 |
| Sarvam Extract Basic | 94.4 | ₹1.00 |
| LlamaExtract Agentic Plus | 96.2 | ₹7.12 |
| Reducto Deep Extract | 96.1 | ₹6.03 |
Advanced trails the two higher-scoring systems by 0.7 to 0.8 points while costing 59% to 65% less per page. In benchmark terms, that places it on the accuracy-cost Pareto frontier, where no compared configuration delivers both higher accuracy and a lower price. Sarvam reported these runs on a third-party benchmark; production results will still depend on document mix, schema design, latency, and review thresholds.
Long PDFs punish single calls
Sarvam reports a wider gap on documents longer than 50 pages: Extract scored 93 out of 100, compared with 28 for Gemini 3.8 Flash when the entire document was processed in one call. On files containing lists of at least 100 rows, Extract Advanced returned about 98% of rows, while the single-call Gemini configuration returned about 10%.
The published error cases expose three recurring constraints: selecting the relevant page, reconciling repeated structures across pages, and generating long JSON responses without truncation.
- A single-call Gemini run extracted 8 names from a sanctions list containing 1,238.
- A page-by-page run on a Veralto earnings deck selected quarterly operating profit of 316 instead of the annual figure of 1,277. It also returned 20 business segments instead of two because it failed to reconcile similar tables across slides.
- OCR-first pipelines can convert every page to text and still lose data when output-token limits truncate a long JSON array.
Locate, read, verify
Sarvam splits page selection from value extraction. The system first identifies which pages contain each requested field or table, then assigns those fields to page-level reading calls. When a value appears in several places, the location stage selects the relevant occurrence before extraction.
| Stage | What it does |
|---|---|
| Parse | Sarvam Vision 2.1 interprets each page, including scanned content. |
| Locate | Finds source pages for requested fields and tracks tables across page boundaries. |
| Read | Processes one page with only the fields assigned to that page. |
| Check | Runs code-based validations and adjusts confidence when a check fails. |
Each page-level call receives a smaller input and produces a shorter response, reducing pressure on context and output-token limits. The verification stage can compare amounts written in words with numeric totals, check whether a GST number contains the business’s PAN, and confirm that line items add up to the stated total. Failed checks lower confidence and flag values for review.
Advanced adds cross-page context
Advanced mode supplements Basic’s page-level extraction with a second read covering the full document. Longer files are divided into sections for this pass, which provides context for distinctions such as quarterly versus annual figures. When the two reads disagree, the system returns to the source page and checks the value again.
Submit, poll, fetch
Developers use the API reference to run extraction as an asynchronous job:
- Submit a PDF, JSON Schema, and extraction mode.
- Poll the job until processing finishes.
- Fetch the structured result and its annotations.
The schema supports nested objects and arrays up to four levels deep, along with optional enums. The following Python example creates an Advanced extraction job:
import json
from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_KEY")
schema = {
"type": "object",
"properties": {
"invoice_number": {"type": "string"},
"grand_total": {"type": "number"}
}
}
with open("invoice.pdf", "rb") as file:
job = client.doc_ai.extract(
file=[("invoice.pdf", file, "application/pdf")],
schema=json.dumps(schema),
mode="advanced",
)
Each extracted value carries a confidence score from 0 to 1 and a bbox_norm annotation. The bounding-box coordinates are expressed as fractions of the page width and height, allowing a review interface to highlight the exact source region.
Normalization converts amounts and dates when the source format is unambiguous. For example, ₹ 1,25,524.00 becomes:
{
"amount": 125524,
"currency": "INR"
}
Deployment boundaries
- Files can contain up to 500 pages.
- Advanced mode’s second whole-document pass supports up to 200 pages and Latin, Greek, and Cyrillic scripts.
- Core extraction supports English and 22 Indian languages while preserving values in their source scripts.
- Known errors include adding or omitting words within a value, selecting a neighboring item’s value, dropping rows from long tables, and returning empty cells.
- The hosted service is available in India and the United States, with on-premises deployment offered to enterprises.
- Billing covers successfully processed pages only.
Benchmark it on local documents
Production evaluations should measure exact field accuracy, row recall, source-page and bounding-box correctness, confidence calibration, latency, and total cost per completed document. The comparison should use identical schemas and files across systems, including scans, repeated tables, and documents near the supported page limits.
Teams combining OCR with a vision-language model can use Extract as a direct comparison for long-document recall and provenance. Page price provides one part of that calculation; missed rows, incorrect source regions, and human-review time determine the operational cost.