How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf prithivMLmods/GLM-OCR-GGUF:
# Run inference directly in the terminal:
llama cli -hf prithivMLmods/GLM-OCR-GGUF:
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf prithivMLmods/GLM-OCR-GGUF:
# Run inference directly in the terminal:
llama cli -hf prithivMLmods/GLM-OCR-GGUF:
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-app
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama serve -hf prithivMLmods/GLM-OCR-GGUF:
# Run inference directly in the terminal:
./build/bin/llama cli -hf prithivMLmods/GLM-OCR-GGUF:
Use Docker
docker model run hf.co/prithivMLmods/GLM-OCR-GGUF:
Quick Links

GLM-OCR-GGUF

GLM-OCR is an open-weight 0.9B-parameter multimodal OCR model built on the GLM-V encoder–decoder architectureβ€”pairing a pre-trained CogViT visual encoder and lightweight token-downsampling connector with a GLM-0.5B language decoderβ€”for high-accuracy document parsing and structured JSON information extraction. Trained with Multi-Token Prediction (MTP) loss and full-task reinforcement learning, and designed to work alongside a two-stage PP-DocLayout-V3 layout analysis pipeline in the official GLM-OCR SDK, it ranks #1 overall on OmniDocBench V1.5 (scoring 94.62) while excelling at complex tables, mathematical formulas, code-heavy pages, and seals across eight languages (zh, en, fr, es, ru, de, ja, ko). Reaching throughputs of 1.86 pages/sec on PDFs and 0.67 images/sec on images, the model weights are released under an MIT license (with PP-DocLayout-V3 under Apache 2.0) for deployment via vLLM, SGLang, Ollama, and Transformers.

Not sure which quantization to choose? Go with Q8_0 for the best performance.

Model Files

File Name Quant Type File Size File Link Description
GLM-OCR.F32.gguf F32 3.57 GB Link Full 32-bit float weights. Maximum precision, largest file size.
GLM-OCR.BF16.gguf BF16 1.79 GB Link Full BF16 weights. High quality, excellent balance of precision and size.
GLM-OCR.F16.gguf F16 1.79 GB Link Full 16-bit float weights. High quality, excellent balance of precision and size.
GLM-OCR.Q4_K_M.gguf Q4_K_M 549 MB Link Good quality, default size for most use cases, recommended.
GLM-OCR.Q4_K_S.gguf Q4_K_S 531 MB Link Slightly lower quality with more space savings, recommended.
GLM-OCR.Q5_K_M.gguf Q5_K_M 639 MB Link High quality, recommended.
GLM-OCR.Q5_K_S.gguf Q5_K_S 628 MB Link High quality with slight space savings, recommended.
GLM-OCR.Q6_K.gguf Q6_K 735 MB Link Very high quality, near perfect, recommended.
GLM-OCR.Q8_0.gguf Q8_0 950 MB Link Extremely high quality, generally unneeded but max available standard quant.
GLM-OCR.mmproj-bf16.gguf mmproj-bf16 884 MB Link Multimodal projection file in BF16 format. Used for vision/OCR capabilities.
GLM-OCR.mmproj-f16.gguf mmproj-f16 884 MB Link Multimodal projection file in F16 format. Used for vision/OCR capabilities.
GLM-OCR.mmproj-f32.gguf mmproj-f32 1.74 GB Link Multimodal projection file in F32 format. Maximum precision for vision/OCR.
GLM-OCR.mmproj-q8_0.gguf mmproj-q8_0 484 MB Link Multimodal projection file in Q8_0 format. High precision with space savings for vision/OCR.

BF16 Test Run

Tested GLM-OCR.BF16.gguf with the BF16 multimodal projector (GLM-OCR.mmproj-bf16.gguf) on an NVIDIA RTX PRO 6000 Blackwell Server Edition GPU with 96 GB of VRAM, using llama-cli with full GPU offloading.

Performance Metrics

Metric Value
Average Prompt Processing Speed 2,521.67 tokens/s
Average Generation Speed 643.04 tokens/s
Total Wall Time 7.7 seconds
Context Length 8,192 tokens
KV Cache (K) q8_0
Multimodal Projector GLM-OCR.mmproj-bf16.gguf
GPU NVIDIA RTX PRO 6000 Blackwell Server Edition
GPU VRAM Capacity 96 GB
Peak GPU VRAM Usage 3.67 GiB
Peak GPU Utilization 89%
GPU Layers Offloaded 99 (-ngl 99)
Random Seed 42
Speculative Decoding No
Test Runs 3

Test Shots

Shot Test Image
Shot 1 Vision OCR β€” Image 1 EF8cldKHhUEO3MZPZSD19.jpeg
Shot 2 Vision OCR β€” Image 2 oYtCvrxudkMzz3nYr7lN7.jpeg
Shot 3 Vision OCR β€” Image 3 IOjpU_h3RI_DoVdKXZ0DW.jpeg

Run Inference

./build/bin/llama-cli \
  -m /path/to/models/GLM-OCR.BF16.gguf \
  --mmproj /path/to/models/GLM-OCR.mmproj-bf16.gguf \
  --image /path/to/image.jpeg \
  -ngl 99 \
  -c 8192 \
  --cache-type-k q8_0 \
  --seed 42 \
  -n 4096 \
  -st \
  -p "OCR the image."

Performance results reflect this specific hardware and inference configuration. Actual throughput may vary depending on the prompt, model, software build, and runtime settings.

Snapshots (3)

download (1) download (2) download (3) download

llama.cpp

LLM inference in C/C++ β€” https://github.com/ggml-org/llama.cpp

Quantized using llama.cpp by prithivMLmods.

Downloads last month
779
GGUF
Model size
0.9B params
Architecture
glm4
Hardware compatibility
Log In to add your hardware

4-bit

5-bit

6-bit

8-bit

16-bit

32-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for prithivMLmods/GLM-OCR-GGUF

Base model

zai-org/GLM-OCR
Quantized
(44)
this model

Collections including prithivMLmods/GLM-OCR-GGUF