Model reference · open weights

surya-ocr-2

LLMs datalab-to Vision + text 1 build Open weights 1.3M dl/mo

surya-ocr-2 is an open-weight language model from datalab-to. surya-ocr-2 (BF16) weighs 1.4 GB; the smallest configuration that runs it is RTX 3060 12 GB.

  • Surya OCR 2 is a 686M parameter image-to-text model developed by datalab-to for optical character recognition, layout analysis, and table recognition.
  • The model supports 91 languages and operates under the OpenRail license, with code available under Apache 2.0.
  • It is designed to process documents by extracting text, identifying layout elements, and recognizing table structures.

Summary of the datalab-to/surya-ocr-2 model card, 2026-10-01

What it is

Released bydatalab-to
Released2026-05-14
Parameters686M
VRAM1.4 GB for the weights

What it runs on

Memory and cards for surya-ocr-2 (BF16)

1.4 GBweights, file size
12 MBcache per 1K tokens
39 MBfixed state per request
1.8 GBruntime overhead, at least
262,144 tokenscontext max
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB6019all 256K11.6 GB
RTX 4060 Ti 16 GB8727all 256K15.4 GB
RTX 3090 24 GB14445all 256K23.4 GB
RTX 4090 24 GB14445all 256K23.4 GB
RTX 5090 32 GB19962all 256K31.0 GB
L40S 48 GB29192all 256K44.0 GB
A100 80 GB536169all 256K78.2 GB
H100 80 GB514162all 256K78.1 GB
RTX PRO 6000 Blackwell 96 GB627198all 256K93.8 GB
DGX Spark (GB10) 128 GB unified723228all 256K107 GB
H200 141 GB943298all 256K138 GB
B200 180 GB1000+384all 256K176 GB
Memory needed at each load
Requests at once8K tokens each32K tokens each
13.3 GB3.6 GB
53.9 GB5.4 GB
84.3 GB6.7 GB
165.4 GB10.3 GB
327.7 GB17.3 GB
6412.1 GB31.5 GB

One card, with vLLM's small-card settings.

From the model card

What datalab-to says about surya-ocr-2

Read the model card

Surya is a 650M param OCR model with these features:

  • Accuracy - scores 83.3% on olmOCR-bench (top under 3B params)
  • Speed - throughput of 5 pages/s on an RTX 5090
  • Multilingual - scores 87.2% on an internal benchmark set of 91 languages (more here)
  • Layout analysis (table, image, header, etc.) with reading order
  • Table recognition (rows + columns)

It works on a range of documents (see usage and benchmarks).

Try Datalab's Managed Platform

Our managed platform runs both Surya, and variants of our highest accuracy model, Chandra.

Get started with $5 in free credits — sign up (takes under 30 seconds) or try our free public playground.

Model Information

DetectionOCR
LayoutTable Recognition

Surya is named for the Hindu sun god, who has universal vision.

Examples

NameDetectionOCRLayoutOrderTable Rec
NewspaperImageImageImageImage
TextbookImageImageImageImage
Tax FormImageImageImageImageImage
Handwritten NotesImageImageImageImageImage
Corporate DocImageImageImageImageImage

Commercial usage

The Surya code is licensed under Apache 2.0. The model weights use a modified AI Pubs Open Rail-M license (free for research, personal use, and startups under $5M funding/revenue). For broader commercial licensing of the model weights, visit our pricing page here.

Installation

Install with:

pip install surya-ocr

Usage

Surya 2 runs layout, OCR, and table recognition through a single VLM served by vllm (GPU) or llama.cpp (CPU / Apple Silicon). The inference manager will spawn one for you on first use; you can also point it at an existing server via SURYA_INFERENCE_URL=http://host:port/v1.

  • Inspect the settings in surya/settings.py. You can override any setting via env var (e.g. SURYA_INFERENCE_BACKEND=vllm).
  • Text detection and OCR errors are separate models.

Interactive App

I've included a streamlit app that lets you interactively try Surya on images or PDF files. Run it with:

pip install streamlit pdftext
surya_gui

OCR (text recognition)

This command will write out a json file with the detected text and bboxes:

surya_ocr DATA_PATH
  • DATA_PATH can be an image, pdf, or folder of images/pdfs
  • --images will save images of the pages and detected blocks (optional)
  • --output_dir specifies the directory to save results to instead of the default
  • --page_range specifies the page range to process in the PDF, specified as a single number, a comma separated list, a range, or comma separated ranges - example: 0,5-10,20.

The results.json file contains a dict keyed by input filename (no extension). Each value is a list of page dicts. Each page dict contains:

  • blocks - per-block OCR results in reading order
    • label - canonicalized layout label (e.g. Text, SectionHeader, Table, Equation, Picture, Form, PageHeader, ...). See surya/layout/label.py:LAYOUT_PRED_RELABEL for the full canonical-name set.
    • raw_label - original label emitted by the model, before canonicalization
    • reading_order - 0-indexed position in layout output
    • html - block content as HTML (math wrapped in ..., tables as ..., etc.). "" if the block was skipped
    • polygon - 4-corner polygon in [[x0,y0],[x1,y0],[x1,y1],[x0,y1]] order
    • bbox - axis-aligned [x0, y0, x1, y1] derived from the polygon
    • confidence - mean per-token probability across the block's decode (0-1)
    • skipped - true if the block was a visual label (e.g. Picture) and not OCR'd
    • error - true if the block OCR call failed
  • image_bbox - [0, 0, width, height] for the page image

Performance tips

Throughput is governed by the inference backend, not a RECOGNITION_BATCH_SIZE env var. With vllm, rais

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms