Instructions to use axteam/GLM-OCR-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use axteam/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 axteam/GLM-OCR-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf axteam/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 axteam/GLM-OCR-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf axteam/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 axteam/GLM-OCR-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf axteam/GLM-OCR-GGUF:Q4_K_M
Use Docker
docker model run hf.co/axteam/GLM-OCR-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use axteam/GLM-OCR-GGUF with Ollama:
ollama run hf.co/axteam/GLM-OCR-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use axteam/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 axteam/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:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "axteam/GLM-OCR-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use axteam/GLM-OCR-GGUF with Docker Model Runner:
docker model run hf.co/axteam/GLM-OCR-GGUF:Q4_K_M
- Lemonade
How to use axteam/GLM-OCR-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull axteam/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 axteam/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 axteam/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:8080/v1 hermes config set model.default axteam/GLM-OCR-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use axteam/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 axteam/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:8080/v1 \ --custom-model-id "axteam/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 (llama.cpp)
GGUF quantizations of zai-org/GLM-OCR for llama.cpp / Ollama / LM Studio. Produced by axteam.
Files
| File | Size | Notes |
|---|---|---|
GLM-OCR-Q4_K_M.gguf |
0.5 GB | 4-bit k-quant (medium) โ recommended size/quality balance. |
GLM-OCR-Q8_0.gguf |
1.0 GB | 8-bit โ closest to the original. |
Converted with llama.cpp
convert_hf_to_gguf.py(recognized asglm4 (text backbone)); the originalchat_templateis embedded. The vision encoder is not included in these GGUF files โ this is the text-backbone LLM only, so it serves text generation, not the full OCR/image pipeline. For end-to-end OCR use the original model or the FP8 buildaxteam/GLM-OCR-FP8-dynamicwith vLLM.
Quantization method
These GGUF files are post-training quantization (PTQ) made with llama.cpp (convert_hf_to_gguf.py โ llama-quantize): the BF16 weights are quantized block-wise (k-quants: per-block scales with mixed bit allocation), with no retraining. The original chat_template is embedded in each file.
Requirements
| llama.cpp | build โฅ b8093 โ architecture glm4 (GLM-OCR text decoder) needs โฅ b8093, and the commands on this card use -fa on (โฅ b6325). Load-checked here with b12005 (commit e0f142d) and b10724 on CPU โ the loader accepts the model, tokenizer and the -fa on / q8_0 KV-cache flags; no generation was run in that check. |
| Memory | the chosen GGUF file (sizes in the table) plus KV cache for the context (-c); --cache-type-k/v q8_0 -fa on halves the KV cache. |
| Input | text only โ no mmproj in this repo, so llama.cpp cannot do OCR / image input with it. |
| Ollama / LM Studio | not tested here. |
Run with llama.cpp
# pull one quant straight from the Hub and serve an OpenAI-compatible API on :8080
llama-server -hf axteam/GLM-OCR-GGUF:Q4_K_M -c 8192 --jinja
# or download a single file and chat in the terminal
hf download axteam/GLM-OCR-GGUF GLM-OCR-Q4_K_M.gguf --local-dir .
llama-cli -m GLM-OCR-Q4_K_M.gguf -c 8192 --jinja
Query the server:
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
"messages": [{"role": "user", "content": "๋ํ๋ฏผ๊ตญ์ ์๋๋ ์ด๋์ธ๊ฐ์?"}],
"max_tokens": 512
}'
Reduce KV-cache memory (optional, run-time)
KV-cache type is chosen at run time in llama.cpp (it is not baked into the file):
llama-server -hf axteam/GLM-OCR-GGUF:Q4_K_M -c 8192 --jinja --cache-type-k q8_0 --cache-type-v q8_0 -fa on
Ollama
ollama run hf.co/axteam/GLM-OCR-GGUF:Q4_K_M
LM Studio
Search for axteam/GLM-OCR-GGUF in the model browser and pick a quant (e.g. Q4_K_M).
License
Quantized derivative of zai-org/GLM-OCR (mit). Original weights & tokenizer belong to Z.ai.
ํ๊ตญ์ด ์์ฝ
zai-org/GLM-OCR์ GGUF ์์ํ ๋น๋ (llama.cppยทOllamaยทLM Studio์ฉ) ยท ์ ์ axteam
๊ฐ์
| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| ์๋ณธ ๋ชจ๋ธ | zai-org/GLM-OCR |
| ํ์ | GGUF (llama.cpp) |
| ๋ณํ ๋๊ตฌ | llama.cpp convert_hf_to_gguf.py โ llama-quantize |
| ํฌํจ | ํ ์คํธ ๋ฐฑ๋ณธ(์ธ์ด ๋ชจ๋ธ)๋ง โ ๋น์ ์ธ์ฝ๋ ๋ฏธํฌํจ, ์ด GGUF๋ก๋ OCR ๋ถ๊ฐ |
| ํ์ผ ์ | 2๊ฐ |
์์ํ ์์ธ
- ์์ํ ์ ์ฐจ: PTQ(ํ์ต ํ ์์ํ, ์ฌํ์ต ์์), llama.cpp ๋ธ๋ก ๋จ์ ์์ํ(k-quant
Q*_K,Q8_0) - chat template: GGUF ํ์ผ์ ๋ด์ฅ
- ํ์ง: ๋ฏธ์ธก์ โ ์๋ ํ์ผ๋ณ ์ค๋ช ์ llama.cpp ์์ํ ๋จ๊ณ์ ์ผ๋ฐ์ ๊ฒฝํฅ
์ ๊ณต ํ์ผ
| ํ์ผ | ํฌ๊ธฐ | ์ค๋ช |
|---|---|---|
GLM-OCR-Q4_K_M.gguf |
0.5 GB | 4๋นํธ k-quant โ ํฌ๊ธฐยทํ์ง ๊ท ํ (๊ถ์ฅ) |
GLM-OCR-Q8_0.gguf |
1.0 GB | 8๋นํธ โ ์๋ณธ์ ๊ฐ์ฅ ๊ฐ๊น์ |
์๊ตฌ์ฌํญ
- llama.cpp: b8093 ์ด์ (
glm4๊ตฌ์กฐ(GLM-OCR ํ ์คํธ ๋์ฝ๋) ์ง์ b8093๋ถํฐ, ์์ ๋ช ๋ น์-fa on์ต์ b6325๋ถํฐ) - ๋ก๋ฉ ํ์ธ: b12005(์ปค๋ฐ e0f142d)์ b10724์์ CPU๋ก ๋ชจ๋ธยทํ ํฌ๋์ด์ ๋ก๋ฉ๊ณผ
-fa onยทq8_0 KV ์บ์ ์ต์ ์ธ์๋ง ํ์ธ (์์ฑ์ ์คํ ๋ฏธํ์ธ) - ๋ฉ๋ชจ๋ฆฌ: ์ ํํ GGUF ํ์ผ ํฌ๊ธฐ + ์ปจํ
์คํธ(
-c)๋งํผ์ KV ์บ์ (KV ์บ์ ์ค์ด๋ ๋ฐฉ๋ฒ์ ์๋ ์ฌ์ฉ๋ฒ ์ฐธ๊ณ ) - ์
๋ ฅ: ํ
์คํธ ์ ์ฉ(
mmproj์์) โ OCR์ ์๋ณธ ๋ชจ๋ธ์ด๋ FP8 ๋น๋(axteam/GLM-OCR-FP8-dynamic)๋ฅผ vLLM์ผ๋ก ์คํ - OllamaยทLM Studio: ์ ์ ์ธก์์ ์คํ ๋ฏธํ์ธ
์ฌ์ฉ๋ฒ
- ํ์ผ ๋ฐ๊ธฐ:
hf download axteam/GLM-OCR-GGUF GLM-OCR-Q4_K_M.gguf --local-dir .(์๋-m๋ช ๋ น์ ํ์, ๋ค๋ฅธ ์์ํ๋ ํ์ผ๋ช ์Q4_K_M๋ง ๋ณ๊ฒฝ) - ์๋ฒ ์คํ:
llama-server -hf axteam/GLM-OCR-GGUF:Q4_K_M -c 8192 --jinjaโ OpenAI ํธํ API - ํฐ๋ฏธ๋ ๋ํ:
llama-cli -m GLM-OCR-Q4_K_M.gguf -c 8192 --jinja - Ollama:
ollama run hf.co/axteam/GLM-OCR-GGUF:Q4_K_M - LM Studio: ๋ชจ๋ธ ๊ฒ์์์
axteam/GLM-OCR-GGUF์ ๋ ฅ ํ ์์ํ ๋จ๊ณ ์ ํ - KV ์บ์ ์ ๊ฐ(์ ํ):
--cache-type-k q8_0 --cache-type-v q8_0 -fa onโ KV ์บ์ ์ฝ ์ ๋ฐ, GGUF ํ์ผ๊ณผ ์๊ด์์ด ์คํ ์ ์ง์
๋ผ์ด์ ์ค
- ๋ผ์ด์ ์ค: MIT โ ์๋ณธ ๋ชจ๋ธ์ ๋ผ์ด์ ์ค๋ฅผ ๊ทธ๋๋ก ๋ฐ๋ฆ
- ๊ถ๋ฆฌ: ์๋ณธ ๊ฐ์ค์นยทํ ํฌ๋์ด์ ๋ Z.ai ์์ , ์ด ๋ฆฌํฌ๋ ์์ํ ํ์๋ฌผ
- Downloads last month
- 203
4-bit
8-bit
Model tree for axteam/GLM-OCR-GGUF
Base model
zai-org/GLM-OCR