GLM-OCR: Accurate, Fast, and Comprehensive Multimodal OCR Model
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
GLM-OCR is a powerful multimodal OCR model designed for complex document understanding, built on the GLM-V encoder-decoder architecture. It achieves state-of-the-art performance across various benchmarks, offering efficient inference and easy integration. This open-source solution is optimized for real-world business scenarios, providing robust and high-quality OCR capabilities.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
GLM-OCR is a powerful multimodal OCR model specifically engineered for complex document understanding. Built upon the GLM-V encoder-decoder architecture, it incorporates Multi-Token Prediction (MTP) loss and stable full-task reinforcement learning to enhance training efficiency, recognition accuracy, and generalization. The model integrates a CogViT visual encoder, a lightweight cross-modal connector, and a GLM-0.5B language decoder. Combined with a two-stage pipeline of layout analysis and parallel recognition, GLM-OCR delivers robust and high-quality OCR performance across diverse document layouts.
Installation
The GLM-OCR SDK offers flexible installation options to suit various deployment scenarios.
For cloud or MaaS usage with local images/PDFs (fastest install):
pip install glmocr
For self-hosted pipelines requiring layout detection:
pip install "glmocr[selfhosted]"
To include Flask service support:
pip install "glmocr[server]"
For development, you can install from source:
git clone https://github.com/zai-org/glm-ocr.git
cd glm-ocr
uv venv --python 3.12 --seed && source .venv/bin/activate
uv pip install -e .
Examples
GLM-OCR provides both a Command Line Interface (CLI) and a Python API for easy interaction.
CLI Usage:
# Parse a single image
glmocr parse examples/source/code.png
# Parse a directory
glmocr parse examples/source/
# Set output directory
glmocr parse examples/source/code.png --output ./results/
# Enable debug logging with profiling
glmocr parse examples/source/code.png --log-level DEBUG
Python API Usage:
from glmocr import GlmOcr, parse
# Simple function call
result = parse("image.png")
result = parse(["img1.png", "img2.jpg"]) # List treated as pages of a single document
result.save(output_dir="./results")
# Class-based API
with GlmOcr() as parser:
result = parser.parse("image.png")
print(result.json_result)
result.save()
# Place layout model on CPU
with GlmOcr(layout_device="cpu") as parser:
result = parser.parse("image.png")
Why Use GLM-OCR?
GLM-OCR stands out for its state-of-the-art performance, ranking #1 on OmniDocBench V1.5 and achieving top results across major document understanding benchmarks, including formula and table recognition. It is specifically optimized for real-world business scenarios, maintaining robust performance on complex tables, code-heavy documents, and challenging layouts. With only 0.9B parameters, GLM-OCR supports efficient inference via vLLM, SGLang, and Ollama, significantly reducing latency and compute costs, making it ideal for high-concurrency services and edge deployments. Furthermore, it is fully open-sourced and easy to use, offering simple installation, one-line invocation, and smooth integration into existing production pipelines.
Links
- GitHub Repository: https://github.com/zai-org/GLM-OCR
- Technical Report: https://arxiv.org/abs/2603.10910
- GLM-OCR API Documentation: https://docs.z.ai/guides/vlm/glm-ocr
- Hugging Face Model: https://huggingface.co/zai-org/GLM-OCR
- ModelScope Model: https://modelscope.cn/models/ZhipuAI/GLM-OCR
Related repositories
Similar repositories that may be relevant next.
Django Channels: Developer-Friendly Asynchrony for Django
July 22, 2026
Django Channels extends Django to bring powerful asynchronous capabilities, including WebSockets and long-poll HTTP, to your projects. It integrates seamlessly using familiar Django design patterns, offering a flexible framework for building real-time applications. As an official Django Project, it ensures robust support and continuous development.
StringWars: Benchmarking High-Performance String Processing in Rust and Python
July 21, 2026
StringWars is a comprehensive GitHub repository dedicated to benchmarking performance-oriented string processing libraries in Rust and Python. It meticulously compares various operations, including substring search, hashing, and edit distances, across both CPUs and GPUs. This project serves as an invaluable resource for developers seeking to identify the fastest and most efficient solutions for critical string manipulation tasks, particularly those leveraging modern SIMD instructions and GPU acceleration.
awesome-python-books: A Curated Directory of Python Books for All Levels
July 19, 2026
The `awesome-python-books` repository is an extensive, curated directory of Python books, catering to learners from absolute beginners to advanced practitioners. It organizes a vast collection of resources across various domains, making it an invaluable tool for anyone looking to deepen their Python knowledge. This list simplifies the search for high-quality educational materials in the Python ecosystem.

Become-A-Full-Stack-Web-Developer: Free Resources for Web Development
July 19, 2026
The Become-A-Full-Stack-Web-Developer repository is an extensive collection of free resources designed to guide aspiring developers through the entire journey of full-stack web development. It covers a wide array of topics, from foundational languages like HTML, CSS, and JavaScript to advanced frameworks such as React and Node.js, alongside databases, APIs, and career preparation. This resource is invaluable for anyone looking to build a strong skill set in modern web development.
Source repository
Open the original repository on GitHub.
15 counted GitHub visits