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-ocr | Suryadatalab/surya | |
|---|---|---|
| Type | Open source | Open source |
| Price | 6 credits / page | 2 credits / page |
| Per 1,000 pages | $6.00 | $2.00 |
| Typical speed | 1.3 s / page | 1.5 s / page |
| Best for | Low-cost general documents | Layout and line-level OCR |
| Inputs | PDF, images | PDF, images |
| Languages | 100+ languages | 90+ languages |
| Max pages per request | 500 | 500 |
| Tables | ✓ Yes | ✓ Yes |
| Handwriting | No | No |
| Math | ✓ Yes | No |
| Bounding boxes | ✓ Yes | ✓ Yes |
| Confidence | ✓ Yes | No |
| Forms | No | No |
| Multilingual | ✓ Yes | ✓ Yes |
| On OCRRouter | Available | Available |
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-OCR | Surya | |
|---|---|---|
| How you run it | Z.ai API, or self-host with vLLM, SGLang, Ollama or transformers | Self-host only: a vLLM or llama.cpp inference server plus a local client |
| Licence | MIT for the model weights; Apache-2.0 for the SDK repo and PP-DocLayoutV3 | Apache-2.0 code; weights under modified AI Pubs Open Rail-M, free for research, personal use and companies under $5M funding or revenue |
| Price | API: $0.03 per million tokens for input and output. Self-hosted: free, you pay for compute | Free self-hosted, you pay for compute. Commercial licence needed above $5M revenue or funding |
| Output formats | Markdown, JSON, plain text | JSON, HTML, LaTeX, bounding boxes, plain text |
| Size and limits | 0.9B parameters. API caps input at 100 pages, 50 MB per PDF and 10 MB per image. Cannot run on aarch64 Linux | 689M 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 failure | Repeats output unless a stop sequence is set, drops table footer and summary rows, loses comma decimal separators in cropped tables | Surya 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
- Hugging Face model card
- Z.ai GLM-OCR docs and pricing
- Issue #240 missing table rows
- Surya GitHub README
- Datalab pricing and license FAQ
What each one is
Surya
Open-source OCR toolkit with line detection, layout analysis, reading order and tables.
Surya detailsTry 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 vs dots.ocrGLM-OCR vs ChandraUnlimited OCR vs SuryaPaddleOCR-VL vs SuryaSurya vs UnstructuredSurya vs Florence-2Claude vs GLM-OCRSurya vs Adobe Acrobat OCR
GLM-OCR alternativesSurya alternativesBest OCR models in 2026