Surya is a 650M-parameter document optical character recognition (OCR) model and the Python package that runs it. A single vision-language model covers layout analysis, OCR of a full page or of individual blocks, and table recognition, while smaller separate models handle line-level text detection and OCR error detection. Equations come back inline inside tags as KaTeX-compatible LaTeX, so mathematics needs no second pass.
Inference runs against a local server the package spawns on first use: vLLM on an NVIDIA GPU, or llama.cpp on CPU and Apple Silicon. You can point it at an existing OpenAI-compatible server through a configurable URL instead, and --keep_server leaves a spawned server up so later commands attach to it rather than paying the startup and model-load cost again. Command-line entry points cover OCR, text-line detection, layout, and table recognition, and a Streamlit application runs the same models interactively on images and PDF files.
Results come back as JSON keyed by input filename. Each page holds blocks in reading order, each with a canonical layout label such as Text, SectionHeader, Table, Equation, or Picture, the block content as HTML, a four-corner polygon and derived bounding box, and a confidence score averaged over the block's decode. The scope is document OCR rather than photographs or natural scenes. Layout, OCR, and table recognition all need a running inference backend, while detection runs on torch alone.
Surya 2 is evaluated end to end on olmOCR-bench. The LightOnOCR 2-1B entry below uses a different benchmark methodology, so its score is listed for context rather than as a direct comparison, and the other comparison scores come from the benchmark's own dataset card.
| Model | Params | Score |
|---|---|---|
| Infinity-Parser2-Pro | 35.1B | 87.6 |
| Chandra OCR 2 | 4.0B | 85.9 |
| dots.mocr | 3.0B | 83.9 |
| Surya OCR 2 | 0.65B | 83.3 |
| LightOnOCR 2-1B | 1.0B | 83.2 |
| Chandra OCR 1 | 9.0B | 83.1 |
| olmOCR (anchored) | 8.3B | 77.4 |
| GOT OCR | 0.6B | 48.3 |
Features
- Single-model pipeline: layout, OCR, and table recognition share one vision-language model of about 650M parameters
- Layout analysis: canonical labels for text, section headers, tables, pictures, equations, forms, and page headers, with reading order
- Table recognition: rows and columns by default, or full HTML output for spanning cells and headers
- Inline mathematics: equations returned inside tags as KaTeX-compatible LaTeX within the surrounding page HTML
- Multilingual: 87.2% pass rate across a 91-language internal benchmark, with 38 languages at or above 90% and 76 at or above 80%
- Per-source scores: on the olmOCR-bench default preset, 99.7 on base text, 93.7 on tiny text, 92.5 on headers and footers, 88.3 on arXiv, 86.6 on tables, 82.4 on multi-column, 81.4 on old math, and 41.8 on old scans
- Inference backends: vLLM on NVIDIA GPUs or llama.cpp on CPU and Apple Silicon, spawned automatically or attached to a running server
- Throughput: 5.35 pages per second at concurrency 128 on a single RTX 5090 with vLLM, and 0.108 pages per second on Apple Silicon with llama.cpp at --parallel 8
- Structured output: JSON per page with block HTML, polygon, bounding box, confidence, and reading-order index
- Interactive app: a Streamlit interface (surya_gui) for trying images and PDF files by hand
- Separate detection model: a modified EfficientViT segformer trained on document line annotations, which runs on torch without an inference backend
- Tunable detection: blank and text thresholds adjust line splitting and text joining for old or blurry scans


