- Category
- AI Tools
- Rank
- No. 211Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- datalab-to
- GitHub
- 21.4k stars
- Latest release
- v0.22.1
- Date
About
Multilingual document AI from Datalab: OCR, layout analysis, reading order, and table recognition in 90+ languages.
What it does
Surya turns document pages into structured results rather than plain text dumps. A shared vision-language model handles page structure, recognition, and tables, while separate smaller models detect text lines and likely OCR errors. Results preserve block order, labels, HTML content, coordinates, confidence, and failure states.
Why it's ranked here
Surya combines several document extraction stages behind one reusable inference manager and exposes both command-line and Python workflows. Its structured output is unusually practical for downstream processing, especially when documents contain tables, equations, forms, or mixed visual regions. The infrastructure and model licensing deserve scrutiny before adoption.
What's good
The output carries useful context: canonical block types, original model labels, reading order, HTML, polygons, bounding boxes, confidence, skipped regions, and errors. It accepts images, PDFs, and folders, supports selected PDF pages, and can reuse a running inference server across commands. Configuration is available through environment variables.
Tradeoffs
Local inference needs more than a package install. NVIDIA deployments require Docker and the NVIDIA Container Toolkit, while CPU and Apple Silicon setups require a llama.cpp server binary. Repeated commands incur server startup and model-loading costs unless the server stays alive. Model weights have commercial limits beyond research, personal use, and qualifying startups.
How to use it well
Use Surya when a Python document pipeline needs structured page content, coordinates, reading sequence, and table geometry from varied source files. Keep one inference manager or persistent server alive across batches, then tune image resolution against throughput. It does not remove the need to operate inference infrastructure; Datalab presents its managed platform separately for that need.
Technical notes+
pyproject.toml packages Python 3.10+ code with Hatchling, installs six CLI entry points, and declares Torch, Transformers, image, PDF, HTTP, and validation dependencies. surya/settings.py selects CUDA, MPS, or CPU, configures vLLM and llama.cpp backends, supports an external OpenAI-style endpoint, and exposes environment-driven settings. surya/__init__.py enables PyTorch MPS fallback without overwriting a user value. surya/common/blank.py filters near-white or uniform regions. surya/layout/label.py maps raw layout classes into the public vocabulary. README.md documents shared-server reuse and identical full-page and block-mode OCR schemas.
Observed
- Code license
- Apache-2.0
- Model weights license
- Modified AI Pubs Open Rail-M, free for research, personal use, and startups under $5M funding or revenue; broader commercial use requires licensing
- Primary language
- Python
- Packaging
- PyPI package surya-ocr, installed with pip; requires Python 3.10 or newer and below Python 4
- Interfaces
- Python library, six command-line entry points, and an optional Streamlit application
- Inference platforms
- NVIDIA GPU through vLLM in Docker; CPU and Apple Silicon through llama.cpp
- Input surface
- Images, PDFs, folders of images or PDFs, and selected PDF page ranges
Read from README.md, pyproject.toml, surya/logging.py, surya/__init__.py, surya/settings.py, surya/common/s3.py, surya/debug/draw.py, surya/debug/text.py, surya/input/load.py, surya/common/load.py, surya/common/util.py, surya/debug/fonts.py, surya/debug/katex.js, surya/common/blank.py, surya/layout/label.py.
What it can do
Extract text from documents using OCR
Document images or scanned files in 90+ languages → Machine-readable text
Analyze document layout structure
Document files → Layout structure analysis with element identification
Determine reading order of document elements
Document with multiple text blocks and elements → Properly ordered sequence of document content
Recognize and extract table structures
Documents containing tables → Structured table data
Process multilingual documents
Documents in any of 90+ supported languages → Language-specific text extraction and analysis
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.
