GLM-OCR vs docTR
Pick GLM-OCR when you need Markdown, tables, formulas or schema-based field extraction from PDFs at low cost. Pick docTR when you need word-level text with coordinates in a Python pipeline you control, and you do not need Markdown or table output. The main split is output: GLM-OCR converts whole documents, docTR returns words and lines only.
GLM-OCRzai/glm-ocr | docTRmindee/doctr | |
|---|---|---|
| Type | Open source | Open source |
| Price | 6 credits / page | 1 credit / page |
| Per 1,000 pages | $6.00 | $1.00 |
| Typical speed | 1.3 s / page | 0.9 s / page |
| Best for | Low-cost general documents | Word-level OCR with positions |
| Inputs | PDF, images | PDF, images |
| Languages | 100+ languages | Mainly Latin scripts |
| Max pages per request | 500 | 500 |
| Tables | ✓ Yes | No |
| Handwriting | No | No |
| Math | ✓ Yes | No |
| Bounding boxes | ✓ Yes | ✓ Yes |
| Confidence | ✓ Yes | ✓ Yes |
| Forms | No | No |
| Multilingual | ✓ Yes | No |
| 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 outputs Markdown, JSON and plain text, and can extract fields into a user-defined JSON schema.
- It suits high-volume PDF to Markdown and academic papers with formulas, at $0.03 per million tokens through the Z.ai API.
- It scores 94.62 on OmniDocBench v1.5 per its model card, and runs at 1.86 PDF pages per second on a single replica in the authors' test.
Choose docTR if
- It returns a nested page, block, line and word structure with coordinates as JSON, which suits word-level OCR.
- You can choose detection and recognition architectures, with straight or rotated boxes, and train your own models in Python.
- It is Apache-2.0, runs on CPU or NVIDIA GPU, and ships Docker images, so it fits invoices and receipts feeding custom extraction.
Key differences
| GLM-OCR | docTR | |
|---|---|---|
| What it is | 0.9B multimodal OCR model from Z.ai with layout analysis and a GLM decoder | Two-stage detection and recognition library from Mindee, runs on PyTorch |
| How you run it | Z.ai API, or self-host with vLLM, SGLang, Ollama or transformers | Local Python library with Docker images; GPU images need CUDA 12.2 or newer on the host |
| Licence | MIT for model weights; SDK repo and bundled PP-DocLayoutV3 are Apache-2.0 | Apache-2.0 |
| Price | API: $0.03 per million tokens for input and output; self-hosted is free plus compute | Free, self-hosted; you pay for compute |
| Output formats | Markdown, JSON, plain text | JSON, plain text, bounding boxes |
| Tables and formulas | Produces table markup, but drops footer and summary rows (issue #240) and loses comma decimal separators in cropped table regions (issue #241) | No table, formula or Markdown output; words and lines only |
| Benchmarks | OmniDocBench v1.5 94.62 and olmOCR-Bench 75.2 (authors); ParseBench mean 29.6 (independent) | Not published |
| Known failure | Repeats output unless a stop sequence is set (issue #220); no aarch64 Linux support (issue #227); API caps at 100 pages, 50 MB per PDF, 10 MB per image | Split-crop merging misjoins repeated characters (issue #2229); cropped images give poorer results (issue #2007) |
Sources
- Hugging Face model card
- Z.ai GLM-OCR docs and pricing
- Issue #240 missing table rows
- docTR GitHub README
- Issue #2229
What each one is
docTR
Open-source OCR library from Mindee with separate text detection and recognition models.
docTR 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": ["mindee/doctr"],"file_url": "https://example.com/document.pdf"}Questions
More comparisons
GLM-OCR vs KrakenGLM-OCR vs RapidOCRUnlimited OCR vs docTRPaddleOCR-VL vs docTRMarker vs docTRGLM-OCR vs Florence-2Qianfan OCR vs docTRGLM-OCR vs Tesseract.js
GLM-OCR alternativesdocTR alternativesBest OCR models in 2026