Instructions to use icecubetr/GLM-5.2-504B-Code-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use icecubetr/GLM-5.2-504B-Code-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="icecubetr/GLM-5.2-504B-Code-GGUF", filename="GLM-5.2-504B-Code-IQ2_XXS.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use icecubetr/GLM-5.2-504B-Code-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 icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS # Run inference directly in the terminal: llama cli -hf icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS # Run inference directly in the terminal: llama cli -hf icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
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 icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS # Run inference directly in the terminal: ./llama-cli -hf icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
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 icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS # Run inference directly in the terminal: ./build/bin/llama-cli -hf icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
Use Docker
docker model run hf.co/icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
- LM Studio
- Jan
- vLLM
How to use icecubetr/GLM-5.2-504B-Code-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "icecubetr/GLM-5.2-504B-Code-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "icecubetr/GLM-5.2-504B-Code-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
- Ollama
How to use icecubetr/GLM-5.2-504B-Code-GGUF with Ollama:
ollama run hf.co/icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
- Unsloth Studio
How to use icecubetr/GLM-5.2-504B-Code-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for icecubetr/GLM-5.2-504B-Code-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for icecubetr/GLM-5.2-504B-Code-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for icecubetr/GLM-5.2-504B-Code-GGUF to start chatting
- Pi
How to use icecubetr/GLM-5.2-504B-Code-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use icecubetr/GLM-5.2-504B-Code-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 icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
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 icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use icecubetr/GLM-5.2-504B-Code-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
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 "icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS" \ --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"
- Docker Model Runner
How to use icecubetr/GLM-5.2-504B-Code-GGUF with Docker Model Runner:
docker model run hf.co/icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
- Lemonade
How to use icecubetr/GLM-5.2-504B-Code-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull icecubetr/GLM-5.2-504B-Code-GGUF:IQ2_XXS
Run and chat with the model
lemonade run user.GLM-5.2-504B-Code-GGUF-IQ2_XXS
List all available models
lemonade list
Model Description
This is a quantized version of the GLM-5.2-REAP-504B-GGUF model using llama.cpp's IQ2_XXS quantization (2-bit). The model has been converted from BF16 to GGUF format with importance matrix optimization.
Provided Quants
| file | bits | size | notes |
|---|---|---|---|
GLM-5.2-504B-Code-IQ2_XXS |
2.29 | ~140 GB | smallest |
Other Files
| file | notes |
|---|---|
GLM-5.2-REAP-504B-imatrix |
imatrix file created with code.txt dataset, saved after 80/146 chunks of calibration data |
llama-quant.cpp |
modified llama.cpp file for leaving indexer tensors unquantized |
Run it
llama-cli -m GLM-5.2-504B-Code-IQ2_XXS.gguf -p "Hello"
llama-server -m GLM-5.2-504B-Code-IQ2_XXS.gguf --host 0.0.0.0 --port 8080
Recommended serving โ recover most of the loop gap for free
Anti-loop (recommended):
min_p=0.05, repetition_penalty=1.05min_p=0.05, repetition_penalty=1.10
Start at
1.05; go to1.10if you see loops โ a higher repetition penalty trades a little risk of over-penalizing legitimate repetition (e.g. in code) for near-zero looping.Conciseness: a brevity system prompt โ "Be concise. Think only as much as the task needs, then answer and stop." โ halves median length (1267 โ 507 tokens). Note it does not reduce looping (that's the sampler's job); combine the two for short, low-loop output.
Quantization Details
This model has been quantized using llama.cpp's llama-quantize tool with importance matrix (--imatrix) for optimal quantization. The quantization target was IQ2_XXS (2-bit quantization).
Quantization Summary
| Metric | Value |
|---|---|
| Original Model Size (BF16) | 956,419.32 MiB (16.00 BPW) |
| Quantized Model Size | 136,813.06 MiB (2.29 BPW) |
| Compression Ratio | ~7:1 |
| Total Tensors | 1809 |
| Tensors with Fallback | 79 |
Tensor Type to Quantization Method Mapping
| Tensor Pattern | Quantization Method | Original Format | Notes |
|---|---|---|---|
*attn_k_b.weight |
iq4_nl |
bf16 | Fallback from IQ2_XXS (ncols=192 not divisible by 256) |
*attn_kv_a_mqa.weight |
iq2_xxs |
bf16 | |
*attn_output.weight |
iq2_xxs |
bf16 | |
*attn_q_a.weight |
iq2_xxs |
bf16 | |
*attn_q_b.weight |
iq2_xxs |
bf16 | |
*attn_v_b.weight |
iq2_xxs |
bf16 | |
*ffn_down_exps.weight |
iq2_xxs |
bf16 | |
*ffn_down_shexp.weight |
iq2_xxs |
bf16 | |
*ffn_gate_exps.weight |
iq2_xxs |
bf16 | |
*ffn_gate_shexp.weight |
iq2_xxs |
bf16 | |
*ffn_up_exps.weight |
iq2_xxs |
bf16 | |
*ffn_up_shexp.weight |
iq2_xxs |
bf16 | |
blk.0.ffn_down.weight |
q2_K |
bf16 | Dense layers (blocks 0-2) |
blk.1.ffn_down.weight |
q2_K |
bf16 | Dense layers (blocks 0-2) |
blk.2.ffn_down.weight |
q2_K |
bf16 | Dense layers (blocks 0-2) |
output.weight |
q5_K |
bf16 | Output projection |
token_embd.weight |
q2_K |
bf16 | Token embeddings |
Tensors Kept in Original Format (Not Quantized)
f32 (Float 32-bit) - Kept for Numerical Stability
- All
*_norm.weightand*_norm.biastensors - All
*_gate_inp.weighttensors (e.g.,ffn_gate_inp.weight) - All
exp_probs_b.biastensors blk.78.nextn.enorm.weightblk.78.nextn.hnorm.weightblk.78.nextn.shared_head_norm.weight
bf16 (bfloat16) - Not Quantized (Missing Importance Matrix Data)
- All
indexer.attn_k.weighttensors - All
indexer.attn_q_b.weighttensors - All
indexer.proj.weighttensors blk.78.attn_kv_a_mqa.weightblk.78.attn_output.weightblk.78.attn_q_a.weightblk.78.attn_q_b.weightblk.78.attn_v_b.weightblk.78.ffn_down_exps.weightblk.78.ffn_down_shexp.weightblk.78.ffn_gate_exps.weightblk.78.ffn_gate_shexp.weightblk.78.ffn_up_exps.weightblk.78.ffn_up_shexp.weightblk.78.nextn.eh_proj.weight
Quantization Method Details
| Method | Bits | Description |
|---|---|---|
| IQ2_XXS | ~2 | Extremely low-bit quantization with importance matrix optimization |
| IQ4_NL | ~4 | Non-linear 4-bit quantization with higher quality |
| Q2_K | ~2 | K-quant 2-bit quantization for dense layers |
| Q5_K | ~5 | K-quant 5-bit quantization (used for output layer) |
Important Notes
Fallback Quantization: 79 tensors required fallback quantization because:
attn_k_b.weighttensors have ncols=192 (not divisible by 256, required for IQ2_XXS), falling back to IQ4_NL- Other tensors missing importance matrix data
Indexer Tensors: All
indexer.*tensors were kept in BF16 format as they are critical for the model's routing/indexing mechanism and no importance data was available.Final Layer:
blk.78(the final transformer block) was largely left unquantized to preserve output quality, as importance data was missing for these tensors.Dense Layers: The first three blocks (
blk.0toblk.2) use dense FFN layers instead of MoE, which were quantized with Q2_K.Importance Matrix: Quantization used an importance matrix from 80 chunks of calibration data, optimizing which tensors receive more bits based on their importance to model performance.
- Downloads last month
- -
2-bit
Model tree for icecubetr/GLM-5.2-504B-Code-GGUF
Base model
zai-org/GLM-5.2