talira

OCR, layout analysis, reading order and table recognition in 90+ languages

source availableApache-2.0 AND Datalab OpenRAIL-M (modified)self-hostablefree

Surya is Datalab's document OCR toolkit and model: a single 689M-parameter vision-language model (Surya 2.5) that does OCR, layout analysis with reading order, table recognition and inline math for PDFs and page images in about 90 languages. Each page comes back as blocks with a label (text, section header, table, equation, picture, form and more), a polygon and bounding box, a confidence score and the content as HTML, with tables as <table> markup with merged cells and equations as KaTeX-compatible LaTeX. The surya-ocr Python package and its CLIs (surya_ocr, surya_layout, surya_table, surya_gui) are a light client that starts and talks to a vLLM server on NVIDIA GPUs, llama.cpp on CPU or Apple Silicon, or MLX. The code is Apache-2.0 but the weights use Datalab's modified OpenRAIL-M licence, free for research, personal use and companies under $5M in revenue and funding; Marker uses Surya for scanned pages, and Datalab's hosted API runs it with its larger Chandra model.

Problems it solves

  • OCR scanned PDFs in dozens of languages and keep each block's position on the page
  • work out the reading order of a multi-column newspaper or magazine scan
  • detect tables, headers, figures and equations on document pages before extracting text
  • turn a table in a scanned report into HTML with merged cells intact
  • read equations in scanned math papers as LaTeX along with the surrounding text
  • run document OCR locally on my Mac with llama.cpp instead of sending pages to a cloud API
  • an open document OCR model under 1B parameters that's accurate enough to replace Tesseract
  • OCR old handwritten letters and government forms into structured JSON
  • let my AI agent OCR a PDF from the shell and read the JSON from stdout
  • batch-OCR thousands of pages on one GPU server with vLLM

Features

  • one 689M-parameter VLM for OCR, layout and tables (Surya 2.5)
  • about 90 languages; 91-language benchmark published by Datalab
  • layout labels such as Table, Picture, SectionHeader, Equation and Form, with reading order
  • tables as HTML with colspan and rowspan for merged cells
  • inline math as KaTeX-compatible LaTeX
  • block polygons, bounding boxes and confidence scores in JSON
  • full-page or block-by-block OCR modes
  • images, PDFs and folders as input, with page ranges
  • vLLM (NVIDIA GPU, Docker or Podman), llama.cpp (CPU and Apple Silicon) and MLX backends
  • attach to any OpenAI-compatible server with SURYA_INFERENCE_URL
View 3 more
  • surya_gui browser viewer for layout, reading order, math and tables
  • bundled agent skill (--skill, --install_skill) and --stdout JSON for agents
  • GGUF and MLX conversion scripts

Limitations

  • Not for photos or natural scene text: Datalab says Surya is specialized for document OCR and layout analysis12
  • Model weights aren't free for commercial use by larger companies: over $5M in revenue or funding needs a licence from Datalab, and competing products are barred13
  • No row and column geometry for tables in Surya 2.5: it returns tables as HTML, and cell geometry needs the older Surya 2 checkpoint2

Capabilities

Has a command line toolplan not known
Has official SDKsplan not known

Alternatives

The same job

These do what Surya does.

  1. Mistral OCR Mistral AI's document OCR model and API: PDFs and images to structured Markdown, priced per page
  2. PaddleOCR Turn any PDF or image document into structured data for your AI
  3. docTR Document Text Recognition: open source OCR powered by PyTorch
  4. PP-OCRv6 PaddleOCR's sixth-generation text detection and recognition models, from 1.5M to 34.5M parameters
  5. Tesseract Tesseract Open Source OCR Engine
  6. EasyOCR Ready-to-use OCR with 80+ supported languages and all popular writing scripts

Compare Surya with the top 3