Surya

Tools & Infrastructure 💻 Python ⚖️ Apache-2.0 🟢 Actively maintained
21.4k stars

Surya is a 650M parameter OCR model that performs text recognition, layout analysis, and table recognition on documents. It solves the problem of extracting structured information from a wide range of document types, including handwritten notes and forms. It is intended for developers and researchers who need accurate, multilingual document intelligence.

✨ Key features

  • High accuracy: 83.3% on olmOCR-bench, top under 3B params
  • Fast: 5 pages/s on RTX 5090
  • Multilingual: 87.2% on 91 languages
  • Layout analysis with reading order
  • Table recognition (rows + columns)
  • Line-level text detection and OCR error detection

🎯 Use cases

  • Extracting text from scanned documents
  • Document layout analysis for digitization
  • Table extraction from forms and reports
  • OCR for multilingual documents
  • Building document search or data pipelines

📦 Installation

🧰 Requirements: Requires Python, and either NVIDIA GPU with Docker and NVIDIA Container Toolkit, or CPU/Apple Silicon with llama.cpp. No API keys needed for local use.

pip install surya-ocr

For inference backend prerequisites:

  • NVIDIA GPU: Docker plus the NVIDIA Container Toolkit.
  • CPU / Apple Silicon: the llama-server binary from llama.cpp:
    brew install llama.cpp     # macOS
    # or grab a release from https://github.com/ggml-org/llama.cpp/releases
    

🚀 Usage

from PIL import Image
from surya.inference import SuryaInferenceManager
from surya.recognition import RecognitionPredictor

manager = SuryaInferenceManager()
recognition_predictor = RecognitionPredictor(manager)

predictions = recognition_predictor([Image.open(IMAGE_PATH)])

⚠️ Good to know

The model weights use a modified AI Pubs Open Rail-M license, free for research, personal use, and startups under $5M funding/revenue; broader commercial use requires a paid license.

❓ FAQ

What are the system requirements for running Surya?

You need Python and either an NVIDIA GPU with Docker and the NVIDIA Container Toolkit, or a CPU/Apple Silicon with llama.cpp installed.

How do I run OCR on a PDF?

Use the command surya_ocr DATA_PATH where DATA_PATH can be a PDF, image, or folder of images/PDFs. It will output a JSON file with detected text and bounding boxes.

Can I use Surya for commercial purposes?

The code is Apache 2.0, but the model weights have a modified AI Pubs Open Rail-M license. Free for research, personal use, and startups under $5M funding/revenue; for broader commercial use, you need a paid license from Datalab.

How do I keep the inference server running between commands?

Pass --keep_server to any command to leave the server running after the command exits, so subsequent commands attach to it instead of re-spawning.

📊 Repository

Stars★ 21,355
Forks🍴 1,536
Open issues🐛 195
Last commit🕒 Aug 21, 2026
Created📅 Jan 2024
Language💻 Python
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.