Repolode
zai-org

zai-org/GLM-OCR

A 0.9B-parameter multimodal OCR model and SDK for extracting text, tables, formulas and layout from complex documents.

Open-source alternative to:Adobe Acrobat

Stars
7,582
Forks
677
Open issues
67
Last commit
25 days ago

What is it?

GLM-OCR is an OCR model for complex document understanding, built on the GLM-V encoder-decoder architecture with a CogViT visual encoder and a GLM-0.5B language decoder. It pairs with a two-stage pipeline that first performs layout analysis using PP-DocLayout-V3, then recognizes regions in parallel, so it handles multi-column pages, complex tables, formulas, code-heavy documents and seals.

The project ships as a Python SDK (installable via pip as glmocr) with a CLI, a Python API and an optional Flask service. It can run through the hosted Zhipu MaaS API without a GPU, or be self-hosted with vLLM, SGLang, Ollama or mlx-vlm on Apple Silicon. Output is provided as Markdown and JSON layout details.

The model weights are published on Hugging Face and ModelScope, and a LLaMA-Factory fine-tuning guide is included.

Key features

  • 01Recognizes text, tables, formulas and code in complex document layouts.
  • 02Runs layout detection first, then recognizes regions in parallel.
  • 03Deploys via the hosted Zhipu MaaS API or self-hosted vLLM, SGLang, Ollama and mlx-vlm.
  • 04Provides a CLI, Python API and Flask server with Markdown and JSON output.
  • 05Supports layout detection on CPU or a chosen GPU to free resources for the OCR model.
  • 06Includes a LLaMA-Factory fine-tuning guide.

Use cases

  • Converting scanned PDFs and photographed documents into Markdown or structured JSON.
  • Extracting tables and formulas from technical reports or papers.
  • Building document-processing pipelines that run on a self-hosted GPU server.
  • Running OCR on a laptop with Ollama or mlx-vlm without a cloud service.

In collections

Topics

FAQ

What is GLM-OCR?
A 0.9B-parameter multimodal OCR model and SDK for extracting text, tables, formulas and layout from complex documents. GLM-OCR is an OCR model for complex document understanding, built on the GLM-V encoder-decoder architecture with a CogViT visual encoder and a GLM-0.5B language decoder. It pairs with a two-stage pipeline that first performs layout analysis using PP-DocLayout-V3, then recognizes regions in parallel, so it handles multi-column pages, complex tables, formulas, code-heavy documents and seals.
Is GLM-OCR free to use? What license does it have?
GLM-OCR is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is GLM-OCR still maintained?
Actively maintained. The last commit to GLM-OCR was on Oct 14, 2026.
What can I use GLM-OCR for?
Converting scanned PDFs and photographed documents into Markdown or structured JSON. Extracting tables and formulas from technical reports or papers. Building document-processing pipelines that run on a self-hosted GPU server. Running OCR on a laptop with Ollama or mlx-vlm without a cloud service.
Where can I get GLM-OCR?
The source code and installation instructions are on GitHub: https://github.com/zai-org/GLM-OCR

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects