Back to Models

GLM OCR

zhipuzhipu/glm-ocr

Zhipu AI GLM OCR (0.9B) — document parser for PDF/image to structured Markdown text extraction.

GLM-OCR is a 0.9B-parameter multimodal OCR model released by Z.AI (formerly Zhipu AI) on February 3, 2026, under the MIT license. It pairs a 0.4B CogViT visual encoder — pre-trained on large-scale image–text data — with a lightweight cross-modal connector and a 0.5B GLM language decoder. The model is purpose-built for document understanding rather than being a general-purpose vision-language model adapted to OCR: it delivers structured Markdown, JSON, and LaTeX outputs from scanned PDFs, images, tables, mathematical formulas, code blocks, seals, and handwritten text.

Architecturally, GLM-OCR uses Multi-Token Prediction (MTP) — trained to predict 10 tokens per step and achieving 5.2 tokens per step at inference on average — delivering roughly 50% higher throughput than standard autoregressive decoding. At the system level it follows a two-stage pipeline: PP-DocLayout-V3 first analyses page layout and identifies structured regions, then GLM-OCR processes those regions in parallel for recognition and structured output. This makes it meaningfully different from flat left-to-right page readers and more robust on complex layouts. On OmniDocBench V1.5 it scores 94.62, ranking #1 overall among models at time of release, while fitting on hardware with as little as 4 GB of VRAM.

Best for
  • • Enterprise document digitization — converting scanned PDFs, invoices, and contracts into structured Markdown or JSON while preserving tables, formulas, and multi-column layout.
  • • Key Information Extraction (KIE) — feeding a full document image with a task prompt to extract specific fields (dates, amounts, entity names) directly as JSON without a separate pipeline.
  • • High-concurrency document parsing services where cost and latency matter — 1.86 pages/sec PDF throughput and sub-4 GB VRAM footprint make it viable for edge deployment and budget-sensitive API routes.
  • • RAG and knowledge base pipelines that need clean, structured text from mixed-layout documents (reports, academic papers, government forms) before chunking and embedding.
Reach for something else if
  • • General chat or instruction-following — GLM-OCR is an OCR extraction model, not a conversational assistant. For dialogue use zhipu/glm-4 or similar.
  • • Natural-language image captioning or VQA — the model's output paths are designed for document structure, not free-form scene description. Use a general-purpose VLM instead.
Context Length
66K
Max Output
16K
Input Priceper 1M tokens
$0.0324/ 1M tokens
Output Priceper 1M tokens
$0.0324/ 1M tokens

Modalities

textimagepdf→textocr

Capabilities

OCRVision

Media Generation Capabilities

ocr
input_formats
  • png
  • jpg
  • jpeg
  • pdf

Pricing Breakdown

TypeRate
Input$0.0324 / 1M tokens
Output$0.0324 / 1M tokens

Supported Parameters

temperaturemax_tokenstop_presponse_formatstop

Specifications

Release date2026-02-03huggingface.co ↗verified
LicenseMIThuggingface.co ↗verified
Total parameters0.9B (0.4B CogViT encoder + 0.5B GLM decoder)arxiv.org ↗verified
Minimum GPU VRAM4 GBpasqualepillitteri.it ↗to verify
PDF throughput (single concurrency)1.86 pages/sechuggingface.co ↗verified
Image throughput (single concurrency)0.67 images/sechuggingface.co ↗verified
MTP decoding speed5.2 tokens/step average (trained for 10)arxiv.org ↗verified
Training cutoffNot publicly disclosedunknown

Benchmarks

BenchmarkDistributionScoreSource
OmniDocBench V1.5
94.62scorehuggingface.co ↗

API Usage Examples

Use the global api.therouter.ai endpoint shown below for new integrations; the legacy China accelerated endpoint is retired.

cURL
curl https://api.therouter.ai/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer $THE_ROUTER_API_KEY"   -d '{
    "model": "zhipu/glm-ocr",
    "messages": [
      {"role": "user", "content": "Summarize the key points from this input."}
    ]
  }'

Document parsing (PDF / image → Markdown)

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zhipu/glm-ocr",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "image_url",
            "image_url": { "url": "https://therouter.ai/assets/vision-sample.png" }
          },
          {
            "type": "text",
            "text": "Convert this document to structured Markdown. Preserve tables, headings, and list structure exactly."
          }
        ]
      }
    ]
  }'

More from zhipu

Similar models

Cross-provider sibling models

News & changes

2026-03-15

GLM-OCR technical paper published on arXiv

Z.AI published the full technical report (arXiv 2603.10910) describing GLM-OCR's architecture: CogViT encoder, MTP decoding, PP-DocLayout-V3 two-stage pipeline, and the KIE task path. The report includes ablation results showing ~50% throughput gain from MTP versus standard autoregressive decoding and the OmniDocBench V1.5 #1 ranking.

re-authored by TheRouterarxiv.org ↗

Frequently asked

Does GLM-OCR handle handwritten text and stamps?

Yes. The model is explicitly optimized for real-world business document scenarios including handwritten text, seals, code-heavy documents, and complex table layouts — not just clean printed pages. The OmniDocBench V1.5 #1 ranking covers these mixed-content benchmarks.

re-authored by TheRouterhuggingface.co ↗
Should I use the API directly or the GLM-OCR SDK for document parsing?

Z.AI recommends the official SDK (github.com/zai-org/GLM-OCR) for document parsing tasks because it integrates PP-DocLayout-V3 for layout pre-processing, which improves accuracy on complex multi-column or multi-region documents. Calling the raw API endpoint directly is simpler but skips the layout analysis stage — it works well for single-page images or when you are already handling layout detection yourself. For KIE tasks, the SDK is not currently needed; call the model directly with a JSON extraction prompt.

re-authored by TheRouterhuggingface.co ↗
Can GLM-OCR run locally, and what are the hardware requirements?

Yes. GLM-OCR ships as an open-weight MIT-licensed model (zai-org/GLM-OCR on HuggingFace) and supports local deployment via vLLM, SGLang, and Ollama. The minimum reported VRAM requirement is 4 GB, making it accessible on mid-range consumer GPUs. Via TheRouter you can call it without any local setup and pay per token.

re-authored by TheRouterhuggingface.co ↗
Fact ledger — every claim on this page traces here
sourceURLretrieved
Release datehuggingface.co ↗2026-06-09verified
Licensehuggingface.co ↗2026-06-09verified
Total parametersarxiv.org ↗2026-06-09verified
Minimum GPU VRAMpasqualepillitteri.it ↗2026-06-09to verify
PDF throughput (single concurrency)huggingface.co ↗2026-06-09verified
Image throughput (single concurrency)huggingface.co ↗2026-06-09verified
MTP decoding speedarxiv.org ↗2026-06-09verified
Training cutoff——unknown
OmniDocBench V1.5huggingface.co ↗2026-06-09verified
GLM-OCR technical paper published on arXivarxiv.org ↗2026-06-09verified
Does GLM-OCR handle handwritten text and stamps?huggingface.co ↗2026-06-09to verify
Should I use the API directly or the GLM-OCR SDK for document parsing?huggingface.co ↗2026-06-09to verify
Can GLM-OCR run locally, and what are the hardware requirements?huggingface.co ↗2026-06-09to verify
Help & contact