Back to Models
datalab-to logo

datalab-to/chandra-ocr-2

datalab-toimage

Datalab Logo

Chandra OCR 2

Chandra 2 is a state of the art OCR model from Datalab that outputs markdown, HTML, and JSON. It is highly accurate at extracting text from images and PDFs, while preserving layout information.

Try Chandra in the free playground, or use the hosted API for higher accuracy and speed.

What's New in Chandra 2

  • 85.9% olmocr bench score (sota), 77.8% multilingual bench score (12% improvement over Chandra 1)
  • Significant improvements to math, tables, complex layouts
  • Improved layout, especially on wider documents
  • Significantly better image captioning
  • 90+ language support with major accuracy gains

Features

  • Convert documents to markdown, HTML, or JSON with detailed layout information
  • Excellent handwriting support
  • Reconstructs forms accurately, including checkboxes
  • Strong performance with tables, math, and complex layouts
  • Extracts images and diagrams, with captions and structured data
  • Support for 90+ languages

Quickstart

pip install chandra-ocr

# With vLLM (recommended, easy install)
chandra_vllm
chandra input.pdf ./output

# With HuggingFace (requires torch)
pip install chandra-ocr[hf]
chandra input.pdf ./output --method hf

Usage

With vLLM (recommended)

from chandra.model import InferenceManager
from chandra.model.schema import BatchInputItem
from PIL import Image

# Start vLLM server first with: chandra_vllm
manager = InferenceManager(method="vllm")
batch = [
    BatchInputItem(
        image=Image.open("document.png"),
        prompt_type="ocr_layout"
    )
]
result = manager.generate(batch)[0]
print(result.markdown)

With HuggingFace Transformers

from transformers import AutoModelForImageTextToText, AutoProcessor
from chandra.model.hf import generate_hf
from chandra.model.schema import BatchInputItem
from chandra.output import parse_markdown
from PIL import Image
import torch

model = AutoModelForImageTextToText.from_pretrained(
    "datalab-to/chandra-ocr-2",
    dtype=torch.bfloat16,
    device_map="auto",
)
model.eval()
model.processor = AutoProcessor.from_pretrained("datalab-to/chandra-ocr-2")
model.processor.tokenizer.padding_side = "left"

batch = [
    BatchInputItem(
        image=Image.open("document.png"),
        prompt_type="ocr_layout"
    )
]

result = generate_hf(batch, model)[0]
markdown = parse_markdown(result.raw)
print(markdown)

Benchmarks

olmOCR Benchmark

ModelArXivOld Scans MathTablesOld ScansHeaders and FootersMulti columnLong tiny textBaseOverallSource
Datalab API90.490.290.754.691.683.792.399.986.7 ± 0.8Own benchmarks
Chandra 290.289.389.949.892.583.592.199.685.9 ± 0.8Own benchmarks
dots.ocr 1.585.985.590.748.294.085.381.699.783.9dots.ocr repo
Chandra 182.280.388.050.490.881.292.399.983.1 ± 0.9Own benchmarks
olmOCR 283.082.384.947.796.183.781.999.682.4olmocr repo
dots.ocr82.164.288.340.994.182.481.299.579.1 ± 1.0dots.ocr repo
olmOCR v0.3.078.679.972.943.995.177.381.298.978.5 ± 1.1olmocr repo
Datalab Marker v1.10.083.869.774.832.386.679.485.799.676.5 ± 1.0Own benchmarks
Deepseek OCR75.272.379.733.396.166.780.199.775.4 ± 1.0Own benchmarks
Mistral OCR API77.267.560.629.393.671.377.199.472.0 ± 1.1olmocr repo
GPT-4o (Anchored)53.574.570.040.793.869.360.696.869.9 ± 1.1olmocr repo
Qwen 3 VL 8B70.275.145.637.589.162.143.094.364.6 ± 1.1Own benchmarks
Gemini Flash 2 (Anchored)54.556.172.134.264.761.571.595.663.8 ± 1.2olmocr repo

Examples

TypeNameLink
TablesStatistical DistributionView
TablesFinancial TableView
FormsRegistration FormView
FormsLease FormView
MathCS229 TextbookView
MathHandwritten MathView
MathChinese MathView
HandwritingCursive WritingView
HandwritingHandwritten NotesView
LanguagesArabicView
LanguagesJapaneseView
LanguagesHindiView
LanguagesRussianView
OtherChartsView
OtherChemistryView

Multilingual Benchmark (43 Languages)

The table below covers the 43 most common languages, benchmarked across multiple models. For a comprehensive evaluation across 90 languages (Chandra 2 vs Gemini 2.5 Flash only), see the full 90-language benchmark.

LanguageDatalab APIChandra 2Chandra 1Gemini 2.5 FlashGPT-5 Mini
ar67.6%68.4%34.0%84.4%55.6%
bn85.1%72.8%45.6%55.3%23.3%
ca88.7%85.1%84.2%88.0%78.5%
cs88.2%85.3%84.7%79.1%78.8%
da90.1%91.1%88.4%86.0%87.7%
de93.8%94.8%83.0%88.3%93.8%
el89.9%85.6%85.5%83.5%82.4%
es91.8%89.3%88.7%86.8%97.1%
fa82.2%75.1%69.6%61.8%56.4%
fi85.7%83.4%78.4%86.0%84.7%
fr93.3%93.7%89.6%86.1%91.1%
gu73.8%70.8%44.6%47.6%11.5%
he76.4%70.4%38.9%50.9%22.3%
hi80.5%78.4%70.2%82.7%41.0%
hr93.4%90.1%85.9%88.2%81.3%
hu88.1%82.1%82.5%84.5%84.8%
id91.3%91.6%86.7%88.3%89.7%
it94.4%94.1%89.1%85.7%91.6%
ja87.3%86.9%85.4%80.0%76.1%
jv87.5%73.2%85.1%80.4%69.6%
kn70.0%63.2%20.6%24.5%10.1%
ko89.1%81.5%82.3%84.8%78.4%
la78.0%73.8%55.9%70.5%54.6%
ml72.4%64.3%18.1%23.8%11.9%
mr80.8%75.0%57.0%69.7%20.9%
nl90.0%88.6%85.3%87.5%83.8%
no89.2%90.3%85.5%87.8%87.4%
pl93.8%91.5%83.9%89.7%90.4%
pt97.0%95.2%84.3%89.4%90.8%
ro86.2%84.5%82.1%76.1%77.3%
ru88.8%85.5%88.7%82.8%72.2%
sa57.5%51.1%33.6%44.6%12.5%
sr95.3%90.3%82.3%89.7%83.0%
sv91.9%92.8%82.1%91.1%92.1%
ta82.9%77.7%50.8%53.9%8.1%
te69.4%58.6%19.5%33.3%9.9%
th71.6%62.6%47.0%66.7%53.8%
tr88.9%84.1%68.1%84.1%78.2%
uk93.1%91.0%88.5%87.9%81.9%
ur54.1%43.2%28.1%57.6%16.9%
vi85.0%80.4%81.6%89.5%83.6%
zh87.8%88.7%88.3%70.0%70.4%
Average80.4%77.8%69.4%67.6%60.5%

Full 90-Language Benchmark

We also have a more comprehensive evaluation covering 90 languages, comparing Chandra 2 against Gemini 2.5 Flash. The average scores are lower than the 43-language table above because this includes many lower-resource languages. Chandra 2 averages 72.7% vs Gemini 2.5 Flash at 60.8%.

See the full 90-language results.

Throughput

Benchmarked with vLLM on a single NVIDIA H100 80GB GPU using a diverse mix of documents (math, tables, scans, multi-column layouts) from the olmOCR benchmark set. This set is significantly slower than real-world usage - we estimate 2 pages/s in real-world usage.

ConfigurationPages/secAvg LatencyP95 LatencyFailure Rate
vLLM, 96 concurrent sequences1.4460s156s0%

Commercial Usage

Code is Apache 2.0. Model weights use a modified OpenRAIL-M license: free for research, personal use, and startups under $2M funding/revenue. Cannot be used competitively with our API. For broader commercial licensing, see pricing.

Credits

Visit Website

0 reviews

5
0
4
0
3
0
2
0
1
0
Likes311
Downloads
📝

No reviews yet

Be the first to review datalab-to/chandra-ocr-2!

Model Info

Providerdatalab-to
Categoryimage
Reviews0
Avg. Rating / 5.0

Community

Likes311
Downloads

Rating Guidelines

★★★★★Exceptional
★★★★Great
★★★Good
★★Fair
Poor