OCRRouter

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-ocrdocTRmindee/doctr
TypeOpen sourceOpen source
Price6 credits / page1 credit / page
Per 1,000 pages$6.00$1.00
Typical speed1.3 s / page0.9 s / page
Best forLow-cost general documentsWord-level OCR with positions
InputsPDF, imagesPDF, images
Languages100+ languagesMainly Latin scripts
Max pages per request500500
Tables✓ YesNo
HandwritingNoNo
Math✓ YesNo
Bounding boxes✓ Yes✓ Yes
Confidence✓ Yes✓ Yes
FormsNoNo
Multilingual✓ YesNo
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 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-OCRdocTR
What it is0.9B multimodal OCR model from Z.ai with layout analysis and a GLM decoderTwo-stage detection and recognition library from Mindee, runs on PyTorch
How you run itZ.ai API, or self-host with vLLM, SGLang, Ollama or transformersLocal Python library with Docker images; GPU images need CUDA 12.2 or newer on the host
LicenceMIT for model weights; SDK repo and bundled PP-DocLayoutV3 are Apache-2.0Apache-2.0
PriceAPI: $0.03 per million tokens for input and output; self-hosted is free plus computeFree, self-hosted; you pay for compute
Output formatsMarkdown, JSON, plain textJSON, plain text, bounding boxes
Tables and formulasProduces 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
BenchmarksOmniDocBench v1.5 94.62 and olmOCR-Bench 75.2 (authors); ParseBench mean 29.6 (independent)Not published
Known failureRepeats 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 imageSplit-crop merging misjoins repeated characters (issue #2229); cropped images give poorer results (issue #2007)

Sources

What each one is

GLM-OCR

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

GLM-OCR details

docTR

Open-source OCR library from Mindee with separate text detection and recognition models.

docTR 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": ["mindee/doctr"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

GLM-OCR alternativesdocTR alternativesBest OCR models in 2026