Instructions to use prithivMLmods/GLM-OCR-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/GLM-OCR-GGUF with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("image-to-text", model="prithivMLmods/GLM-OCR-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("prithivMLmods/GLM-OCR-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use prithivMLmods/GLM-OCR-GGUF with 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:Q4_K_M # Run inference directly in the terminal: llama cli -hf prithivMLmods/GLM-OCR-GGUF:Q4_K_M
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:Q4_K_M # Run inference directly in the terminal: llama cli -hf prithivMLmods/GLM-OCR-GGUF:Q4_K_M
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:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf prithivMLmods/GLM-OCR-GGUF:Q4_K_M
Use Docker
docker model run hf.co/prithivMLmods/GLM-OCR-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use prithivMLmods/GLM-OCR-GGUF with Ollama:
ollama run hf.co/prithivMLmods/GLM-OCR-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use prithivMLmods/GLM-OCR-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf prithivMLmods/GLM-OCR-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "prithivMLmods/GLM-OCR-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use prithivMLmods/GLM-OCR-GGUF with Docker Model Runner:
docker model run hf.co/prithivMLmods/GLM-OCR-GGUF:Q4_K_M
- Lemonade
How to use prithivMLmods/GLM-OCR-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull prithivMLmods/GLM-OCR-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.GLM-OCR-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use prithivMLmods/GLM-OCR-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf prithivMLmods/GLM-OCR-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default prithivMLmods/GLM-OCR-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use prithivMLmods/GLM-OCR-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf prithivMLmods/GLM-OCR-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "prithivMLmods/GLM-OCR-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
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-V3layout 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 (withPP-DocLayout-V3under Apache 2.0) for deployment viavLLM,SGLang,Ollama, andTransformers.
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)
llama.cpp
LLM inference in C/C++ β https://github.com/ggml-org/llama.cpp
Quantized using llama.cpp by prithivMLmods.
- Downloads last month
- 779
4-bit
5-bit
6-bit
8-bit
16-bit
32-bit
Model tree for prithivMLmods/GLM-OCR-GGUF
Base model
zai-org/GLM-OCR


