Instructions to use SixVolts/GLM-5.2-ewaste-edition-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use SixVolts/GLM-5.2-ewaste-edition-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="SixVolts/GLM-5.2-ewaste-edition-GGUF", filename="GLM-5.2-Q2_K_XL-00001-of-00006.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 SixVolts/GLM-5.2-ewaste-edition-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 SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL # Run inference directly in the terminal: llama cli -hf SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL # Run inference directly in the terminal: llama cli -hf SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
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 SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL # Run inference directly in the terminal: ./llama-cli -hf SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
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 SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL # Run inference directly in the terminal: ./build/bin/llama-cli -hf SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
Use Docker
docker model run hf.co/SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
- LM Studio
- Jan
- vLLM
How to use SixVolts/GLM-5.2-ewaste-edition-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SixVolts/GLM-5.2-ewaste-edition-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": "SixVolts/GLM-5.2-ewaste-edition-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
- Ollama
How to use SixVolts/GLM-5.2-ewaste-edition-GGUF with Ollama:
ollama run hf.co/SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
- Unsloth Studio
How to use SixVolts/GLM-5.2-ewaste-edition-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 SixVolts/GLM-5.2-ewaste-edition-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 SixVolts/GLM-5.2-ewaste-edition-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SixVolts/GLM-5.2-ewaste-edition-GGUF to start chatting
- Pi
How to use SixVolts/GLM-5.2-ewaste-edition-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
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": "SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use SixVolts/GLM-5.2-ewaste-edition-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 SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
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 SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use SixVolts/GLM-5.2-ewaste-edition-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
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 "SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL" \ --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 SixVolts/GLM-5.2-ewaste-edition-GGUF with Docker Model Runner:
docker model run hf.co/SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
- Lemonade
How to use SixVolts/GLM-5.2-ewaste-edition-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SixVolts/GLM-5.2-ewaste-edition-GGUF:Q4_K_XL
Run and chat with the model
lemonade run user.GLM-5.2-ewaste-edition-GGUF-Q4_K_XL
List all available models
lemonade list
- GLM-5.2 โ "e-waste edition" GGUF
GLM-5.2 โ "e-waste edition" GGUF
Imatrix GGUF quantizations of GLM-5.2 (745B total / ~40B active, glm-dsa arch, DeepSeek-style
MoE with 256 routed + 1 shared expert, 8 active/token, MLA attention) tuned for MoE inference on
older / "e-waste" hardware โ pre-AVX-512 CPUs and previous-gen datacenter GPUs (MI100 / gfx908).
The guiding choice across every build (Q4_K / Q3_K / Q2_K) is K-quants for the routed experts,
not codebook i-quants (IQ2/IQ3): K-quant dequantization is dramatically faster on pre-AVX-512 CPUs and on
gfx908, where expert dequant โ not bandwidth โ is the decode bottleneck. An i-quant that looks
smaller on paper is slower to run on this class of hardware. (The experimental Q2_K_XL build keeps the
same principle โ experts stay Q2_K โ except for its 13 coldest, rarely-fired layers; see below.)
Available quantizations
| Variant | Size | Routed experts | Non-experts | Target |
|---|---|---|---|---|
GLM-5.2-Q4_K_XL |
403.8 GiB | Q4_K | Q8_0 | Highest quality; big-RAM CPU-expert boxes (โ512 GB). Too big for 10ร32 GB 0-spill |
GLM-5.2-Q3_K_XL |
312.9 GiB | Q3_K | Q8_0 | Max quality on GPU; experts spill to CPU on <11ร32GB |
GLM-5.2-Q3_K_M โญ recommended |
295.7 GiB | Q3_K + Q2_K (cold layers) | Q6_K | Fits 0-spill on 10ร32 GB (320 GB HBM) |
GLM-5.2-Q2_K_XL |
226.9 GiB | Q2_K + IQ2_XXS (13 coldest layers) | Q4_K | Fits 0-spill on 8ร32 GB (256 GB HBM); fastest decode, lowest quality |
All are imatrix-quantized. Q3_K_M is the recommended build: 17 GiB smaller than Q3_K_XL at
near-identical quality (+0.6% perplexity), exactly enough to keep the entire model resident across
ten 32 GB MI100s with zero CPU spill โ eliminating the expert-dequant decode bottleneck the whole
project exists to fight.
Q2_K_XL trades quality for a much smaller footprint: at 226.9 GiB it fits 0-spill across eight
32 GB cards (256 GB HBM) where Q3_K_M needs ten, and because it moves fewer bytes per token it
actually decodes faster than Q3_K_M (14.7 vs 13.2 tok/s, both 0-spill). It drops non-expert
infra to Q4_K, keeps experts as fast Q2_K k-quants (only the 13 imatrix-coldest layers go to
IQ2_XXS), 2.59 bpw. The trade is real quality loss โ see the perplexity table โ so it's for rigs
that are HBM-limited to eight cards, or that want maximum decode throughput and can tolerate Q2-level
quality. Run it with -sm layer (not -sm tensor).
GLM-5.2-Q4_K_XL โ composition
The simplest recipe in the set and the highest quality: every routed expert at Q4_K, everything
else at Q8_0. It's the direct one-tier-up sibling of Q3_K_XL (identical recipe, q3_Kโq4_K on the
experts, same wikitext imatrix), built for big-RAM CPU-expert inference โ a box with ~512 GB where the
routed experts live in system RAM and a single modest GPU (or none) handles the rest.
| Tensor group | Quant |
|---|---|
Routed experts (ffn_{gate,up,down}_exps), all MoE layers incl. blk.78 (MTP head) |
Q4_K |
MLA attention (q_a, q_b, kv_a_mqa, k_b, v_b, output) + indexer |
Q8_0 |
Shared expert (ffn_{gate,up,down}_shexp) โ fires every token |
Q8_0 |
token_embd, output, dense FFN (blk.0โ2) |
Q8_0 |
norms, router (ffn_gate_inp, exp_probs_b) |
F32 |
Total: 403.8 GiB, 4.60 bpw, 10 shards. imatrix-quantized (wikitext-2, 200 ร 512-tok) applied to the
experts โ the same importance matrix as Q3_K_XL. Keeping every non-expert tensor at Q8_0 (rather than
the Q6_K the GPU-fit builds use) spends bytes on quality, since a 512 GB host has the room. Fits a 512 GB
box with headroom for a long KV cache; too large for 10ร32 GB GPU 0-spill โ use Q3_K_M for that.
GLM-5.2-Q3_K_M โ composition
Built from the unsloth BF16 of GLM-5.2 (unsloth/GLM-5.2-GGUF)
using unsloth's importance matrix (see imatrix note below). Base ftype Q3_K_M, with explicit
per-tensor overrides:
| Tensor group | Quant | Notes |
|---|---|---|
| Routed experts, blk.35โ77 (43 hottest MoE layers) | Q3_K | Q3_K_M base; some late-layer ffn_down_exps auto-promoted to Q4_K |
| Routed experts, blk.3โ34 (32 coldest MoE layers) | Q2_K | the cold cut โ see below |
| Routed experts, blk.78 (MTP / nextn head) | Q2_K | head is unused in normal decode |
Attention (q_a, q_b, kv_a_mqa, v_b, output) |
Q6_K | down from Q8_0 |
Shared expert (ffn_{gate,up,down}_shexp) |
Q6_K | fires every token |
token_embd, output |
Q6_K | |
attn_k_b |
Q4_0 | ncols=192 not divisible by 256 โ automatic fallback (harmless) |
Total: 295.71 GiB, 3.37 bpw, 8 shards.
Which layers were dropped to Q2_K, and why
Only the routed experts of the 32 coldest MoE layers (blk.3โblk.34) were dropped to Q2_K
(plus the unused blk.78 MTP head). Blocks 0โ2 are dense (no routed experts); blocks 35โ77 โ the
hottest 43 MoE layers โ stay at full Q3_K.
"Cold" is measured directly from unsloth's imatrix in_sum2 (the sum of squared activations
per input channel โ an importance signal). The mean ffn_down_exps importance is monotonic in
depth and spans ~6 orders of magnitude:
blk.3 โ 0.003 โ coldest
blk.20 โ 2.3
blk.34 โ 75
blk.39 โ 140
blk.77 โ 16022 โ hottest
The coldest 32 layers all sit below importance โ 75; the hot tail kept at Q3_K runs 88 โ 16,022. Because the early layers carry 100โ1000ร less activation energy than the late ones, dropping their experts to 2-bit costs almost nothing in quality (measured below) while reclaiming the ~17 GiB needed to fit ten cards. The MoE granularity constraint (one quant type per expert tensor โ all 256 experts of a layer share it) means the cut is per-(layer, projection); the imatrix already protects the most-used experts within each tensor.
GLM-5.2-Q2_K_XL โ composition
Same BF16 source and unsloth imatrix. Built to cross under the 256 GB (8 ร 32 GB) HBM budget at 0-spill, so every byte was cut to the floor that still runs as fast K-quants on gfx908:
| Tensor group | Quant | Notes |
|---|---|---|
| Routed experts, all MoE layers except the cold cut | Q2_K | 2-bit k-quant โ still fast to dequant, unlike i-quants |
Routed experts, 13 imatrix-coldest layers (blk.3,4,5,6,7,9โ16) |
IQ2_XXS | the only i-quant tier; these layers carry ~100โ1000ร less activation energy |
| Routed experts, blk.78 (MTP / nextn head) | IQ2_XXS | unused in normal decode |
Attention (q_a, q_b, kv_a_mqa, v_b, output) + indexer |
Q4_K | down from Q6_K |
Shared expert (ffn_{gate,up,down}_shexp) |
Q4_K | fires every token |
token_embd, output |
Q4_K | |
attn_k_b |
Q4_0 | ncols=192 not divisible by 256 โ automatic fallback (harmless) |
Total: 226.9 GiB, 2.59 bpw, 6 shards. The IQ2_XXS layers are the one place this build breaks the "K-quants only" rule โ but only on the 13 coldest layers, where the dequant cost is paid rarely and the 2.06-bpw saving is what lets the model clear the 8-card budget.
Quality (perplexity)
wikitext-2, 100 chunks @ 512 ctx, -fa on -ctk q8_0 -ctv q8_0, identical settings for all three:
| Quant | Size | bpw | PPL โ | vs this quant |
|---|---|---|---|---|
GLM-5.2-Q4_K_XL |
403.8 GiB | 4.60 / Q8 | 2.6733 | best quality (โ5.7% vs Q3_K_M, +108 GiB) |
GLM-5.2-Q3_K_XL |
312.9 GiB | ~3.4 / Q8 | 2.8176 | โ0.6% (reference, +17 GiB) |
GLM-5.2-Q3_K_M |
295.7 GiB | 3.37 | 2.8348 | โ |
unsloth UD-IQ3_XXS |
262.3 GiB | ~3.06 | 3.2635 | +15% (โ33 GiB, i-quant) |
GLM-5.2-Q2_K_XL |
226.9 GiB | 2.59 | 3.6129 | +27% (โ69 GiB) |
Q4_K_XLis the quality ceiling of the family: at 2.6733 it sits 0.14 belowQ3_K_XL(โ5% perplexity) โ the payoff for taking the routed experts Q3_K โ Q4_K. It costs +91 GiB overQ3_K_XLand won't fit ten 32 GB cards 0-spill; it's for big-RAM CPU-expert hosts (โ512 GB) that want the best quality this set offers.- vs the full-quality Q3_K_XL: +0.6% perplexity for โ17 GiB โ near-free, and the 17 GiB is what enables 0-spill on 10 cards.
- vs unsloth's similarly-positioned UD-IQ3_XXS: this quant is 13% lower perplexity while also being a K-quant (far faster to dequant on gfx908). It spends 33 GiB more to get there โ a deliberate trade for this hardware class.
Q2_K_XLis the quality floor: +27% perplexity vsQ3_K_M(and ~+11% vsUD-IQ3_XXS, which it undercuts by 35 GiB and in dequant speed). It exists to buy the 8-card 0-spill fit and the fastest decode โ pick it only when those matter more than quality. For best quality-per-byte, useQ3_K_M.
(Full 200-chunk perplexity for Q3_K_M = 3.1408 ยฑ 0.029; the 100-chunk figures above are the
matched cross-quant comparison. Q4_K_XL = 2.6733 ยฑ 0.033 over 100 chunks.)
Performance โ 10 ร MI100 (gfx908), 0-spill
-sm layer -fit on -fa on -ctk q8_0 -ctv q8_0 -c 8192, all 295.7 GiB resident on GPU (298.9 GiB total
VRAM incl. KV + compute; zero CPU expert spill):
Q3_K_M (this) |
|
|---|---|
| Decode | 13.2 tok/s |
| Prefill (3.5k-token prompt) | 101 tok/s default โ 147 tok/s at -ub 2048 |
| CPU expert spill | 0 |
For contrast, Q3_K_XL at 312.9 GiB does not fit the same ten cards โ it spills ~12 GiB of
experts back to CPU, and that spilled expert dequant is the decode bottleneck. The whole point of
Q3_K_M is to cross under the HBM budget so nothing spills.
-ub 2048is a free +45% on prefill here purely because the 0-spill fit leaves ~20 GiB of VRAM headroom to spend on a bigger compute batch.
GLM-5.2-Q2_K_XL โ 8 ร MI100 (gfx908), 0-spill
-sm layer -fit on -fa on -ctk q8_0 -ctv q8_0, all 226.9 GiB resident across eight 32 GB cards
(zero CPU spill):
Q2_K_XL |
|
|---|---|
| Decode | 14.7 tok/s โ faster than Q3_K_M's 13.2 (fewer bytes/token) |
Decode + ngram-simple |
up to 21.9 tok/s on repetitive / templated output (accept 1.0) |
| CPU expert spill | 0 |
Q2_K_XL is the throughput pick: it fits fewer cards (8 vs 10) and decodes faster, paying for it
in quality (perplexity table above).
Speculative decoding โ use ngram-simple, not ngram-cache
Model-free n-gram self-speculation, measured on the 0-spill 10รMI100 setup (decode tok/s):
--spec-type |
prose | structured code | verbatim repeat |
|---|---|---|---|
| (none) | 13.1 | 13.0 | 13.1 |
ngram-simple โ
|
13.1 | 15.9 (+22%) | 16.6 (+27%) |
ngram-cache |
8.8 (โ33%) | 10.3 (โ21%) | 17.9 (+37%) |
Use ngram-simple โ it is safe to leave on. It only drafts on a high-confidence n-gram match
(accept rate โ 1.0 when it fires), so it abstains on unpredictable prose with zero overhead and
speeds up structured / repetitive output. Draft depth (--spec-draft-n-max) barely matters here โ
accept is already ~1.0, so 1โ4 are within noise.
Tuning repetition coverage โ --spec-ngram-simple-size-n (default 12). The default only fires on
a confident 12-token match, so it catches tight repetition (it abstains on looser patterns). Lower
it to fire more aggressively, at the risk of mis-drafting semi-structured text. Measured on Q2_K_XL
(decode tok/s):
size_n |
prose | log-line / templated repeat | free-form code |
|---|---|---|---|
| 12 (default, safe) | 14.7 (abstain) | 14.5 (abstain) | 14.6 (abstain) |
| 8 (moderate) | 14.6 (abstain) | 19.7 (+36%) | 12.6 (โ14%) |
| 6 (aggressive) | 14.7 (abstain) | 20.2 (+37%) | 7.1 (โ51%) |
Prose stays neutral at every setting. Keep 12 for mixed / code-heavy serving; drop to 8 for
agentic / log / templated workloads. size_n=6 over-drafts repeating code structure (def get_X
with varying field names โ 3% accept) and is only worth it on known highly-repetitive output.
Avoid ngram-cache for general serving: it drafts aggressively on weak matches (accept ~0.13 prose /
~0.37 code), and on this MoE every rejected draft still routes its 8 experts through the verify batch,
so the wasted expert-GEMM costs more than it saves except on near-verbatim echo. Why spec is
expensive on MoE at all: the verify batch routes every drafted position to its own experts, so
wasted drafts cost real GPU compute โ speculation here is gated by accept rate, not by spill.
Usage
# Q4_K_XL โ big-RAM CPU-expert box (โ512 GB). Routed experts stay in system RAM;
# attention + KV + shared expert go on one modest GPU. Loads the 10-shard set from the first shard.
llama-server -m GLM-5.2-Q4_K_XL-00001-of-00010.gguf \
-ngl 999 -ot 'ffn_.*_exps=CPU' -fa on -ctk q8_0 -ctv q8_0 -c 16384
# no GPU? use -ngl 0 for all-CPU. On dual-socket hosts prefix with `numactl --interleave=all`.
# Q3_K_M โ llama.cpp (mainline). Loads the 8-shard set from the first shard.
llama-server -m GLM-5.2-Q3_K_M-00001-of-00008.gguf \
-sm layer -fit on -fa on -ctk q8_0 -ctv q8_0 -c 8192 -ub 2048 \
--spec-type ngram-simple # safe always-on; +20-27% on structured/repetitive, 0 on prose
# Q2_K_XL โ fits 0-spill on eight 32 GB cards. Loads the 6-shard set from the first shard.
HIP_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
llama-server -m GLM-5.2-Q2_K_XL-00001-of-00006.gguf \
-sm layer -fit on -fa on -ctk q8_0 -ctv q8_0 -c 8192 \
--spec-type ngram-simple # for log/templated workloads add: --spec-ngram-simple-size-n 8
Q3_K_M needs ~296 GiB of combined HBM for 0-spill (e.g. 10 ร 32 GB); Q2_K_XL needs ~228 GiB (e.g.
8 ร 32 GB). With less, -fit auto-spills the coldest experts to CPU and it still runs โ just slower
on the spilled layers. Use -sm layer (not -sm tensor) for both.
Credits / provenance
- Base model: GLM-5.2 by zai-org.
- Source weights (BF16) and the importance matrix used for this quant are from unsloth/GLM-5.2-GGUF โ the imatrix is not redistributed here; grab it from unsloth's repo if you want to reproduce. Thanks to the unsloth team for the calibration data.
- Quantized with llama.cpp
llama-quantize(--imatrix+--tensor-type-file). - Provenance differs by build:
Q3_K_M/Q2_K_XLuse the unsloth BF16 + unsloth imatrix above. The_XLbuilds (Q3_K_XL,Q4_K_XL) instead use a wikitext-2 imatrix and a plainconvert_hf_to_gguf.py โ Q8_0intermediate, with base typeQ8_0and experts overridden via--custom-q 'ffn_.*_exps=q{3,4}_K'โ i.e. everything Q8_0 except the routed experts.
- Downloads last month
- 3,410
2-bit
3-bit
4-bit
Model tree for SixVolts/GLM-5.2-ewaste-edition-GGUF
Base model
zai-org/GLM-5.2