Views
No views yet
ik_llama.cpp imatrix Quantizations of zai-org/GLM-4.6ik_llama.cpp can also run your existing GGUFs from bartowski, unsloth, mradermacher, etc if you want to try it out before downloading my quants.
BF16 664.707 GiB (16.003 BPW)
Q8_0 353.259 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/data/models/ubergarm/GLM-4.6-GGUF/imatrix-GLM-4.6-BF16.dat \
43 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-160x19B-4.6-BF16-00001-of-00015.gguf \
44 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-4.6-IQ5_K.gguf \
45 IQ5_K \
46 1921#!/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=iq5_k
22blk\..*\.ffn_(gate|up)_exps\.weight=iq4_k
23
24# NextN MTP Layer [92]
25blk\..*\.nextn\.embed_tokens\.weight=iq5_k
26blk\..*\.nextn\.shared_head_head\.weight=iq5_k
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/data/models/ubergarm/GLM-4.6-GGUF/imatrix-GLM-4.6-BF16.dat \
43 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-160x19B-4.6-BF16-00001-of-00015.gguf \
44 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-4.6-IQ4_K.gguf \
45 IQ4_K \
46 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=iq5_ks
20
21# Shared Expert Layers [3-92]
22blk\..*\.ffn_down_shexp\.weight=iq5_ks
23blk\..*\.ffn_(gate|up)_shexp\.weight=iq5_ks
24
25# Routed Experts Layers [3-92]
26blk\..*\.ffn_down_exps\.weight=iq5_ks
27blk\..*\.ffn_(gate|up)_exps\.weight=iq4_ks
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 0 -m 0 \
45./build/bin/llama-quantize \
46 --custom-q "$custom" \
47 --imatrix /mnt/data/models/ubergarm/GLM-4.6-GGUF/imatrix-GLM-4.6-BF16.dat \
48 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-160x19B-4.6-BF16-00001-of-00015.gguf \
49 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-4.6-IQ4_KS.gguf \
50 IQ4_KS \
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=iq5_ks
20
21# Shared Expert Layers [3-92]
22blk\..*\.ffn_down_shexp\.weight=iq5_ks
23blk\..*\.ffn_(gate|up)_shexp\.weight=iq5_ks
24
25# Routed Experts Layers [3-92]
26blk\..*\.ffn_down_exps\.weight=iq4_kss
27blk\..*\.ffn_(gate|up)_exps\.weight=iq4_kss
28
29# NextN MTP Layer [92]
30blk\..*\.nextn\.embed_tokens\.weight=iq4_kss
31blk\..*\.nextn\.shared_head_head\.weight=iq4_kss
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/data/models/ubergarm/GLM-4.6-GGUF/imatrix-GLM-4.6-BF16.dat \
48 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-160x19B-4.6-BF16-00001-of-00015.gguf \
49 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-4.6-smol-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=iq5_ks
20
21# Shared Expert Layers [3-92]
22blk\..*\.ffn_down_shexp\.weight=iq5_ks
23blk\..*\.ffn_(gate|up)_shexp\.weight=iq5_ks
24
25# Routed Experts Layers [3-92]
26blk\..*\.ffn_down_exps\.weight=iq4_kss
27blk\..*\.ffn_(gate|up)_exps\.weight=iq3_ks
28
29# NextN MTP Layer [92]
30blk\..*\.nextn\.embed_tokens\.weight=iq4_kss
31blk\..*\.nextn\.shared_head_head\.weight=iq4_kss
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/data/models/ubergarm/GLM-4.6-GGUF/imatrix-GLM-4.6-BF16.dat \
48 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-160x19B-4.6-BF16-00001-of-00015.gguf \
49 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-4.6-IQ3_KS.gguf \
50 IQ3_KS \
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=iq5_ks
20
21# Shared Expert Layers [3-92]
22blk\..*\.ffn_down_shexp\.weight=iq5_ks
23blk\..*\.ffn_(gate|up)_shexp\.weight=iq5_ks
24
25# Routed Experts Layers [3-92]
26blk\..*\.ffn_down_exps\.weight=iq3_k
27blk\..*\.ffn_(gate|up)_exps\.weight=iq2_kl
28
29# NextN MTP Layer [92]
30blk\..*\.nextn\.embed_tokens\.weight=iq4_kss
31blk\..*\.nextn\.shared_head_head\.weight=iq4_kss
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/data/models/ubergarm/GLM-4.6-GGUF/imatrix-GLM-4.6-BF16.dat \
48 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-160x19B-4.6-BF16-00001-of-00015.gguf \
49 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-4.6-IQ2_KL.gguf \
50 IQ2_KL \
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=iq5_ks
20
21# Shared Expert Layers [3-92]
22blk\..*\.ffn_down_shexp\.weight=iq5_ks
23blk\..*\.ffn_(gate|up)_shexp\.weight=iq5_ks
24
25# Routed Experts Layers [3-92]
26blk\..*\.ffn_down_exps\.weight=iq2_ks
27blk\..*\.ffn_(gate|up)_exps\.weight=iq2_ks
28
29# NextN MTP Layer [92]
30blk\..*\.nextn\.embed_tokens\.weight=iq4_kss
31blk\..*\.nextn\.shared_head_head\.weight=iq4_kss
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/data/models/ubergarm/GLM-4.6-GGUF/imatrix-GLM-4.6-BF16.dat \
48 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-160x19B-4.6-BF16-00001-of-00015.gguf \
49 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-4.6-smol-IQ2_KS.gguf \
50 IQ2_KS \
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=iq5_ks
20
21# Shared Expert Layers [3-92]
22blk\..*\.ffn_down_shexp\.weight=iq5_ks
23blk\..*\.ffn_(gate|up)_shexp\.weight=iq5_ks
24
25# Routed Experts Layers [3-92]
26blk\..*\.ffn_down_exps\.weight=iq1_kt
27blk\..*\.ffn_(gate|up)_exps\.weight=iq1_kt
28
29# NextN MTP Layer [92]
30blk\..*\.nextn\.embed_tokens\.weight=iq4_kss
31blk\..*\.nextn\.shared_head_head\.weight=iq4_kss
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 0 -m 0 \
45./build/bin/llama-quantize \
46 --custom-q "$custom" \
47 --imatrix /mnt/data/models/ubergarm/GLM-4.6-GGUF/imatrix-GLM-4.6-BF16.dat \
48 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-160x19B-4.6-BF16-00001-of-00015.gguf \
49 /mnt/data/models/ubergarm/GLM-4.6-GGUF/GLM-4.6-smol-IQ1_KT.gguf \
50 IQ1_KT \
51 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.6-IQ4_KSS-00001-of-00004.gguf \
12 --alias ubergarm/GLM-4.6-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
24
25# MCP/Tool Use
26# --jinja etc...