zai-org / GLM-OCR

huggingface.co
Total runs: 1.8M
24-hour runs: 0
7-day runs: 82.0K
30-day runs: -502.5K
Model's Last Updated: September 11 2026
image-to-text

Introduction of GLM-OCR

Model Details of GLM-OCR

GLM-OCR

👋 Join our WeChat and Discord community
📍 Use GLM-OCR's API

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.

Usage
vLLM
  1. run
pip install -U vllm --extra-index-url https://wheels.vllm.ai/nightly

or using docker with:

docker pull vllm/vllm-openai:nightly
  1. run with:
pip install git+https://github.com/huggingface/transformers.git
vllm serve zai-org/GLM-OCR  --allowed-local-media-path /  --port 8080
SGLang
  1. using docker with:
docker pull lmsysorg/sglang:dev

or build it from source with:

pip install git+https://github.com/sgl-project/sglang.git#subdirectory=python
  1. run with:
pip install git+https://github.com/huggingface/transformers.git
python -m sglang.launch_server --model zai-org/GLM-OCR --port 8080
Ollama
  1. Download Ollama .
  2. run with:
ollama run glm-ocr

Ollama will automatically use image file path when an image is dragged into the terminal:

ollama run glm-ocr Text Recognition: ./image.png
Transformers
pip install git+https://github.com/huggingface/transformers.git
from transformers import AutoProcessor, AutoModelForImageTextToText
import torch

MODEL_PATH = "zai-org/GLM-OCR"
messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "url": "test_image.png"
            },
            {
                "type": "text",
                "text": "Text Recognition:"
            }
        ],
    }
]
processor = AutoProcessor.from_pretrained(MODEL_PATH)
model = AutoModelForImageTextToText.from_pretrained(
    pretrained_model_name_or_path=MODEL_PATH,
    torch_dtype="auto",
    device_map="auto",
)
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_dict=True,
    return_tensors="pt"
).to(model.device)
inputs.pop("token_type_ids", None)
generated_ids = model.generate(**inputs, max_new_tokens=8192)
output_text = processor.decode(generated_ids[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False)
print(output_text)
Prompt Limited

GLM-OCR currently supports two types of prompt scenarios:

  1. Document Parsing – extract raw content from documents. Supported tasks include:
{
    "text": "Text Recognition:",
    "formula": "Formula Recognition:",
    "table": "Table Recognition:"
}
  1. Information Extraction – extract structured information from documents. Prompts must follow a strict JSON schema. For example, to extract personal ID information:
请按下列JSON格式输出图中信息:
{
    "id_number": "",
    "last_name": "",
    "first_name": "",
    "date_of_birth": "",
    "address": {
        "street": "",
        "city": "",
        "state": "",
        "zip_code": ""
    },
    "dates": {
        "issue_date": "",
        "expiration_date": ""
    },
    "sex": ""
}

⚠️ Note: When using information extraction, the output must strictly adhere to the defined JSON schema to ensure downstream processing compatibility.

GLM-OCR SDK

We provide an easy-to-use SDK for using GLM-OCR more efficiently and conveniently. please check our github to get more detail.

Acknowledgement

This project is inspired by the excellent work of the following projects and communities:

License

The GLM-OCR model is released under the MIT License.

The complete OCR pipeline integrates PP-DocLayoutV3 for document layout analysis, which is licensed under the Apache License 2.0. Users should comply with both licenses when using this project.

Runs of zai-org GLM-OCR on huggingface.co

1.8M
Total runs
0
24-hour runs
27.9K
3-day runs
82.0K
7-day runs
-502.5K
30-day runs

More Information About GLM-OCR huggingface.co Model

More GLM-OCR license Visit here:

https://choosealicense.com/licenses/mit

GLM-OCR huggingface.co

GLM-OCR huggingface.co is an AI model on huggingface.co that provides GLM-OCR's model effect (), which can be used instantly with this zai-org GLM-OCR model. huggingface.co supports a free trial of the GLM-OCR model, and also provides paid use of the GLM-OCR. Support call GLM-OCR model through api, including Node.js, Python, http.

zai-org GLM-OCR online free

GLM-OCR huggingface.co is an online trial and call api platform, which integrates GLM-OCR's modeling effects, including api services, and provides a free online trial of GLM-OCR, you can try GLM-OCR online for free by clicking the link below.

zai-org GLM-OCR online free url in huggingface.co:

https://huggingface.co/zai-org/GLM-OCR

GLM-OCR install

GLM-OCR is an open source model from GitHub that offers a free installation service, and any user can find GLM-OCR on GitHub to install. At the same time, huggingface.co provides the effect of GLM-OCR install, users can directly use GLM-OCR installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

GLM-OCR install url in huggingface.co:

https://huggingface.co/zai-org/GLM-OCR

Url of GLM-OCR

GLM-OCR huggingface.co Url

Provider of GLM-OCR huggingface.co

zai-org
ORGANIZATIONS

Other API from zai-org

huggingface.co

Total runs: 4.2M
Run Growth: 4.1M
Growth Rate: 95.53%
Updated:September 07 2026
huggingface.co

Total runs: 1.8M
Run Growth: -65.9K
Growth Rate: -3.57%
Updated:January 29 2026
huggingface.co

Total runs: 1.3M
Run Growth: 1.3M
Growth Rate: 99.31%
Updated:September 04 2026
huggingface.co

Total runs: 885.1K
Run Growth: -947.8K
Growth Rate: -107.08%
Updated:September 01 2026
huggingface.co

Total runs: 745.7K
Run Growth: -1.0M
Growth Rate: -134.56%
Updated:September 01 2026
huggingface.co

Total runs: 462.6K
Run Growth: 17.8K
Growth Rate: 3.86%
Updated:August 04 2024
huggingface.co

Total runs: 216.1K
Run Growth: 24.4K
Growth Rate: 16.68%
Updated:August 11 2025
huggingface.co

Total runs: 150.9K
Run Growth: 87.4K
Growth Rate: 57.91%
Updated:August 11 2026
huggingface.co

Total runs: 136.1K
Run Growth: 53.8K
Growth Rate: 39.54%
Updated:May 13 2026
huggingface.co

Total runs: 106.6K
Run Growth: 9.3K
Growth Rate: 8.76%
Updated:August 11 2025
huggingface.co

Total runs: 103.5K
Run Growth: 38.1K
Growth Rate: 36.79%
Updated:January 29 2026
huggingface.co

Total runs: 94.1K
Run Growth: -292.8K
Growth Rate: -311.13%
Updated:April 16 2026
huggingface.co

Total runs: 84.7K
Run Growth: -448
Growth Rate: -0.53%
Updated:March 13 2025
huggingface.co

Total runs: 72.7K
Run Growth: -33.0K
Growth Rate: -45.36%
Updated:December 10 2025
huggingface.co

Total runs: 67.7K
Run Growth: -11.8K
Growth Rate: -17.43%
Updated:December 05 2024
huggingface.co

Total runs: 40.9K
Run Growth: -28.8K
Growth Rate: -70.55%
Updated:October 25 2025
huggingface.co

Total runs: 35.0K
Run Growth: 34.5K
Growth Rate: 98.62%
Updated:September 04 2026
huggingface.co

Total runs: 21.3K
Run Growth: -865.9K
Growth Rate: -4059.77%
Updated:April 05 2026
huggingface.co

Total runs: 20.1K
Run Growth: 4.6K
Growth Rate: 22.65%
Updated:November 23 2024
huggingface.co

Total runs: 18.4K
Run Growth: -25.4K
Growth Rate: -138.18%
Updated:March 03 2025
huggingface.co

Total runs: 17.7K
Run Growth: 183
Growth Rate: 1.04%
Updated:September 30 2025
huggingface.co

Total runs: 17.6K
Run Growth: -15.7K
Growth Rate: -89.06%
Updated:April 14 2025
huggingface.co

Total runs: 17.2K
Run Growth: -2.9K
Growth Rate: -16.81%
Updated:November 23 2024
huggingface.co

Total runs: 14.2K
Run Growth: -7.9K
Growth Rate: -55.82%
Updated:December 23 2025
huggingface.co

Total runs: 12.0K
Run Growth: 4.4K
Growth Rate: 36.90%
Updated:December 09 2025
huggingface.co

Total runs: 8.1K
Run Growth: 908
Growth Rate: 11.27%
Updated:October 16 2025
huggingface.co

Total runs: 8.0K
Run Growth: -1.2K
Growth Rate: -15.19%
Updated:January 15 2026
huggingface.co

Total runs: 7.6K
Run Growth: -4.6K
Growth Rate: -60.11%
Updated:April 22 2025
huggingface.co

Total runs: 7.5K
Run Growth: -1.0K
Growth Rate: -13.38%
Updated:March 11 2025
huggingface.co

Total runs: 3.6K
Run Growth: -4.1K
Growth Rate: -114.34%
Updated:December 09 2025
huggingface.co

Total runs: 2.6K
Run Growth: 328
Growth Rate: 12.53%
Updated:October 25 2025
huggingface.co

Total runs: 2.6K
Run Growth: 1.2K
Growth Rate: 45.27%
Updated:August 12 2025
huggingface.co

Total runs: 2.4K
Run Growth: -125
Growth Rate: -5.31%
Updated:August 04 2024
huggingface.co

Total runs: 2.1K
Run Growth: -8.3K
Growth Rate: -402.68%
Updated:January 27 2025
huggingface.co

Total runs: 956
Run Growth: 731
Growth Rate: 76.23%
Updated:October 20 2023
huggingface.co

Total runs: 602
Run Growth: 179
Growth Rate: 29.73%
Updated:March 02 2023
huggingface.co

Total runs: 457
Run Growth: -253
Growth Rate: -55.36%
Updated:August 11 2025
huggingface.co

Total runs: 436
Run Growth: 177
Growth Rate: 40.60%
Updated:December 10 2024
huggingface.co

Total runs: 395
Run Growth: -964
Growth Rate: -244.05%
Updated:January 02 2025
huggingface.co

Total runs: 356
Run Growth: 130
Growth Rate: 36.52%
Updated:October 25 2025
huggingface.co

Total runs: 262
Run Growth: -59
Growth Rate: -22.52%
Updated:January 13 2026
huggingface.co

Total runs: 229
Run Growth: -8
Growth Rate: -3.49%
Updated:November 20 2023
huggingface.co

Total runs: 202
Run Growth: 23
Growth Rate: 11.27%
Updated:October 20 2023