Chandra OCR 2: SOTA Complex Layout Extraction, 92.1% Table Accuracy, LaTeX Math, and 90+ Languages
An architectural deep-dive into Datalab's Chandra OCR 2: taking the #1 global spot on the olmOCR benchmark (85.8), outperforming GPT-4o, DeepSeek, and Gemini 2.5 Flash on nested tables, forms with checkboxes, handwritten notes, and high-throughput vLLM production inference.

In enterprise Retrieval-Augmented Generation (RAG) and automated knowledge pipelines, Document Parsing remains the foundational bottleneck.
Even the most sophisticated reasoning models (like Claude 3.5 Sonnet, GPT-4o, or Gemini) produce flawed hallucinations when their input context is poisoned by mangled PDF tables, scrambled multi-column text, or dropped mathematical formulas.
Legacy OCR engines (like Tesseract) and standard cloud vision APIs regularly fail when confronted with:
- Intricate, nested financial spreadsheets and borderless tables.
- Government forms containing interactive checkboxes and radio buttons.
- Mixed printed and handwritten notes.
- Non-Latin scripts (particularly complex Arabic typography with ligatures and diacritics).
Recently, Datalab (the engineering team behind Marker and Surya) released Chandra OCR 2 (datalab-to/chandra), claiming the #1 rank on external document intelligence benchmarks—outperforming specialized models and frontier generalist LLMs alike.
Here is an architectural autopsy of Chandra OCR 2, examining its benchmark performance, layout reconstruction engine, multilingual capabilities, and high-throughput vLLM production deployment.
1. Benchmark Reality Check: The #1 Position on olmOCR
The gold standard for evaluating document extraction fidelity is the independent olmOCR Benchmark, which assesses end-to-end markdown extraction across challenging real-world PDFs (scanned documents, scientific papers, tables, and mixed layouts):
┌────────────────────────────────────────────────────────────────────────┐
│ Global olmOCR Benchmark Scores (2026) │
├─────────────────────────────────────────────────┬──────────────────────┤
│ Model / System │ Score (out of 100) │
├─────────────────────────────────────────────────┼──────────────────────┤
│ Chandra OCR 2 (Datalab API) │ 86.7 (SOTA #1) │
│ Chandra OCR 2 (Self-Hosted Model) │ 85.8 (Open Model #1)│
│ dots.ocr 1.5 │ 83.9 │
│ olmOCR 2 │ 82.4 │
│ DeepSeek OCR │ 75.4 │
│ Mistral OCR API │ 72.0 │
│ GPT-4o (Vision) │ 69.9 │
│ Gemini 2.5 Flash │ 63.8 │
└─────────────────────────────────────────────────┴──────────────────────┘
Chandra OCR 2 demonstrates a substantial margin over frontier generalist multimodal models (beating GPT-4o by nearly 16 points), confirming that specialized vision-document architectures decisively outperform general-purpose LLMs on structural layout fidelity.
2. Architectural Capabilities Under the Hood
┌────────────────────────────────────────────────────────────────────────┐
│ Input Document (PDF / Image) │
│ (Multi-Column • Scanned Receipt • Scientific Paper) │
└───────────────────────────────────┬────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Chandra OCR 2 Core Engine │
│ ┌───────────────────────┐ ┌──────────────────────┐ ┌────────────────┐ │
│ │ Vision Transformer Enc│ │ Layout Tokenizer │ │ Reading Order │ │
│ │ (High-Res Patches) │ │ (Tables / Math / Form│ │ Graph Traversal│ │
│ └───────────────────────┘ └──────────────────────┘ └────────────────┘ │
└───────────────────────────────────┬────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Multi-Format Structured Output │
│ • Clean Markdown (.md): Optimized for RAG chunking & LLM ingestion │
│ • Semantic HTML (.html): Preserves exact table spans & cell styling │
│ • Metadata JSON (_metadata.json): Bounding boxes & confidence scores │
│ • Extracted Asset Folder: Isolated PNGs for charts, figures & photos │
└────────────────────────────────────────────────────────────────────────┘
A. Complex Table Reconstruction (92.1% SOTA)
Traditional parsers collapse table columns when cell borders are absent. Chandra 2 achieved 92.1% on table extraction (compared to 84.9% for olmOCR 2):
- Detects multi-row and multi-column spans (
rowspan,colspan). - Reconstructs nested financial balance sheets into valid, semantic HTML
<table>structures. - Avoids phantom column alignment errors that poison downstream SQL databases.
B. Mathematical Formulas and LaTeX
Scientific and engineering documents rely on complex mathematical notation. Chandra 2 parses inline and display equations directly into clean, standardized LaTeX ($...$ and $$...$$), preventing hallucinated variable substitutions.
C. Forms and Checkboxes
Enterprise workflows often stall on scanned forms. Chandra 2 explicitly recognizes interactive form elements:
- Checkboxes:
[x]vs[ ] - Radio buttons:
(o)vs( ) - Handwritten fill-in-the-blank text mapped to corresponding labels.
D. Multilingual Superiority across 90+ Languages
A common failure mode in open-source OCR is Anglo-centric optimization. Chandra 2 was trained across a balanced corpus of 90 languages:
- Overall 90-Language Average: 72.7% (vs. Gemini 2.5 Flash at 60.8%).
- Common 43-Language Average: 77.8% (vs. Gemini 2.5 Flash at 67.6% and GPT-5 Mini at 60.5%).
- Arabic Typography Leap: Surged from 34.0% in Chandra 1 to 68.4% in Chandra 2, properly handling Arabic cursive ligatures, diacritics, and right-to-left layout ordering.
3. Production Deployment: vLLM vs. Hugging Face
To serve enterprise ingestion pipelines, Chandra 2 supports two execution backends:
| Metric | Hugging Face (Transformers) | vLLM Engine (chandra_vllm) |
|---|---|---|
| Primary Use Case | Local debugging, single-page scripts | High-throughput batch processing |
| VRAM Footprint | ~16GB (BF16 / FP16) | ~24GB - 40GB with PagedAttention |
| Throughput (H100) | ~0.3 - 0.5 pages / sec | 1.44 - 2.0 pages / sec (Batch Size: 28) |
| Multi-GPU Scaling | Manual DDP | Native Tensor Parallelism |
Step 1: Installation
# Core package installation
pip install chandra-ocr
# For high-throughput vLLM serving
pip install vllm
Step 2: CLI Batch Extraction
To process a multi-page PDF into structured Markdown and extracted assets:
chandra input_document.pdf ./parsed_output/ --method vllm
The output directory contains:
parsed_output/
├── input_document.md # Clean, RAG-ready markdown
├── input_document.html # Semantic HTML preserving layouts
├── input_document_metadata.json # Bounding boxes and confidence scores
└── images/ # Extracted figures and chart crops
├── figure_page1_1.png
└── chart_page3_2.png
Step 3: Python API Integration
from chandra import ChandraParser
# Initialize parser with high-speed vLLM backend
parser = ChandraParser(method="vllm", batch_size=16)
# Extract structured content from a complex invoice or paper
result = parser.parse("financial_report.pdf")
print("Generated Markdown:")
print(result.markdown)
# Inspect table accuracy
for table in result.tables:
print(f"Table on page {table.page}:")
print(table.html)
4. Architectural Summary & Impact on Modern RAG
| Dimension | Chandra OCR 2 Specification |
|---|---|
| Code License | Apache 2.0 (Permissive Open Source) |
| Model License | OpenRAIL-M (Free for research, personal, and startups under $2M revenue) |
| Benchmark Rank | #1 on olmOCR Benchmark (85.8) |
| Table Accuracy | 92.1% (Best-in-class) |
| Supported Languages | 90+ Natural Languages |
| Output Formats | Markdown, Semantic HTML, JSON, Extracted Figures |
| Inference Backends | vLLM Engine, Hugging Face Transformers |
The Production Verdict:
In any data architecture, the quality of downstream LLM reasoning is strictly bounded by the fidelity of your ingestion pipeline.
Chandra OCR 2 establishes that you no longer need to accept messy OCR hallucinations or pay exorbitant API fees for proprietary vision models. With native vLLM acceleration and unmatched table and math extraction, it serves as an ideal open foundational parser for modern enterprise RAG and autonomous knowledge agents.
Written by Fouad Salkini (فؤاد سلقيني)
General Manager & Tech Lead at Tripnologies and Sync Studios. Systems Architect focusing on AI coding agents, DevOps, and quantitative systems.