Skip to navigation

Sarvam Vision

View as Markdown

Sarvam Vision is a 3B parameter state-space Vision Language Model (VLM) purpose-built for high-accuracy document understanding. It powers the Document AI API.

At a Glance

Model IDsarvam-vision
What it doesDocument understanding, text extraction, table conversion, and structure preservation from PDFs and scans
Languages23 (22 Indian + English), full list
APIsDocument AI, Parse and Extract
Input limitsPage, file-size, and rate limits are set per operation, and rate limits scale with your plan. See Languages, Formats & Limits
PricingPricing page
Best forParsing scanned archives, Indic OCR, table-heavy documents
Known limitationsEach operation has a per-request page limit. Cut longer PDFs into chunks before uploading (see Long documents)

Why Sarvam Vision?

One of the most challenging problems in vision AI today is accurate document understanding for Indian languages. Much of India’s knowledge, historical texts, government records, academic papers, and cultural archives, remains locked in libraries, scanned collections, and legacy documents. Unlocking this vast repository is essential for preserving cultural heritage and making knowledge accessible.

While frontier Vision Language Models have set a high bar for processing modern English documents, a significant gap remains: most global models treat Indian languages as secondary, often resulting in lower accuracy for regional scripts. Sarvam Vision bridges this gap with native support for 22 Indian languages, delivering world-class accuracy where others fall short.

Want to learn more about how we built Sarvam Vision? Check out our blog post.


What You Can Do

  • Text Extraction: Extract text from PDFs and scanned documents in 23 languages (22 Indian + English)
  • Tables: Convert complex tables to HTML or Markdown
  • Structure Preservation: Maintain document layout, reading order, and hierarchies

Supported Languages

All 22 official Indian languages plus English:

LanguageCodeLanguageCodeLanguageCode
Hindihi-INAssameseas-INKonkanikok-IN
Bengalibn-INUrduur-INMaithilimai-IN
Tamilta-INSanskritsa-INSindhisd-IN
Telugute-INNepaline-INKashmiriks-IN
Marathimr-INDogridoi-INManipurimni-IN
Gujaratigu-INBodobrx-INSantalisat-IN
Kannadakn-INPunjabipa-INEnglishen-IN
Malayalamml-INOdiaod-IN

Capabilities

High-Fidelity Document Understanding

Sarvam Vision extracts text from documents with exceptional accuracy, preserving the original structure and reading order across 23 languages (22 Indian + English).

Features:

  • High-accuracy text extraction from PDFs and scanned documents
  • Preserves document layout and reading order
  • Native support for all Indian scripts
  • Outputs clean HTML or Markdown

Quick Start

Get started with Document AI for high-fidelity text extraction across all supported languages. Create the job in one call, poll until it reaches a terminal state, then fetch the output.

import os, time
from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key=os.environ["SARVAM_API_KEY"])
# Create and submit a parse job in one call
with open("document.pdf", "rb") as f:
job = client.doc_ai.parse(
file=[("document.pdf", f, "application/pdf")],
language="hi-IN",
output_format="md", # "html" (default) or "md"
)
print("job created:", job.job_id, "| status:", job.status)
# Poll until the job reaches a terminal state
TERMINAL = {"completed", "partially_completed", "failed", "rejected"}
while True:
st = client.doc_ai.get_status(job_id=job.job_id)
print(f"status={st.status} pages={st.usage.pages_processed}/{st.usage.pages_total}")
if st.status in TERMINAL:
break
time.sleep(5)
# Fetch the output (a ZIP holding the .md plus page-level JSON)
if st.status in ("completed", "partially_completed"):
dl = client.doc_ai.get_download_url(job_id=job.job_id)
print("download:", dl.method, dl.url)

Extract fields

To pull specific fields instead of the whole page, call extract with a schema. Set mode to basic (the default) or advanced. advanced adds a second reading of the whole document for context-heavy files such as financial statements and filings. See Choose a mode.

import json, os
from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key=os.environ["SARVAM_API_KEY"])
schema = {
"type": "object",
"properties": {
"invoice_number": {"type": "string", "description": "Invoice number, near the top"},
"total_due": {"type": "number", "description": "Total amount due, in INR"},
},
}
with open("invoice.pdf", "rb") as f:
job = client.doc_ai.extract(
file=[("invoice.pdf", f, "application/pdf")],
schema=json.dumps(schema),
mode="basic", # "basic" (default) or "advanced"
)
print("job created:", job.job_id, "| status:", job.status)

Poll and download the result the same way as the Parse example above.

See the Document AI overview for the operations, How to extract for schema-based extraction, and Jobs & Errors for the full job lifecycle.

Deprecated. Use doc_ai above. The older Document Digitization API used a multi-step job flow (create → upload → start → poll → download).

from sarvamai import SarvamAI
client = SarvamAI(
api_subscription_key="YOUR_SARVAM_API_KEY"
)
# Create a Document Digitization job
job = client.document_intelligence.create_job(
language="hi-IN",
output_format="md"
)
print(f"Job created: {job.job_id}")
# Upload document
job.upload_file("document.pdf")
print("File uploaded")
# Start processing
job.start()
print("Job started")
# Wait for completion
status = job.wait_until_complete()
print(f"Job completed with state: {status.job_state}")
# Get processing metrics
metrics = job.get_page_metrics()
print(f"Page metrics: {metrics}")
# Download output (ZIP file containing the processed document)
job.download_output("./output.zip")
print("Output saved to ./output.zip")

Model Specifications

Technical Specifications
  • Model Size: 3B parameters
  • Supported Input Formats: PDF, PNG, JPG, ZIP (flat archive with JPG/PNG document pages)
  • Output Formats: HTML, Markdown (md) (delivered as ZIP file). JSON with structured page-level data is always included by default, regardless of the chosen output format.
  • Languages: 23 languages (22 Indian + English)

Limits

Page, file-size, and rate limits are set per operation (Parse, Extract, Split and Classify), and rate limits scale with your plan. See Languages, Formats & Limits for the current values, or Pricing for the per-plan table.


Next Steps