Views
No views yet
ik_llama.cpp imatrix Quantizations of zai-org/GLM-4.5ik_llama.cpp can also run your existing GGUFs from bartowski, unsloth, mradermacher, etc if you want to try it out before downloading my quants.Cor(ln(PPL(Q)), ln(PPL(base))) metric:| Quant | Cor(ln(PPL(Q)), ln(PPL(base))) |
|---|---|
| BF16 | Baseline |
| Q8_0 | 99.90% |
| IQ5_K | 99.85% |
| IQ4_K | 99.78% |
| IQ4_KSS | 99.59% |
| IQ3_KT | 99.33% |
| IQ2_KL | 98.87% |
| IQ2_KS | 98.11% |
| IQ1_KT | 96.52% |

BF16 667.598 GiB (16.003 BPW)
Q8_0 354.794 GiB (8.505 BPW)
1#/usr/bin/env bash
2
3custom="
4# 93 Repeating Layers [0-92]
5
6# Attention
7blk\..*\.attn_q.*=q8_0
8blk\..*\.attn_k.*=q8_0
9blk\..*\.attn_v.*=q8_0
10blk\..*\.attn_output.*=q8_0
11
12# First 3 Dense Layers [0-2]
13blk\..*\.ffn_down\.weight=q8_0
14blk\..*\.ffn_(gate|up)\.weight=q8_0
15
16# Shared Expert Layers [3-92]
17blk\..*\.ffn_down_shexp\.weight=q8_0
18blk\..*\.ffn_(gate|up)_shexp\.weight=q8_0
19
20# Routed Experts Layers [3-92]
21blk\..*\.ffn_down_exps\.weight=iq6_k
22blk\..*\.ffn_(gate|up)_exps\.weight=iq5_k
23
24# NextN MTP Layer [92]
25blk\..*\.nextn\.embed_tokens\.weight=iq6_k
26blk\..*\.nextn\.shared_head_head\.weight=iq6_k
27blk\..*\.nextn\.eh_proj\.weight=q8_0
28
29# Non-Repeating Layers
30token_embd\.weight=iq6_k
31output\.weight=iq6_k
32"
33
34custom=$(
35 echo "$custom" | grep -v '^#' | \
36 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
37)
38
39numactl -N 0 -m 0 \
40./build/bin/llama-quantize \
41 --custom-q "$custom" \
42 --imatrix /mnt/raid/models/ubergarm/GLM-4.5-GGUF/imatrix-GLM-4.5-BF16.dat \
43 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-160x21B-4.5-BF16-00001-of-00015.gguf \
44 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-4.5-IQ5_K.gguf \
45 IQ5_K \
46 1921#/usr/bin/env bash
2custom="
3# 93 Repeating Layers [0-92]
4
5# Attention
6blk\..*\.attn_q.*=iq6_k
7blk\..*\.attn_k.*=q8_0
8blk\..*\.attn_v.*=q8_0
9blk\..*\.attn_output.*=iq6_k
10
11# First 3 Dense Layers [0-2]
12blk\..*\.ffn_down\.weight=q8_0
13blk\..*\.ffn_(gate|up)\.weight=iq6_k
14
15# Shared Expert Layers [3-92]
16blk\..*\.ffn_down_shexp\.weight=q8_0
17blk\..*\.ffn_(gate|up)_shexp\.weight=iq6_k
18
19# Routed Experts Layers [3-92]
20blk\..*\.ffn_down_exps\.weight=iq5_k
21blk\..*\.ffn_(gate|up)_exps\.weight=iq4_k
22
23# NextN MTP Layer [92]
24blk\..*\.nextn\.embed_tokens\.weight=iq5_k
25blk\..*\.nextn\.shared_head_head\.weight=iq5_k
26blk\..*\.nextn\.eh_proj\.weight=q8_0
27
28# Non-Repeating Layers
29token_embd\.weight=iq4_k
30output\.weight=iq6_k
31"
32
33custom=$(
34 echo "$custom" | grep -v '^#' | \
35 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
36)
37
38numactl -N 0 -m 0 \
39./build/bin/llama-quantize \
40 --custom-q "$custom" \
41 --imatrix /mnt/raid/models/ubergarm/GLM-4.5-GGUF/imatrix-GLM-4.5-BF16.dat \
42 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-160x21B-4.5-BF16-00001-of-00015.gguf \
43 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-4.5-IQ4_K.gguf \
44 IQ4_K \
45 1921#/usr/bin/env bash
2
3custom="
4# 93 Repeating Layers [0-92]
5
6# Attention
7blk\.(0|1|2)\.attn_q.*=q8_0
8blk\.(0|1|2)\.attn_k.*=q8_0
9blk\.(0|1|2)\.attn_v.*=q8_0
10blk\.(0|1|2)\.attn_output.*=q8_0
11
12blk\..*\.attn_q.*=iq5_ks
13blk\..*\.attn_k.*=iq6_k
14blk\..*\.attn_v.*=iq6_k
15blk\..*\.attn_output.*=iq5_ks
16
17# First 3 Dense Layers [0-2]
18blk\..*\.ffn_down\.weight=iq5_ks
19blk\..*\.ffn_(gate|up)\.weight=iq4_ks
20
21# Shared Expert Layers [3-92]
22blk\..*\.ffn_down_shexp\.weight=iq5_ks
23blk\..*\.ffn_(gate|up)_shexp\.weight=iq4_ks
24
25# Routed Experts Layers [3-92]
26blk\..*\.ffn_down_exps\.weight=iq4_ks
27blk\..*\.ffn_(gate|up)_exps\.weight=iq4_kss
28
29# NextN MTP Layer [92]
30blk\..*\.nextn\.embed_tokens\.weight=iq5_ks
31blk\..*\.nextn\.shared_head_head\.weight=iq5_ks
32blk\..*\.nextn\.eh_proj\.weight=q8_0
33
34# Non-Repeating Layers
35token_embd\.weight=iq4_k
36output\.weight=iq6_k
37"
38
39custom=$(
40 echo "$custom" | grep -v '^#' | \
41 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
42)
43
44numactl -N 1 -m 1 \
45./build/bin/llama-quantize \
46 --custom-q "$custom" \
47 --imatrix /mnt/raid/models/ubergarm/GLM-4.5-GGUF/imatrix-GLM-4.5-BF16.dat \
48 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-160x21B-4.5-BF16-00001-of-00015.gguf \
49 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-4.5-IQ4_KSS.gguf \
50 IQ4_KSS \
51 1921#!/usr/bin/env bash
2
3custom="
4# 93 Repeating Layers [0-92]
5
6# Attention
7blk\.(0|1|2)\.attn_q.*=q8_0
8blk\.(0|1|2)\.attn_k.*=q8_0
9blk\.(0|1|2)\.attn_v.*=q8_0
10blk\.(0|1|2)\.attn_output.*=q8_0
11
12blk\..*\.attn_q.*=iq5_ks
13blk\..*\.attn_k.*=q8_0
14blk\..*\.attn_v.*=q8_0
15blk\..*\.attn_output.*=iq5_ks
16
17# First 3 Dense Layers [0-2]
18blk\..*\.ffn_down\.weight=iq5_ks
19blk\..*\.ffn_(gate|up)\.weight=iq4_ks
20
21# Shared Expert Layers [3-92]
22blk\..*\.ffn_down_shexp\.weight=iq5_ks
23blk\..*\.ffn_(gate|up)_shexp\.weight=iq4_ks
24
25# Routed Experts Layers [3-92]
26blk\..*\.ffn_down_exps\.weight=iq4_kss
27blk\..*\.ffn_(gate|up)_exps\.weight=iq3_kt
28
29# NextN MTP Layer [92]
30blk\..*\.nextn\.embed_tokens\.weight=iq5_ks
31blk\..*\.nextn\.shared_head_head\.weight=iq5_ks
32blk\..*\.nextn\.eh_proj\.weight=q8_0
33
34# Non-Repeating Layers
35token_embd\.weight=iq4_k
36output\.weight=iq6_k
37"
38
39custom=$(
40 echo "$custom" | grep -v '^#' | \
41 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
42)
43
44numactl -N 1 -m 1 \
45./build/bin/llama-quantize \
46 --custom-q "$custom" \
47 --imatrix /mnt/raid/models/ubergarm/GLM-4.5-GGUF/imatrix-GLM-4.5-BF16.dat \
48 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-160x21B-4.5-BF16-00001-of-00015.gguf \
49 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-4.5-IQ3_KT.gguf \
50 IQ3_KT \
51 1921#/usr/bin/env bash
2
3custom="
4# 93 Repeating Layers [0-92]
5
6# Attention
7blk\..*\.attn_q.*=iq5_ks
8blk\..*\.attn_k.*=iq5_ks
9blk\..*\.attn_v.*=iq5_ks
10blk\..*\.attn_output.*=iq5_ks
11
12# First 3 Dense Layers [0-2]
13blk\..*\.ffn_down\.weight=iq5_ks
14blk\..*\.ffn_(gate|up)\.weight=iq4_ks
15
16# Shared Expert Layers [3-92]
17blk\..*\.ffn_down_shexp\.weight=iq5_ks
18blk\..*\.ffn_(gate|up)_shexp\.weight=iq4_ks
19
20# Routed Experts Layers [3-92]
21blk\..*\.ffn_down_exps\.weight=iq3_k
22blk\..*\.ffn_(gate|up)_exps\.weight=iq2_kl
23
24# NextN MTP Layer [92]
25blk\..*\.nextn\.embed_tokens\.weight=iq5_ks
26blk\..*\.nextn\.shared_head_head\.weight=iq5_ks
27blk\..*\.nextn\.eh_proj\.weight=q8_0
28
29# Non-Repeating Layers
30token_embd\.weight=iq4_k
31output\.weight=iq6_k
32"
33
34custom=$(
35 echo "$custom" | grep -v '^#' | \
36 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
37)
38
39numactl -N 1 -m 1 \
40./build/bin/llama-quantize \
41 --custom-q "$custom" \
42 --imatrix /mnt/raid/models/ubergarm/GLM-4.5-GGUF/imatrix-GLM-4.5-BF16.dat \
43 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-160x21B-4.5-BF16-00001-of-00015.gguf \
44 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-4.5-IQ2_KL.gguf \
45 IQ2_KL \
46 1921custom="
2#/usr/bin/env bash
3
4# 93 Repeating Layers [0-92]
5
6# Attention
7blk\..*\.attn_q.*=iq5_ks
8blk\..*\.attn_k.*=iq5_ks
9blk\..*\.attn_v.*=iq5_ks
10blk\..*\.attn_output.*=iq5_ks
11
12# First 3 Dense Layers [0-2]
13blk\..*\.ffn_down\.weight=iq5_ks
14blk\..*\.ffn_(gate|up)\.weight=iq4_ks
15
16# Shared Expert Layers [3-92]
17blk\..*\.ffn_down_shexp\.weight=iq5_ks
18blk\..*\.ffn_(gate|up)_shexp\.weight=iq4_ks
19
20# Routed Experts Layers [3-92]
21blk\..*\.ffn_down_exps\.weight=iq3_ks
22blk\..*\.ffn_(gate|up)_exps\.weight=iq2_ks
23
24# NextN MTP Layer [92]
25blk\..*\.nextn\.embed_tokens\.weight=iq5_ks
26blk\..*\.nextn\.shared_head_head\.weight=iq5_ks
27blk\..*\.nextn\.eh_proj\.weight=q8_0
28
29# Non-Repeating Layers
30token_embd\.weight=iq4_k
31output\.weight=iq6_k
32"
33
34custom=$(
35 echo "$custom" | grep -v '^#' | \
36 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
37)
38
39numactl -N 1 -m 1 \
40./build/bin/llama-quantize \
41 --custom-q "$custom" \
42 --imatrix /mnt/raid/models/ubergarm/GLM-4.5-GGUF/imatrix-GLM-4.5-BF16.dat \
43 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-160x21B-4.5-BF16-00001-of-00015.gguf \
44 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-4.5-IQ2_KS.gguf \
45 IQ2_KS \
46 1921#/usr/bin/env bash
2
3custom="
4# 93 Repeating Layers [0-92]
5
6# Attention
7blk\..*\.attn_q.*=iq4_kt
8blk\..*\.attn_k.*=iq4_kt
9blk\..*\.attn_v.*=iq4_kt
10blk\..*\.attn_output.*=iq4_kt
11
12# First 3 Dense Layers [0-2]
13blk\..*\.ffn_down\.weight=iq4_kt
14blk\..*\.ffn_(gate|up)\.weight=iq4_kt
15
16# Shared Expert Layers [3-92]
17blk\..*\.ffn_down_shexp\.weight=iq4_kt
18blk\..*\.ffn_(gate|up)_shexp\.weight=iq4_kt
19
20# Routed Experts Layers [3-92]
21blk\..*\.ffn_down_exps\.weight=iq2_kt
22blk\..*\.ffn_(gate|up)_exps\.weight=iq1_kt
23
24# NextN MTP Layer [92]
25blk\..*\.nextn\.embed_tokens\.weight=iq4_kt
26blk\..*\.nextn\.shared_head_head\.weight=iq4_kt
27blk\..*\.nextn\.eh_proj\.weight=q8_0
28
29# Non-Repeating Layers
30token_embd\.weight=iq4_k
31output\.weight=iq6_k
32"
33
34custom=$(
35 echo "$custom" | grep -v '^#' | \
36 sed -Ez 's:\n+:,:g;s:,$::;s:^,::'
37)
38
39numactl -N 0 -m 0 \
40./build/bin/llama-quantize \
41 --custom-q "$custom" \
42 --imatrix /mnt/raid/models/ubergarm/GLM-4.5-GGUF/imatrix-GLM-4.5-BF16.dat \
43 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-160x21B-4.5-BF16-00001-of-00015.gguf \
44 /mnt/raid/models/ubergarm/GLM-4.5-GGUF/GLM-4.5-IQ1_KT.gguf \
45 IQ1_KT \
46 192/nothink (correct, no underscore) at the end of your prompt.1# Clone and checkout
2$ git clone https://github.com/ikawrakow/ik_llama.cpp
3$ cd ik_llama.cpp
4
5# Build for hybrid CPU+CUDA
6$ cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DGGML_BLAS=OFF -DGGML_SCHED_MAX_COPIES=1
7$ cmake --build build --config Release -j $(nproc)
8
9# Run API server
10$ ./build/bin/llama-server \
11 --model GLM-4.5-IQ4_KSS-00001-of-00004.gguf \
12 --alias ubergarm/GLM-4.5-IQ4_KSS \
13 --ctx-size 32768 \
14 -fa -fmoe \
15 -ctk q8_0 -ctv q8_0 \
16 -ub 4096 -b 4096 \
17 -ngl 99 \
18 -ot exps=CPU \
19 --parallel 1 \
20 --threads 8 \
21 --host 127.0.0.1 \
22 --port 8080 \
23 --no-mmap