v0.20.0
Textualize/textualv0.20.0May 27, 2026by VikParuchuri
AI Summary
Surya OCR 2 introduces a major overhaul with a single 650M-param model handling OCR, layout, and table recognition, replacing the previous multi-model architecture. It introduces new runtime requirements using vllm or llama.cpp and modifies several API endpoints and output schemas.
Key Highlights
- State of the art accuracy for its size, achieving 83.3% on olmOCR-bench
- Multilingual support covering 91 languages with an 87.2% average benchmark score
- High throughput of 5 pages per second on RTX 5090
- Unified model approach serving OCR, layout, and table recognition from a single 650M-parameter model
Breaking Changes
- SuryaInferenceManager replaces FoundationPredictor
- Output schemas changed: text_lines renamed to blocks (with html), layout dropped top_k and added count, table-rec cells dropped is_header/colspan/rowspan
- New runtime requirements: Docker + NVIDIA Container Toolkit for GPU or llama.cpp for CPU/Apple Silicon
New Features
- Unified 650M-param model for OCR, layout, and table recognition
- Integration with vllm and llama.cpp inference backends
- Updated output schemas featuring HTML blocks
- Separate lightweight torch models for text detection and OCR-error detection
Full Release Notes
# Surya 2 (v0.20.0) Surya 2 is a ground-up rework: a single **650M-param model** now handles OCR, layout, and table recognition, served by `vllm` (NVIDIA GPU) or `llama.cpp` (CPU / Apple Silicon). Text detection and OCR-error detection remain separate lightweight torch models. > ⚠️ **This is a major release with breaking API and output-schema changes.** See *Upgrading from v1* below. ## Highlights - **State of the art for its size** - 83.3% on [olmOCR-bench](https://huggingface.co/datasets/allenai/olmOCR-bench), best in class under 3B params. - **Multilingual** - 87.2% average across a 91-language internal benchmark. - **Fast** - 5 pages/s throughput on RTX 5090. ## Breaking changes — upgrading from v1 ```python # v2 from surya.inference import SuryaInferenceManager from surya.recognition import RecognitionPredictor manager = SuryaInferenceManager() # auto-spawns vllm or llama-server rec = RecognitionPredictor(manager) predictions = rec([image]) ``` - `SuryaInferenceManager` replaces `FoundationPredictor`, and is shared across `LayoutPredictor`, `RecognitionPredictor`, and `TableRecPredictor`. - **Output schemas changed:** `text_lines` → `blocks` (each with `html`); layout dropped `top_k` and added `count`; table-rec cells dropped `is_header` / `colspan` / `rowspan`. - **New runtime requirement:** layout / OCR / table-rec need an inference backend - Docker + the NVIDIA Container Toolkit (GPU), or `brew install llama.cpp` (CPU / Apple Silicon). Detection still runs on torch alone. ## Installation ```shell pip install surya-ocr ``` Then make a backend available (see *Breaking changes* above). Full usage, output schemas, and tuning notes are in the [README](https://github.com/datalab-to/surya#readme). ## Notes - Try it without installing anything on the [Datalab playground](https://www.datalab.to/playground?utm_source=gh-surya). **Full Changelog**: https://github.com/datalab-to/surya/compare/v0.17.1...v0.20.0