Instructions to use 0xSero/GLM-5-381B-GGUF-IQ2_M 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 0xSero/GLM-5-381B-GGUF-IQ2_M 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 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M # Run inference directly in the terminal: llama cli -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M # Run inference directly in the terminal: llama cli -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M # Run inference directly in the terminal: ./llama-cli -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
Use Docker
docker model run hf.co/0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
- LM Studio
- Jan
- vLLM
How to use 0xSero/GLM-5-381B-GGUF-IQ2_M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "0xSero/GLM-5-381B-GGUF-IQ2_M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "0xSero/GLM-5-381B-GGUF-IQ2_M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
- Ollama
How to use 0xSero/GLM-5-381B-GGUF-IQ2_M with Ollama:
ollama run hf.co/0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
- Unsloth Desktop
- Pi
How to use 0xSero/GLM-5-381B-GGUF-IQ2_M with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_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": "0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use 0xSero/GLM-5-381B-GGUF-IQ2_M with Docker Model Runner:
docker model run hf.co/0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
- Lemonade
How to use 0xSero/GLM-5-381B-GGUF-IQ2_M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
Run and chat with the model
lemonade run user.GLM-5-381B-GGUF-IQ2_M-UD-IQ2_M
List all available models
lemonade list
- Hermes Agent
How to use 0xSero/GLM-5-381B-GGUF-IQ2_M with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_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 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use 0xSero/GLM-5-381B-GGUF-IQ2_M with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_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 "0xSero/GLM-5-381B-GGUF-IQ2_M:UD-IQ2_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"
Support this work → · X · GitHub · REAP paper · Cerebras REAP
GLM-5-381B-GGUF-IQ2_M
GGUF quantization of zai-org/GLM-5.
At a glance
| Base model | zai-org/GLM-5 |
| Format | GGUF |
| Total params | 381B |
| Active / token | — |
| Experts / layer | — |
| Layers | — |
| Hidden size | — |
| Context | — |
| On-disk size | 130 GB |
Which variant should I pick?
| Variant | Format | Link |
|---|---|---|
GLM-5-381B |
BF16 | link |
GLM-5-381B-GGUF-BF16 |
GGUF | link |
GLM-5-381B-GGUF-IQ2_M (this) |
GGUF | link |
GLM-5-381B-GGUF-IQ2_XXS |
GGUF | link |
GLM-5-381B-GGUF-Q3_K_M |
GGUF | link |
GLM-5-381B-W3A16 |
W3A16 | link |
glm5-reap-observations |
BF16 | link |
Expert-pruned GLM-5 (744B -> ~372B params, 256 -> 128 routed experts) quantized to dynamic IQ2_M (2.72 BPW) using importance-matrix calibration. Fits in ~125-130 GB VRAM with KV cache room.
Benchmark Results (Pilot, 10 samples/category)
| Category | Q3_K_M (170GB) | UD-IQ2_M (121GB) | UD-IQ2_XXS (97GB) |
|---|---|---|---|
| Math (GSM8K) | 8/10 (80%) | 6/10 (60%) | 2/10 (20%) |
| Reasoning (BBH) | 8/10 (80%) | 7/10 (70%) | 4/10 (40%) |
| Coding (HumanEval) | 9/10 (90%) | 8/10 (80%) | 7/10 (70%) |
| Agentic (SWE-bench) | 10/10 (100%) | 10/10 (100%) | 10/10 (100%) |
| Terminal-bench | 9/10 (90%) | 9/10 (90%) | 10/10 (100%) |
| Overall | 44/50 (88%) | 40/50 (80%) | 33/50 (66%) |
Fidelity to Q3_K_M: 91% (40/44). Math and reasoning are most affected by quantization.
Model Details
| Property | Value |
|---|---|
| Base model | zai-org/GLM-5 (744B, 256 routed experts) |
| Pruning | REAP saliency pruning, 50% expert removal (256 -> 128 experts) |
| Quantization | Dynamic IQ2_M with imatrix (2.72 BPW) |
| Size | ~121 GB |
| Architecture | GlmMoeDsaForCausalLM (MLA + MoE + DSA) |
| Context | 202,752 tokens |
| Active params | ~20B per token (8 of 128 experts) |
Dynamic Quantization Strategy
| Component | Quant Type | Rationale |
|---|---|---|
output.weight |
Q5_K | Critical for logit quality |
token_embd.weight |
Q4_K | Important for input representation |
| Dense FFN (first 3 layers) | Q5_K | No MoE; all traffic flows through |
| MLA attention projections | Q4_K | Coherence-critical |
MLA key projection (attn_k_b) |
Q5_K | Higher precision for keys |
DSA indexer (indexer.*) |
Q5_K | Critical for attention routing |
Shared experts (ffn_*_shexp) |
Q4_K-Q5_K | Always active |
| Last MoE layer (blk.77) | Q3_K | Final representation |
| Routed MoE experts (bulk) | IQ2_M | Main savings; imatrix-calibrated |
Usage
huggingface-cli download 0xSero/GLM-5-381B-GGUF-IQ2_M --local-dir ./model
./llama-server \
--model ./model/GLM-5-REAP-50pct-UD-IQ2_M.gguf \
--ctx-size 8192 \
--n-gpu-layers 99 \
--port 8080 \
--reasoning-budget 2048
Requires ~125 GB VRAM (model + KV cache at 8K context). Fits on 2x H100 80GB or 1x B200 192GB.
All Variants
| Variant | BPW | Size | Parse Rate | Repo |
|---|---|---|---|---|
| BF16 | 16.00 | 711 GB | N/A | BF16-GGUF |
| Q3_K_M | 3.82 | 170 GB | 88% | Q3_K_M-GGUF |
| UD-IQ2_M (this) | 2.72 | 121 GB | 80% | this repo |
| UD-IQ2_XXS | 2.19 | 97 GB | 66% | UD-IQ2_XXS-GGUF |
License & citation
License inherited from the base model.
@misc{lasby2025reap,
title = {REAP the Experts: Why Pruning Prevails for One-Shot MoE Compression},
author = {Mike Lasby and Ivan Lazarevich and Nish Sinnadurai and Sean Lie and Yani Ioannou and Vithursan Thangarasa},
year = {2025}, eprint = {2510.13999}, archivePrefix = {arXiv}
}
Sponsors
Made possible by NVIDIA · TNG Technology · Lambda · Prime Intellect · Hot Aisle.
- Downloads last month
- 140
2-bit
Model tree for 0xSero/GLM-5-381B-GGUF-IQ2_M
Base model
zai-org/GLM-5