Roboflow

Z.aiZ.aiReleased Mar 2026MIT

GLM-OCR

GLM-OCR has no score on the current Vision Evals. On the earlier Vision Evals board (last updated July 9, 2026) it passed 87.3% of OCR tasks (#8 of 58).

It is an open-weight model from Z.ai under the MIT license, and free for commercial use.

GLM-OCR Interactive Demo

Results appear here. Add an image or pick an example to run GLM-OCR.

GLM-OCR Vision Evals

GLM-OCR has not yet been evaluated on the current benchmark. The results below are from the legacy version of Vision Evals, our previous benchmark. See the current Vision Evals

HighestLowest
This model#8 of 5887.34% pass rate · better than 84%
Score87.34%pass rate across 229 tasks
Speed1.00savg response per task
Cost—pricing unavailable
Tokens—tokens unavailable
Score key:≥75%40–74%<40%
CategoryPassedScore
Handwritten Math10 / 10
100%
Text Recognition27 / 30
90%
License Plate Recognition27 / 30
90%
Focused Scene OCR87 / 99
87.9%
VQA & Extraction49 / 60
81.7%

Scores based on a single evaluation run · Methodology

View all legacy Vision Evals results →

GLM-OCR Overview

GLM-OCR is a multimodal OCR model for complex document understanding, built on the GLM-V encoder-decoder architecture by Zhipu AI. The model combines a 0.4B-parameter CogViT visual encoder pre-trained on large-scale image-text data, a lightweight cross-modal connector with efficient token downsampling, and a 0.5B-parameter GLM language decoder, totaling 0.9B parameters. To address the inefficiency of standard autoregressive decoding in deterministic OCR tasks, GLM-OCR introduces a Multi-Token Prediction (MTP) mechanism that predicts multiple tokens per step, significantly improving decoding throughput while keeping memory overhead low through shared parameters. Training proceeds through four stages: visual encoder pretraining with MIM, CLIP, and distillation objectives; vision-language pretraining on document parsing, grounding, and VQA data; supervised fine-tuning on curated OCR datasets covering text, formula, table, and key information extraction; and full-task reinforcement learning to improve accuracy and structural consistency.

Deploy GLM-OCR with an API

GLM-OCR runs as a hosted REST endpoint through Roboflow Workflows. Pick a task, then hand the prompt to your coding agent or copy the code. Deploying the workflow into a free Roboflow workspace replaces the your-workspace and YOUR_API_KEY placeholders with your own.

Connect your agent to Roboflow (once)

Add the Roboflow MCP server

claude mcp add --transport http roboflow https://mcp.roboflow.com/mcp

Run /mcp and authorize Roboflow in your browser when the OAuth flow opens.

Start a new Claude Code session so the MCP loads, then paste the prompt below (it works the same in any agent).

Deploy this workflow to your Roboflow workspace to use it.

Integrate the Roboflow "GLM-OCR" workflow into my app.

- Endpoint: POST https://serverless.roboflow.com/<your-workspace>/workflows/glm-ocr-ocr
- Auth: send my Roboflow API key as `api_key` in the request body, read from the ROBOFLOW_API_KEY env var (never hardcode).
- Body: { "api_key": ..., "inputs": { `image`: { type: "url" | "base64", value } } }.

With the Roboflow MCP connected, call `workflows_get` on "glm-ocr-ocr" to read the exact input schema (the source of truth), then `workflows_run` on a sample image to confirm the output shape before writing code (the MCP is authenticated, so this needs no key). Without the MCP, use the contract above.

Before running the app, set up these keys so it does not error at runtime:
- `ROBOFLOW_API_KEY` (sent as `api_key`) from https://app.roboflow.com/settings/api
Create a .gitignore'd .env with these variables, using placeholder values for any I haven't given you. Then pause and tell me directly, in your reply: the full path to the .env file, exactly which keys I need to paste in, and the link to get each one. Wait for me to confirm I've added them before you run anything. Do not run the app until I confirm.

Then add the integration to my codebase: match my project's language, framework, and conventions; read every key from environment variables (never hardcode); add basic error handling; and include a small runnable example. If you can't tell what language my project uses, ask me.
Installpip install inference-sdk

Deploy this workflow to your Roboflow workspace to use it.

# 1. Import the library
from inference_sdk import InferenceHTTPClient

# 2. Connect to your workflow
client = InferenceHTTPClient(
  api_url="https://serverless.roboflow.com",
  api_key="YOUR_API_KEY"
)

# 3. Run your workflow on an image
result = client.run_workflow(
  workspace_name="your-workspace",
  workflow_id="glm-ocr-ocr",
  images={
    "image": "YOUR_IMAGE.jpg"  # Path to your image file
  },
  use_cache=True  # cache workflow definition for 15 minutes
)

# 4. Get your results
print(result)

Deploy this workflow to your Roboflow workspace to use it.

const response = await fetch('https://serverless.roboflow.com/your-workspace/workflows/glm-ocr-ocr', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    inputs: {
      "image": {"type": "url", "value": "IMAGE_URL"}
    }
  })
});

const result = await response.json();
console.log(result);

Deploy this workflow to your Roboflow workspace to use it.

curl --location 'https://serverless.roboflow.com/your-workspace/workflows/glm-ocr-ocr' \
--header 'Content-Type: application/json' \
--data '{
  "api_key": "YOUR_API_KEY",
  "inputs": {
    "image": {"type": "url", "value": "IMAGE_URL"}
  }
}'

GLM-OCR License

MIT · Permissive license

GLM-OCR is released under MIT, a permissive license. The GLM-OCR license lets you use, modify, and sell work built on the model, with the copyright notice as the only real obligation and no requirement to open-source related code changes.

Commercial use
Permitted with no separate commercial license. No usage caps, revenue thresholds, or field-of-use limits apply to GLM-OCR.
Modification
Permitted. You can fine-tune or rewrite GLM-OCR and keep the result closed-source.
Redistribution
Permitted. Include the original copyright and permission notice in copies or substantial portions of the work.

MIT grants no explicit patent license and disclaims all warranties. If patent exposure is a concern for your deployment, review it with counsel before launch.

Read the full MIT license ↗

Do I need a commercial license for GLM-OCR?

No commercial license is needed for GLM-OCR: permissive terms let you keep related code private while deploying commercially.

Do not hesitate to reach out with questions for your commercial project. Our team will help you start solving business problems on the first call. See Roboflow commercial licensing for the models included in each plan.

Talk to sales

This model is released under the MIT License, a short and permissive open-source license that allows commercial use, modification, and redistribution.

Yes. Under the terms of the MIT license, you can freely use this model for commercial purposes. You must retain the copyright notice and license text when redistributing.

License information is provided as a guide and is not legal advice.

GLM-OCR Details

Details

Categoryopen
ModalityMultimodal
Parameters0.9B
LicenseMIT
Release DateMar 2026

Vision Tasks

OCRDocument Question AnsweringVisual Question AnsweringVision LanguageChart Question Answering

Resources

Usage

Past 30 Days

Price vs. performance

Estimated cost per task vs. OCR score, for this model and others ranked near it. Upper-left is the sweet spot (high quality, low cost). Based on Vision Evals (legacy) results.

10 of 11 models plotted · 1 not yet evaluated

ModelScoreMedian tokensEst. cost / taskCompare
GoogleGemini 3 Flash93.0%1.3K$0.0010Compare
GoogleGemini 3.5 Flash90.4%1.3K$0.0034Compare
GoogleGemini 3.1 Flash-Lite90.0%1.1K$0.0003Compare
GoogleGemini 3.1 Pro89.5%1.1K$0.0024Compare
AnthropicClaude Fable 589.5%782$0.014Compare
Z.aiGLM-OCR(this model)87.3%———
AnthropicClaude Opus 4.887.3%670$0.0049Compare
AnthropicClaude Opus 4.786.9%1.1K$0.0069Compare
QwenQwen3.5-27B85.6%273$0.0003Compare
GoogleGemma 4 31B84.7%423$0.0001Compare
AnthropicClaude Sonnet 583.8%725$0.0019Compare

Frequently Asked Questions About GLM-OCR Vision

Yes. GLM-OCR accepts image input, and on Roboflow's previous vision benchmark it scored 87.3% on OCR. You can test it on your own image in the demo above.

Yes. The demo on this page runs GLM-OCR in the free Roboflow Playground: upload an image and see results in seconds. A free account unlocks unlimited runs.