--- id: surya-ocr version: "0.22.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # surya-ocr — OCR, layout, reading order, and table recognition in 90+ languages. License: permissive · Maintenance: active · Downloads: 1.0M/mo ## What it is and what it does Surya is a 650M-parameter vision-language model for document intelligence that runs layout analysis, OCR, table recognition, and reading-order detection through a unified inference interface. It supports over 90 languages and works on diverse document types (newspapers, forms, handwritten notes, corporate documents). The package wraps the model and manages an inference server (vllm on NVIDIA GPUs or llama.cpp on CPU/Apple Silicon), spawning it automatically on first use or attaching to an existing server via environment variable. The package provides command-line tools (surya_ocr, surya_layout, surya_table) and a Python API (RecognitionPredictor, LayoutPredictor, TableRecPredictor) that all share a single SuryaInferenceManager instance. Output includes per-block text with bounding boxes, canonicalized layout labels, table structure (rows and columns), and reading order. It depends on torch, torchvision, transformers, huggingface-hub, and opencv-python-headless for model loading and image processing. Use it for: - Extract structured text and layout from scanned documents or PDFs for downstream NLP or database ingestion. - Automatically detect and extract tables from documents, preserving row/column structure. - Determine reading order and logical flow in complex multi-column or multi-element layouts. - Process multilingual documents (90+ languages) with a single model, avoiding language-specific OCR pipelines. - Build document classification or content-routing systems that depend on layout and content type detection. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Surya is an OCR and document intelligence model that extracts text, detects layout elements, recognizes tables, and determines reading order from images and PDFs in over 90 languages. Yes, with conditions. Surya is actively maintained, popular, and offers strong multilingual OCR and layout analysis in a single model. Install it if you need document intelligence beyond basic text extraction and can provision the external inference backend (Docker+GPU or llama.cpp). If you lack GPU access or cannot run a separate inference server, the CPU path via llama.cpp may be slow. Commercial use of model weights requires a separate license agreement for revenue above $5M. ## Install pip install surya-ocr uv add surya-ocr poetry add surya-ocr ## Installing surya-ocr Before you install: Low install friction with a pure Python wheel. Active maintenance (last commit 2026-07-23) and strong popularity (top 5000 PyPI, ~1M monthly downloads). However, the package requires either Docker + NVIDIA Container Toolkit (for GPU inference via vllm) or llama.cpp binary (for CPU/Apple Silicon), which are external system dependencies not managed by pip. License in practice: Apache-2.0 licensed code permits commercial use. Model weights use a modified AI Pubs Open Rail-M license: free for research, personal use, and startups under $5M funding/revenue, but broader commercial licensing requires a separate agreement from the vendor. Quickstart: pip install surya-ocr from surya.inference import SuryaInferenceManager from surya.recognition import RecognitionPredictor manager = SuryaInferenceManager() rec = RecognitionPredictor(manager) predictions = rec([image]) Requires vllm (NVIDIA GPU with Docker + NVIDIA Container Toolkit) or llama.cpp binary (CPU/Apple Silicon) to be installed and available before first inference run. Verify before relying: - Actual throughput on typical hardware (description claims 5 pages/s on RTX 5090, a high-end GPU). - Whether the 83.3% accuracy on olmOCR-bench and 87.2% multilingual benchmark translate to production use cases. - Memory and disk footprint of the 650M parameter model and inference server. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ocr text extraction, document layout analysis, table recognition pdf, multilingual text detection, reading order detection, pdf text extraction, document intelligence, document-intelligence, multilingual-ocr, table-extraction [View on SkillFed](https://skillfed.io/packages/surya-ocr) · [View on PyPI](https://pypi.org/project/surya-ocr/)