{"name":"GLM-OCR: Accurate, Fast, and Comprehensive Multimodal OCR Model","description":"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.","github":"https://github.com/zai-org/GLM-OCR","url":"https://osrepos.com/repo/zai-org-glm-ocr","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/zai-org-glm-ocr","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/zai-org-glm-ocr.md","json":"https://osrepos.com/repo/zai-org-glm-ocr.json","topics":["Python","OCR","GLM","Image to Text","Document Understanding","Multimodal AI","Deep Learning"],"keywords":["Python","OCR","GLM","Image to Text","Document Understanding","Multimodal AI","Deep Learning"],"stars":null,"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.","content":"## Introduction\nGLM-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.\n\n## Installation\nThe GLM-OCR SDK offers flexible installation options to suit various deployment scenarios.\nFor cloud or MaaS usage with local images/PDFs (fastest install):\nbash\npip install glmocr\n\nFor self-hosted pipelines requiring layout detection:\nbash\npip install \"glmocr[selfhosted]\"\n\nTo include Flask service support:\nbash\npip install \"glmocr[server]\"\n\nFor development, you can install from source:\nbash\ngit clone https://github.com/zai-org/glm-ocr.git\ncd glm-ocr\nuv venv --python 3.12 --seed && source .venv/bin/activate\nuv pip install -e .\n\n\n## Examples\nGLM-OCR provides both a Command Line Interface (CLI) and a Python API for easy interaction.\n\n### CLI Usage:\nbash\n# Parse a single image\nglmocr parse examples/source/code.png\n\n# Parse a directory\nglmocr parse examples/source/\n\n# Set output directory\nglmocr parse examples/source/code.png --output ./results/\n\n# Enable debug logging with profiling\nglmocr parse examples/source/code.png --log-level DEBUG\n\n\n### Python API Usage:\npython\nfrom glmocr import GlmOcr, parse\n\n# Simple function call\nresult = parse(\"image.png\")\nresult = parse([\"img1.png\", \"img2.jpg\"]) # List treated as pages of a single document\nresult.save(output_dir=\"./results\")\n\n# Class-based API\nwith GlmOcr() as parser:\n    result = parser.parse(\"image.png\")\n    print(result.json_result)\n    result.save()\n\n# Place layout model on CPU\nwith GlmOcr(layout_device=\"cpu\") as parser:\n    result = parser.parse(\"image.png\")\n\n\n## Why Use GLM-OCR?\nGLM-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.\n\n## Links\n*   **GitHub Repository:** [https://github.com/zai-org/GLM-OCR](https://github.com/zai-org/GLM-OCR){:target=\"_blank\"}\n*   **Technical Report:** [https://arxiv.org/abs/2603.10910](https://arxiv.org/abs/2603.10910){:target=\"_blank\"}\n*   **GLM-OCR API Documentation:** [https://docs.z.ai/guides/vlm/glm-ocr](https://docs.z.ai/guides/vlm/glm-ocr){:target=\"_blank\"}\n*   **Hugging Face Model:** [https://huggingface.co/zai-org/GLM-OCR](https://huggingface.co/zai-org/GLM-OCR){:target=\"_blank\"}\n*   **ModelScope Model:** [https://modelscope.cn/models/ZhipuAI/GLM-OCR](https://modelscope.cn/models/ZhipuAI/GLM-OCR){:target=\"_blank\"}","metrics":{"detailViews":10,"githubClicks":15},"dates":{"published":null,"modified":"2026-05-28T19:41:26.000Z"}}