zai-org / GLM-OCR

huggingface.co
Total runs: 1.9M
24-hour runs: 0
7-day runs: -108.7K
30-day runs: -1.3M
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.9M
Total runs
0
24-hour runs
14.6K
3-day runs
-108.7K
7-day runs
-1.3M
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: 1.9M
Run Growth: -153.1K
Growth Rate: -8.19%
Updated:January 29 2026
huggingface.co

Total runs: 1.8M
Run Growth: 1.6M
Growth Rate: 100.00%
Updated:September 07 2026
huggingface.co

Total runs: 1.3M
Run Growth: -706.1K
Growth Rate: -53.41%
Updated:September 01 2026
huggingface.co

Total runs: 947.1K
Run Growth: -1.8M
Growth Rate: -187.25%
Updated:September 01 2026
huggingface.co

Total runs: 712.6K
Run Growth: 660.2K
Growth Rate: 98.68%
Updated:September 04 2026
huggingface.co

Total runs: 445.2K
Run Growth: -19.8K
Growth Rate: -4.45%
Updated:August 04 2024
huggingface.co

Total runs: 238.4K
Run Growth: -226.6K
Growth Rate: -90.56%
Updated:April 16 2026
huggingface.co

Total runs: 175.4K
Run Growth: -833.5K
Growth Rate: -410.62%
Updated:April 05 2026
huggingface.co

Total runs: 98.4K
Run Growth: -151.6K
Growth Rate: -156.36%
Updated:August 11 2025
huggingface.co

Total runs: 91.7K
Run Growth: 97
Growth Rate: 0.12%
Updated:May 13 2026
huggingface.co

Total runs: 90.6K
Run Growth: 12.7K
Growth Rate: 15.16%
Updated:January 29 2026
huggingface.co

Total runs: 87.3K
Run Growth: -1.9K
Growth Rate: -2.15%
Updated:March 13 2025
huggingface.co

Total runs: 82.5K
Run Growth: -41.2K
Growth Rate: -50.94%
Updated:August 11 2025
huggingface.co

Total runs: 77.0K
Run Growth: -74.8K
Growth Rate: -96.73%
Updated:December 10 2025
huggingface.co

Total runs: 76.3K
Run Growth: -8.1K
Growth Rate: -10.65%
Updated:December 05 2024
huggingface.co

Total runs: 56.8K
Run Growth: -65.8K
Growth Rate: -111.71%
Updated:August 11 2026
huggingface.co

Total runs: 44.8K
Run Growth: -76.8K
Growth Rate: -170.84%
Updated:October 25 2025
huggingface.co

Total runs: 22.2K
Run Growth: 4.4K
Growth Rate: 20.03%
Updated:November 23 2024
huggingface.co

Total runs: 20.4K
Run Growth: -57.9K
Growth Rate: -282.96%
Updated:March 03 2025
huggingface.co

Total runs: 20.1K
Run Growth: -20.2K
Growth Rate: -100.35%
Updated:April 14 2025
huggingface.co

Total runs: 18.2K
Run Growth: -9.7K
Growth Rate: -53.16%
Updated:September 30 2025
huggingface.co

Total runs: 16.0K
Run Growth: -2.3K
Growth Rate: -14.12%
Updated:November 23 2024
huggingface.co

Total runs: 14.2K
Run Growth: 13.5K
Growth Rate: 96.55%
Updated:September 04 2026
huggingface.co

Total runs: 13.7K
Run Growth: -14.0K
Growth Rate: -99.89%
Updated:December 23 2025
huggingface.co

Total runs: 13.1K
Run Growth: 2.4K
Growth Rate: 18.60%
Updated:December 09 2025
huggingface.co

Total runs: 9.4K
Run Growth: 207
Growth Rate: 2.11%
Updated:January 15 2026
huggingface.co

Total runs: 7.9K
Run Growth: -1.7K
Growth Rate: -21.73%
Updated:October 16 2025
huggingface.co

Total runs: 7.0K
Run Growth: -6.8K
Growth Rate: -96.42%
Updated:April 22 2025
huggingface.co

Total runs: 6.8K
Run Growth: -1.9K
Growth Rate: -27.58%
Updated:March 11 2025
huggingface.co

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

Total runs: 4.3K
Run Growth: -4.9K
Growth Rate: -126.66%
Updated:December 09 2025
huggingface.co

Total runs: 3.1K
Run Growth: -1.6K
Growth Rate: -56.33%
Updated:October 25 2025
huggingface.co

Total runs: 3.0K
Run Growth: 1.0K
Growth Rate: 33.16%
Updated:August 04 2024
huggingface.co

Total runs: 1.8K
Run Growth: 930
Growth Rate: 50.82%
Updated:August 12 2025
huggingface.co

Total runs: 678
Run Growth: 282
Growth Rate: 41.53%
Updated:March 02 2023
huggingface.co

Total runs: 576
Run Growth: -56
Growth Rate: -9.54%
Updated:August 11 2025
huggingface.co

Total runs: 439
Run Growth: -1.2K
Growth Rate: -266.28%
Updated:January 02 2025
huggingface.co

Total runs: 427
Run Growth: 242
Growth Rate: 57.76%
Updated:October 20 2023
huggingface.co

Total runs: 346
Run Growth: 86
Growth Rate: 24.86%
Updated:December 10 2024
huggingface.co

Total runs: 326
Run Growth: -403
Growth Rate: -125.55%
Updated:October 25 2025
huggingface.co

Total runs: 297
Run Growth: 130
Growth Rate: 43.33%
Updated:March 02 2023
huggingface.co

Total runs: 278
Run Growth: 68
Growth Rate: 24.46%
Updated:November 20 2023
huggingface.co

Total runs: 263
Run Growth: 111
Growth Rate: 43.02%
Updated:October 20 2023
huggingface.co

Total runs: 249
Run Growth: 105
Growth Rate: 42.17%
Updated:October 20 2023