OCRRouter

GLM-OCR vs Surya

Pick GLM-OCR for cheap, high-volume PDF to Markdown and for pulling fields into a JSON schema, and use the Z.ai API if you do not want to run GPUs. Pick Surya when you need layout labels, reading order and bounding boxes on a local machine, including CPU or Apple Silicon. Neither is safe for complex tables: GLM-OCR drops footer rows and decimal commas, and Surya 2.5 gives no row or column geometry.

GLM-OCRzai/glm-ocrSuryadatalab/surya
TypeOpen sourceOpen source
Price6 credits / page2 credits / page
Per 1,000 pages$6.00$2.00
Typical speed1.3 s / page1.5 s / page
Best forLow-cost general documentsLayout and line-level OCR
InputsPDF, imagesPDF, images
Languages100+ languages90+ languages
Max pages per request500500
Tables✓ Yes✓ Yes
HandwritingNoNo
Math✓ YesNo
Bounding boxes✓ Yes✓ Yes
Confidence✓ YesNo
FormsNoNo
Multilingual✓ Yes✓ Yes
On OCRRouterAvailableAvailable

Prices are what you pay on OCRRouter. Speed is the provider's typical figure, not a benchmark we ran.

Which to choose

Choose GLM-OCR if

  • It has a hosted API at $0.03 per million tokens for input and output, so you can skip running your own server.
  • It can extract fields into a user-defined JSON schema, which suits forms.
  • It scores 94.62 on OmniDocBench v1.5 per its model card, and it suits academic papers with formulas.

Choose Surya if

  • It returns layout labels, reading order, OCR, HTML tables and KaTeX math with per-block bounding boxes from one model.
  • It runs on CPU and Apple Silicon through llama.cpp, with peak memory of about 4-6 GB on an M4 Max.
  • It covers 90+ languages and scores 83.7% on olmOCR-bench, against 75.2 for GLM-OCR on olmOCR-bench (excluding headers and footers, via the Z.ai API).

Key differences

GLM-OCRSurya
How you run itZ.ai API, or self-host with vLLM, SGLang, Ollama or transformersSelf-host only: a vLLM or llama.cpp inference server plus a local client
LicenceMIT for the model weights; Apache-2.0 for the SDK repo and PP-DocLayoutV3Apache-2.0 code; weights under modified AI Pubs Open Rail-M, free for research, personal use and companies under $5M funding or revenue
PriceAPI: $0.03 per million tokens for input and output. Self-hosted: free, you pay for computeFree self-hosted, you pay for compute. Commercial licence needed above $5M revenue or funding
Output formatsMarkdown, JSON, plain textJSON, HTML, LaTeX, bounding boxes, plain text
Size and limits0.9B parameters. API caps input at 100 pages, 50 MB per PDF and 10 MB per image. Cannot run on aarch64 Linux689M parameters. Not for photos or natural scenes. Apple M4 Max reaches only 0.198 pages/s at 96 DPI with llama.cpp Q8_0
Benchmarks (author-reported)OmniDocBench v1.5 overall 94.62; olmOCR-Bench 75.2; ParseBench mean 29.6 (independent)olmOCR-bench 83.7% (Surya 2.5); OmniParseBench headline 85.9; 91-language pass rate 74.9%
Known failureRepeats output unless a stop sequence is set, drops table footer and summary rows, loses comma decimal separators in cropped tablesSurya 2.5 tables lack row and column geometry. Multilingual tables score 58.1. Handwriting and hard documents are better sent to the hosted Datalab API

Sources

What each one is

GLM-OCR

Small open-source OCR model from Z.ai with layout regions. MIT licensed.

GLM-OCR details

Surya

Open-source OCR toolkit with line detection, layout analysis, reading order and tables.

Surya details

Try both on your own file

Run the file once with each model and compare the output.

PDF, PNG, JPG, WebP, HEIC. Up to 20 MB each, 10 files.No file?

Use one, fall back to the other

{"model": "zai/glm-ocr","fallbacks": ["datalab/surya"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

GLM-OCR alternativesSurya alternativesBest OCR models in 2026