Model reference · open weights
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.
Summary of the datalab-to/surya-ocr-2 model card, 2026-10-01
What it is
| Released by | datalab-to |
|---|---|
| Released | 2026-05-14 |
| Parameters | 686M |
| VRAM | 1.4 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 60 | 19 | all 256K | 11.6 GB |
| RTX 4060 Ti 16 GB | 87 | 27 | all 256K | 15.4 GB |
| RTX 3090 24 GB | 144 | 45 | all 256K | 23.4 GB |
| RTX 4090 24 GB | 144 | 45 | all 256K | 23.4 GB |
| RTX 5090 32 GB | 199 | 62 | all 256K | 31.0 GB |
| L40S 48 GB | 291 | 92 | all 256K | 44.0 GB |
| A100 80 GB | 536 | 169 | all 256K | 78.2 GB |
| H100 80 GB | 514 | 162 | all 256K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 627 | 198 | all 256K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 723 | 228 | all 256K | 107 GB |
| H200 141 GB | 943 | 298 | all 256K | 138 GB |
| B200 180 GB | 1000+ | 384 | all 256K | 176 GB |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 3.3 GB | 3.6 GB |
| 5 | 3.9 GB | 5.4 GB |
| 8 | 4.3 GB | 6.7 GB |
| 16 | 5.4 GB | 10.3 GB |
| 32 | 7.7 GB | 17.3 GB |
| 64 | 12.1 GB | 31.5 GB |
One card, with vLLM's small-card settings.
From the model card
Surya is a 650M param OCR model with these features:
It works on a range of documents (see usage and benchmarks).
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.
| Detection | OCR |
|---|---|
| Layout | Table Recognition |
|---|---|
Surya is named for the Hindu sun god, who has universal vision.
| Name | Detection | OCR | Layout | Order | Table Rec |
|---|---|---|---|---|---|
| Newspaper | Image | Image | Image | Image | |
| Textbook | Image | Image | Image | Image | |
| Tax Form | Image | Image | Image | Image | Image |
| Handwritten Notes | Image | Image | Image | Image | Image |
| Corporate Doc | Image | Image | Image | Image | Image |
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.
Install with:
pip install surya-ocr
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.
surya/settings.py. You can override any setting via env var (e.g. SURYA_INFERENCE_BACKEND=vllm).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
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 canonicalizationreading_order - 0-indexed position in layout outputhtml - block content as HTML (math wrapped in ..., tables as ..., etc.). "" if the block was skippedpolygon - 4-corner polygon in [[x0,y0],[x1,y0],[x1,y1],[x0,y1]] orderbbox - axis-aligned [x0, y0, x1, y1] derived from the polygonconfidence - 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'derror - true if the block OCR call failedimage_bbox - [0, 0, width, height] for the page imagePerformance 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.