OCRRouter

GLM-OCR vs Florence-2

Pick GLM-OCR for full-page PDF to Markdown, formulas in academic papers, and field extraction into a JSON schema. Pick Florence-2 only when you need small-model text with bounding boxes on scene text or short English labels, or when the same model must also caption and detect. The main reason is output: GLM-OCR returns Markdown and JSON, while Florence-2 returns only plain text and boxes.

GLM-OCRzai/glm-ocrFlorence-2microsoft/florence-2
TypeOpen sourceOpen source
Price6 credits / page1 credit / page
Per 1,000 pages$6.00$1.00
Typical speed1.3 s / page0.8 s / page
Best forLow-cost general documentsLightweight OCR with boxes
InputsPDF, imagesimages
Languages100+ languagesEnglish
Max pages per request500500
Tables✓ YesNo
HandwritingNoNo
Math✓ YesNo
Bounding boxes✓ Yes✓ Yes
Confidence✓ YesNo
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 returns Markdown, JSON and plain text, so full pages convert to structured output.
  • It scores 94.62 on OmniDocBench v1.5 per its own model card, and it can extract fields into a user-defined JSON schema.
  • You can call the Z.ai API at $0.03 per million tokens for input and output, or self-host it with vLLM, SGLang, Ollama or transformers.

Choose Florence-2 if

  • It is very small at 0.23B (base) and 0.77B (large), which suits lightweight edge OCR in English.
  • OCR_WITH_REGION returns quadrilateral boxes per text line.
  • The same model also does captioning, detection and grounding, so one model covers a mixed pipeline.

Key differences

GLM-OCRFlorence-2
Size0.9B parameters0.23B (base), 0.77B (large)
How you run itZ.ai API, or self-host with vLLM, SGLang, Ollama or transformersSelf-host via Transformers only
LicenceMIT for the model weights; SDK repo and bundled PP-DocLayoutV3 are Apache-2.0MIT
PriceAPI: $0.03 per million tokens for input and output. Self-hosted: free, you pay for computeFree, self-hosted, you pay for compute
Output formatsMarkdown, JSON, plain textPlain text and bounding boxes. No Markdown, tables or LaTeX
BenchmarkOmniDocBench v1.5 overall 94.62 (authors); ParseBench mean 29.6 (independent)TextCaps CIDEr zero-shot 72.8 and COCO detection mAP zero-shot 37.5 (large, authors). No document OCR benchmark published
Known failuresRepeats output unless a stop sequence is set; drops table footer and summary rows; loses comma decimal separators in cropped tables; no aarch64 Linux supportSpelling errors and missing spaces on cursive handwriting and French text; Chinese output mostly wrong because the vocabulary lacks CJK characters

Sources

What each one is

GLM-OCR

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

GLM-OCR details

Florence-2

Small Microsoft vision model (0.23B and 0.77B) with OCR and OCR-with-regions tasks that return text with boxes.

Florence-2 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": ["microsoft/florence-2"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

GLM-OCR alternativesFlorence-2 alternativesBest OCR models in 2026