zai-org /GLM-OCR

GLM-OCR: Accurate × Fast × Comprehensive

★ 7,571⑂ 676👁 28▤ 5
PythonCreated 2026-02-02
+0
Daily
+0
Weekly
+59
Monthly
7,571
stars
676
forks
28
watchers
–
prs
–
issues
5
releases

README

GLM-OCR

中文阅读





    👋 Join our WeChat and Discord community
    
    📖 Check out the GLM-OCR technical report
    
    📍 Use GLM-OCR's API


 Model Introduction

GLM-OCR is a multimodal OCR model for complex document understanding, built on the GLM-V encoder–decoder architecture. It introduces Multi-Token Prediction (MTP) loss and stable full-task reinforcement learning to improve training efficiency, recognition accuracy, and generalization. The model integrates the CogViT visual encoder pre-trained on large-scale image–text data, a lightweight cross-modal connector with efficient token downsampling, and a GLM-0.5B language decoder. Combined with a two-stage pipeline of layout analysis and parallel recognition based on PP-DocLayout-V3, GLM-OCR delivers robust and high-quality OCR performance across diverse document layouts.

Key Features

- State-of-the-Art Performance: Achieves a score of 94.62 on OmniDocBench V1.5, ranking 1 overall, and delivers state-of-the-art results across major document understanding benchmarks, including formula recognition, table recognition, and information extraction.

- Optimized for Real-World Scenarios: Designed and optimized for practical business use cases, maintaining robust performance on complex tables, code-heavy documents, seals, and other challenging real-world layouts.

- Efficient Inference: With only 0.9B parameters, GLM-OCR supports deployment via vLLM, SGLang, and Ollama, significantly reducing inference latency and compute cost, making it ideal for high-concurrency services and edge deployments.

- Easy to Use: Fully open-sourced and equipped with a comprehensive SDK and inference toolchain, offering simple installation, one-line invocation, and smooth integration into existing production pipelines.

 News & Updates

- [2026.3.12] GLM-OCR SDK now supports agent-friendly Skill mode — just pip install glmocr + set API key, ready to use via CLI or Python with no GPU or YAML config needed. See: GLM-OCR Skill
- [2026.3.12] GLM-OCR Technical Report is now available. See: GLM-OCR Technical Report
- [2026.2.12] Fine-tuning tutorial based on LLaMA-Factory is now available. See: GLM-OCR Fine-tuning Guide

 Download Model

| Model   | Download Links                                                                                                              | Precision |
| ------- | --------------------------------------------------------------------------------------------------------------------------- | --------- |
| GLM-OCR | 🤗 Hugging Face 🤖 ModelScope | BF16      |

 GLM-OCR SDK

We provide an SDK for using GLM-OCR more efficiently and conveniently.

 Install SDK

Choose the lightest installation that matches your scenario:

bash
 Cloud / MaaS + local images / PDFs (fastest install)
pip install glmocr

 Self-hosted pipeline (layout detection)
pip install "glmocr[selfhosted]"

 Flask service support
pip install "glmocr[server]"


Install from source for development:

bash
 Install from source
git clone h

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON