OCRRouter

GLM-OCR vs Donut

Pick GLM-OCR for full-page PDF to Markdown, academic papers with formulas, and schema-based field extraction, since it works out of the box and costs $0.03 per million tokens through the Z.ai API. Pick Donut only for narrow, fixed-layout documents such as receipts and forms, where you can fine-tune it on your own data. Donut's base checkpoint is pretrain-only, so it cannot be used without training.

GLM-OCRzai/glm-ocrDonutnaver/donut
TypeOpen sourceOpen source
Price6 credits / page1 credit / page
Per 1,000 pages$6.00$1.00
Typical speed1.3 s / page1.0 s / page
Best forLow-cost general documentsReceipt and form fields after fine-tuning
InputsPDF, imagesimages
Languages100+ languagesEnglish, Chinese, Japanese, Korean
Max pages per request500100
Tables✓ YesNo
HandwritingNoNo
Math✓ YesNo
Bounding boxes✓ YesNo
Confidence✓ YesNo
FormsNo✓ Yes
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 converts full pages to Markdown or JSON without any training, and scores 94.62 on OmniDocBench v1.5 per its model card.
  • The Z.ai API costs $0.03 per million tokens for input and output, and you can also self-host with vLLM, SGLang, Ollama or transformers.
  • It can extract fields into a user-defined JSON schema, so you can pull form fields without fine-tuning a model.

Choose Donut if

  • It maps document images straight to structured JSON with no external OCR step, which suits receipts, forms and classification after fine-tuning.
  • It is MIT licensed and available in Hugging Face Transformers, with no API limits because you only self-host it.
  • A Hacker News practitioner reports that about 200 documents of fine-tuning can reach human-level accuracy on narrow data.

Key differences

GLM-OCRDonut
Ready to useWorks as is, through the API or self-hostedBase checkpoint is pretrain-only and must be fine-tuned first
How you run itZ.ai API, or self-host with vLLM, SGLang, Ollama or transformersSelf-host only; Transformers v5 dropped image-to-text pipeline support, so load it directly or use v4
LicenceMIT for the weights; the SDK repo and bundled PP-DocLayoutV3 are Apache-2.0MIT
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
BenchmarksOmniDocBench v1.5 94.62 (authors); olmOCR-Bench 75.2 (authors); ParseBench mean 29.6 (independent)Not published
Known failureRepeats output unless a stop sequence is set, drops table footer rows, loses comma decimal separators in cropped tables, does not run on aarch64 LinuxMisses tiny text in large images because of input resolution limits; one HN user found results on personal documents did not match the promised scores

Sources

What each one is

GLM-OCR

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

GLM-OCR details

Donut

OCR-free document understanding model. Fine-tuned for receipts, forms and document Q&A.

Donut 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": ["naver/donut"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

GLM-OCR alternativesDonut alternativesBest OCR models in 2026