How to Run Qwen3.8-Flash-Next Locally
173
27 commits
3 linked in READMEs
updated Aug 27, 2026
Built from Qwen's original weights with our own importance matrix. The calibration corpora behind our builds are public.
Qwen3.8-Flash-Next has 177B parameters. Our 85 GB quant runs on an M5 Max with 64 GB of memory, with vision, at 36 tok/s. That is not a typo: the file is larger than the machine's entire RAM.
It works because 39 GB of that file never enters memory at all.
memory breakdown [MiB] | total free self model context compute
- MTL0 (Apple M5 Max) | 57344 = 13217 + (44125 = 43720 + 256 + 148)
- Host | 37279 = 37265 + 0 + 14
51B of the model's 177B parameters are not weights in the usual sense. They are an n-gram lookup table. The model hashes the last three tokens, and that hash points at 16 rows of 160 values each. Roughly 2.7 KB per token, read once per forward pass, out of a 39 GB table.
That is a 1-in-13-million read ratio, at a deterministic address. At 36 tok/s it comes to about 3 MB/s of random reads, and NVMe answers in under 100 µs against a 28 ms per-token budget. Common n-grams stay in page cache anyway.
Compare that with the experts: they touch about 6B parameters per token, gigabytes of traffic, and would be hopeless from disk. That is why ordinary offloading fails when you run out of memory, and why this table is different.
[!IMPORTANT] On Apple Silicon this only works if the table sits in its own GGUF shard. llama.cpp hands Metal the entire mmap'd region of any shard containing GPU tensors, so a table interleaved with weights gets wired along with them. The model then asks for more memory than the machine has, and the first decode dies with
kIOGPUCommandBufferCallbackErrorOutOfMemory. Every quant here is split so that shard 2 holds nothing but the table.
| Build | In memory | On SSD | Total | Mean KLD | Same top-1 | PPL ratio |
|---|---|---|---|---|---|---|
AD-3.84bpw-IQ4_XS-M64 | 45.8 GB | 39.1 GB | 84.9 GB | 0.2277 | 82.68% | 1.102 |
AD-4.27bpw-Q4_K_M-M64 | 54.5 GB | 38.4 GB | 92.9 GB | 0.0842 | 89.49% | 1.026 |
AD-5.00bpw-Q5_K_M-M64 | 56.1 GB | 54.4 GB | 110.5 GB | 0.0837 | 89.55% | 1.026 |
AD-4.27bpw is the one to take. It matches the 5.00bpw build within
measurement error while being 17.6 GB smaller, and leaves more headroom for
context. The 3.84bpw build is the one in the video; it is kept for machines
where every gigabyte of RAM counts.
"In memory" is what the GPU actually holds. The n-gram table is excluded because it stays on SSD.
Everything was measured against one reference, one corpus, one machine: the BF16 model's own logits over a held-out neutral set, 87 chunks at 4096 context, BF16 PPL 4.0445 ± 0.0216. Other publishers' files were downloaded and re-measured here rather than having their numbers copied, because figures taken against different references are not comparable. Their builds keep the n-gram table inside the weight shards, so the whole file has to be resident.
sudo sysctl iogpu.wired_limit_mb=57344
llama-cli -m Qwen3.8-Flash-Next-AD-4.27bpw-Q4_K_M-M64-00001-of-00033.gguf \
-ngl 99 -c 32768 --jinja -fit off
With vision:
llama-mtmd-cli -m Qwen3.8-Flash-Next-AD-4.27bpw-Q4_K_M-M64-00001-of-00033.gguf \
--mmproj mmproj-Qwen3.8-Flash-Next-F16.gguf \
-ngl 99 -c 32768 -b 512 --image-min-tokens 1024 --jinja -fit off
Three things matter here. Keep mmap on, that is what makes the table
pageable, so no --load-mode none. No --override-tensor is needed, the table
goes to the host by itself. And -fit off is required: llama.cpp's automatic
parameter fitting mis-sizes this architecture and fails to allocate.
Measured on that Mac: pp512 517.9 tok/s, tg128 36.0 tok/s.
Published here as imatrix.gguf, computed on BF16 weights, never on a quantized
proxy.
| Chunks | 4000 at 512 context |
| Corpus | 4,967,044 tokens, 3,004 documents |
| Entries | 926 tensors |
| PPL over the calibration set | 4.6812 ± 0.0155 |
| Coverage gaps | blk.0 at 98.83%, blk.47 at 99.80%, everything else complete |
| Compute time | 3 h 8 min on 4× B200 |
The corpus is rendered through this model's own chat template, so calibration matches inference byte for byte. Composition: agentic 24.7%, code 17.8%, reasoning 14.8%, multilingual 13.8%, long context 11.9%, vocabulary sweep 9.9%, structured 4.1%, graphics 3.0%. It is public in the calibration corpora dataset.
The two remaining gaps are experts the router never selects on this corpus. Six
out of 24,576 in blk.0, one in blk.47. Going from 1200 to 4000 chunks closed
half of them; the rest do not close at any corpus size.

Running llama-imatrix --show-statistics puts attn_gate at the top of every
position in the ranking. By layer, the energy concentrates in the tail:
layers 40, 46, 42, 41, 45 and 44 hold six of the seven highest values, and the
only representative from the head is blk.0. Layer 1 sits at 343, four times
lower than layer 0.
So the high-bit band in our recipe is asymmetric: blocks 0-3 and 40-47 get a step up, instead of the symmetric band a naive ladder would use. Spending bits evenly wastes them on layers 4 through 39, which do not need them.
One curiosity worth recording: blk.0.attn_gate has a maximum activation of
33.5 while every other layer sits between 3 and 8. The outlier reproduces at
both 1200 and 4000 chunks, so it is a property of the model rather than sampling
noise.
moe_intermediate_size is 640. k-quants and i-quants need rows divisible by
256, and 640 is not, so ffn_down_exps (23% of the model) falls back silently:
ask for IQ2_XXS and you get IQ4_NL, ask for Q6_K and you get Q8_0. Only block-32
types work there and 4.25 bits is the floor for that group, however aggressive
the rest of the recipe is.
The n-gram table gets no importance matrix. It is a GET_ROWS tensor, so
llama-imatrix collects no statistics for it at any corpus size. Those 51.2B
parameters are quantized blind. It also has ncols 160, so it too takes only
block-32 types. We tested 6 bits against 8.5 on otherwise identical builds: mean
KLD moved by 0.0005, which is the size of the error bar. Six bits it is.
mxfp4 discards the importance matrix. Its ggml implementation calls
GGML_UNUSED(quant_weights) outright. Using it for ffn_down_exps costs
calibration on another 23% of the model to save 0.25 bits per weight.
Fixing all three, and placing the band by activation statistics, cut mean KLD by 63% at the same file size: 0.2277 down to 0.0842, with top-1 up 6.8 points.
Files are named by their measured bits per weight. A build whose expert tensors
are IQ1_M is not a 1-bit model when the n-gram table sits at 6 bits and
ffn_down_exps at 4.5; the real average is 3.84. The canonical type in the
filename is the closest standard type by that average, so tooling can still
detect it. For AD-4.27bpw:
| Group | Type | Share of file | Contribution |
|---|---|---|---|
| n-gram table | Q5_1 | 41% | 1.74 bpw |
ffn_gate/up_exps | IQ2_S, IQ3_S at the band | 29% | 1.24 bpw |
ffn_down_exps | IQ4_NL | 24% | 1.03 bpw |
| everything else | Q8_0 | 5% | 0.23 bpw |
llama-quantize --imatrix imatrix.gguf \
--tensor-type 'blk\.([0-3]|4[0-7])\.ffn_(gate|up)_exps=iq3_s' \
--tensor-type 'ffn_down_exps=iq4_nl' \
--tensor-type 'ffn_gate_exps=iq2_s' \
--tensor-type 'ffn_up_exps=iq2_s' \
--tensor-type 'per_layer_token_embd=q5_1' \
Qwen3.8-Flash-Next-BF16.gguf out.gguf q8_0
llama-gguf-split --split --split-max-size 2G out.gguf split/prefix
The table is the fifth tensor in the file, so any small size limit isolates it into shard 2. Needs a llama.cpp build with qwen4exp support (PR #27742).
All KLD logs, the BF16 reference and both importance matrices are in the metrics repository.
Qwen3.8-Flash-Next architecture (Qwen).
[!NOTE] These GGUFs are self-quantized from the original weights, not a repack. The importance matrix keeps low-bit quants closer to the full-precision model.
[!IMPORTANT] Always pass
--jinjaso the Qwen3.8-Flash-Next chat template is applied. Without it the model can emit malformed turns.
| Property | Value |
|---|---|
| Base model | Qwen/Qwen3.8-Flash-Next |
| Type | Causal language model with a vision encoder (image-text-to-text) |
| Total / active parameters | 125B total / 6B active, plus 51B n-gram embedding and a 4B MTP layer |
| Layers | 48. Hidden layout: 12 x (3 x (Gated DeltaNet then MoE) then 1 x (Qwen Sparse Attention then MoE)) |
| Experts | 512 experts, 10 routed + 1 shared activated |
| Attention | Hybrid: Gated DeltaNet (linear) and Qwen Sparse Attention (micro-block sparse); Gated Residual over widened residual streams |
| Context length | 262,144 native, extensible up to 1,000,000 |
| This repo | GGUF quants (imatrix), text path. The importance matrix we built is published here too. |
Scores are Qwen's published results for the base Qwen/Qwen3.8-Flash-Next. Quantization preserves the large majority of this; Q4_K_M and up sit within a point or two of full precision.
| Quant | Size | Notes |
|---|---|---|
IQ2_M | — | Smallest usable. Aggressive low-bit for memory-constrained boxes. |
IQ3_M | — | Beats Q3 at similar size thanks to imatrix. Best low-RAM pick. |
Q4_K_M | — | Recommended default. Best balance of size, speed and quality. |
UD-Q4_K_XL | — | Dynamic. Embeddings and output kept at Q8_0 for higher quality at a Q4 footprint. |
Q6_K | — | Near lossless. |
Q8_0 | — | Effectively lossless, reference quality. |
[!TIP] Sizes fill in once the quants finish uploading. Pick the largest file that fits your (V)RAM with room for context.
[!NOTE] Qwen3.8-Flash-Next is a brand-new Qwen4-preview architecture (Gated DeltaNet, Qwen Sparse Attention, n-gram embedding). The quants in this repo are still uploading, and running them needs a
llama.cppbuild that has landed Qwen3.8-Flash-Next support. Until then, Atomic Chat is the easiest way to run it as support ships.
Run Qwen3.8-Flash-Next locally with:
AtomicChat/Qwen3.8-Flash-Next-GGUF, pick a quant, hit Use this model.llama-server -hf AtomicChat/Qwen3.8-Flash-Next-GGUF:Q4_K_M --jinja -c 8192ollama run hf.co/AtomicChat/Qwen3.8-Flash-Next-GGUF:Q4_K_M| Parameter | Value |
|---|---|
| temperature | 1.0 |
| top_p | 0.95 |
| top_k | 20 |
| min_p | 0.0 |
Qwen's recommended thinking-mode settings. For non-thinking (instruct) use temperature=0.7, top_p=0.80, top_k=20, presence_penalty=1.5. Allocate generous output length for agentic tasks.
git clone https://github.com/ggerganov/llama.cpp
cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --target llama-cli llama-server
./llama.cpp/build/bin/llama-server \
-hf AtomicChat/Qwen3.8-Flash-Next-GGUF:UD-Q4_K_XL \
--jinja -ngl 99 -c 8192 -fa on
Qwen/Qwen3.8-Flash-Next (original weights).--imatrix; UD-Q4_K_XL additionally pins the token-embedding and output tensors to Q8_0.Released by Qwen under the Qwen Community License 1.0. Quantized by Atomic Chat.
How to Run Qwen3.8-Flash-Next Locally
173
27 commits
3 linked in READMEs
updated Aug 27, 2026
Built from Qwen's original weights with our own importance matrix. The calibration corpora behind our builds are public.
Qwen3.8-Flash-Next has 177B parameters. Our 85 GB quant runs on an M5 Max with 64 GB of memory, with vision, at 36 tok/s. That is not a typo: the file is larger than the machine's entire RAM.
It works because 39 GB of that file never enters memory at all.
memory breakdown [MiB] | total free self model context compute
- MTL0 (Apple M5 Max) | 57344 = 13217 + (44125 = 43720 + 256 + 148)
- Host | 37279 = 37265 + 0 + 14
51B of the model's 177B parameters are not weights in the usual sense. They are an n-gram lookup table. The model hashes the last three tokens, and that hash points at 16 rows of 160 values each. Roughly 2.7 KB per token, read once per forward pass, out of a 39 GB table.
That is a 1-in-13-million read ratio, at a deterministic address. At 36 tok/s it comes to about 3 MB/s of random reads, and NVMe answers in under 100 µs against a 28 ms per-token budget. Common n-grams stay in page cache anyway.
Compare that with the experts: they touch about 6B parameters per token, gigabytes of traffic, and would be hopeless from disk. That is why ordinary offloading fails when you run out of memory, and why this table is different.
[!IMPORTANT] On Apple Silicon this only works if the table sits in its own GGUF shard. llama.cpp hands Metal the entire mmap'd region of any shard containing GPU tensors, so a table interleaved with weights gets wired along with them. The model then asks for more memory than the machine has, and the first decode dies with
kIOGPUCommandBufferCallbackErrorOutOfMemory. Every quant here is split so that shard 2 holds nothing but the table.
| Build | In memory | On SSD | Total | Mean KLD | Same top-1 | PPL ratio |
|---|---|---|---|---|---|---|
AD-3.84bpw-IQ4_XS-M64 | 45.8 GB | 39.1 GB | 84.9 GB | 0.2277 | 82.68% | 1.102 |
AD-4.27bpw-Q4_K_M-M64 | 54.5 GB | 38.4 GB | 92.9 GB | 0.0842 | 89.49% | 1.026 |
AD-5.00bpw-Q5_K_M-M64 | 56.1 GB | 54.4 GB | 110.5 GB | 0.0837 | 89.55% | 1.026 |
AD-4.27bpw is the one to take. It matches the 5.00bpw build within
measurement error while being 17.6 GB smaller, and leaves more headroom for
context. The 3.84bpw build is the one in the video; it is kept for machines
where every gigabyte of RAM counts.
"In memory" is what the GPU actually holds. The n-gram table is excluded because it stays on SSD.
Everything was measured against one reference, one corpus, one machine: the BF16 model's own logits over a held-out neutral set, 87 chunks at 4096 context, BF16 PPL 4.0445 ± 0.0216. Other publishers' files were downloaded and re-measured here rather than having their numbers copied, because figures taken against different references are not comparable. Their builds keep the n-gram table inside the weight shards, so the whole file has to be resident.
sudo sysctl iogpu.wired_limit_mb=57344
llama-cli -m Qwen3.8-Flash-Next-AD-4.27bpw-Q4_K_M-M64-00001-of-00033.gguf \
-ngl 99 -c 32768 --jinja -fit off
With vision:
llama-mtmd-cli -m Qwen3.8-Flash-Next-AD-4.27bpw-Q4_K_M-M64-00001-of-00033.gguf \
--mmproj mmproj-Qwen3.8-Flash-Next-F16.gguf \
-ngl 99 -c 32768 -b 512 --image-min-tokens 1024 --jinja -fit off
Three things matter here. Keep mmap on, that is what makes the table
pageable, so no --load-mode none. No --override-tensor is needed, the table
goes to the host by itself. And -fit off is required: llama.cpp's automatic
parameter fitting mis-sizes this architecture and fails to allocate.
Measured on that Mac: pp512 517.9 tok/s, tg128 36.0 tok/s.
Published here as imatrix.gguf, computed on BF16 weights, never on a quantized
proxy.
| Chunks | 4000 at 512 context |
| Corpus | 4,967,044 tokens, 3,004 documents |
| Entries | 926 tensors |
| PPL over the calibration set | 4.6812 ± 0.0155 |
| Coverage gaps | blk.0 at 98.83%, blk.47 at 99.80%, everything else complete |
| Compute time | 3 h 8 min on 4× B200 |
The corpus is rendered through this model's own chat template, so calibration matches inference byte for byte. Composition: agentic 24.7%, code 17.8%, reasoning 14.8%, multilingual 13.8%, long context 11.9%, vocabulary sweep 9.9%, structured 4.1%, graphics 3.0%. It is public in the calibration corpora dataset.
The two remaining gaps are experts the router never selects on this corpus. Six
out of 24,576 in blk.0, one in blk.47. Going from 1200 to 4000 chunks closed
half of them; the rest do not close at any corpus size.

Running llama-imatrix --show-statistics puts attn_gate at the top of every
position in the ranking. By layer, the energy concentrates in the tail:
layers 40, 46, 42, 41, 45 and 44 hold six of the seven highest values, and the
only representative from the head is blk.0. Layer 1 sits at 343, four times
lower than layer 0.
So the high-bit band in our recipe is asymmetric: blocks 0-3 and 40-47 get a step up, instead of the symmetric band a naive ladder would use. Spending bits evenly wastes them on layers 4 through 39, which do not need them.
One curiosity worth recording: blk.0.attn_gate has a maximum activation of
33.5 while every other layer sits between 3 and 8. The outlier reproduces at
both 1200 and 4000 chunks, so it is a property of the model rather than sampling
noise.
moe_intermediate_size is 640. k-quants and i-quants need rows divisible by
256, and 640 is not, so ffn_down_exps (23% of the model) falls back silently:
ask for IQ2_XXS and you get IQ4_NL, ask for Q6_K and you get Q8_0. Only block-32
types work there and 4.25 bits is the floor for that group, however aggressive
the rest of the recipe is.
The n-gram table gets no importance matrix. It is a GET_ROWS tensor, so
llama-imatrix collects no statistics for it at any corpus size. Those 51.2B
parameters are quantized blind. It also has ncols 160, so it too takes only
block-32 types. We tested 6 bits against 8.5 on otherwise identical builds: mean
KLD moved by 0.0005, which is the size of the error bar. Six bits it is.
mxfp4 discards the importance matrix. Its ggml implementation calls
GGML_UNUSED(quant_weights) outright. Using it for ffn_down_exps costs
calibration on another 23% of the model to save 0.25 bits per weight.
Fixing all three, and placing the band by activation statistics, cut mean KLD by 63% at the same file size: 0.2277 down to 0.0842, with top-1 up 6.8 points.
Files are named by their measured bits per weight. A build whose expert tensors
are IQ1_M is not a 1-bit model when the n-gram table sits at 6 bits and
ffn_down_exps at 4.5; the real average is 3.84. The canonical type in the
filename is the closest standard type by that average, so tooling can still
detect it. For AD-4.27bpw:
| Group | Type | Share of file | Contribution |
|---|---|---|---|
| n-gram table | Q5_1 | 41% | 1.74 bpw |
ffn_gate/up_exps | IQ2_S, IQ3_S at the band | 29% | 1.24 bpw |
ffn_down_exps | IQ4_NL | 24% | 1.03 bpw |
| everything else | Q8_0 | 5% | 0.23 bpw |
llama-quantize --imatrix imatrix.gguf \
--tensor-type 'blk\.([0-3]|4[0-7])\.ffn_(gate|up)_exps=iq3_s' \
--tensor-type 'ffn_down_exps=iq4_nl' \
--tensor-type 'ffn_gate_exps=iq2_s' \
--tensor-type 'ffn_up_exps=iq2_s' \
--tensor-type 'per_layer_token_embd=q5_1' \
Qwen3.8-Flash-Next-BF16.gguf out.gguf q8_0
llama-gguf-split --split --split-max-size 2G out.gguf split/prefix
The table is the fifth tensor in the file, so any small size limit isolates it into shard 2. Needs a llama.cpp build with qwen4exp support (PR #27742).
All KLD logs, the BF16 reference and both importance matrices are in the metrics repository.
Qwen3.8-Flash-Next architecture (Qwen).
[!NOTE] These GGUFs are self-quantized from the original weights, not a repack. The importance matrix keeps low-bit quants closer to the full-precision model.
[!IMPORTANT] Always pass
--jinjaso the Qwen3.8-Flash-Next chat template is applied. Without it the model can emit malformed turns.
| Property | Value |
|---|---|
| Base model | Qwen/Qwen3.8-Flash-Next |
| Type | Causal language model with a vision encoder (image-text-to-text) |
| Total / active parameters | 125B total / 6B active, plus 51B n-gram embedding and a 4B MTP layer |
| Layers | 48. Hidden layout: 12 x (3 x (Gated DeltaNet then MoE) then 1 x (Qwen Sparse Attention then MoE)) |
| Experts | 512 experts, 10 routed + 1 shared activated |
| Attention | Hybrid: Gated DeltaNet (linear) and Qwen Sparse Attention (micro-block sparse); Gated Residual over widened residual streams |
| Context length | 262,144 native, extensible up to 1,000,000 |
| This repo | GGUF quants (imatrix), text path. The importance matrix we built is published here too. |
Scores are Qwen's published results for the base Qwen/Qwen3.8-Flash-Next. Quantization preserves the large majority of this; Q4_K_M and up sit within a point or two of full precision.
| Quant | Size | Notes |
|---|---|---|
IQ2_M | — | Smallest usable. Aggressive low-bit for memory-constrained boxes. |
IQ3_M | — | Beats Q3 at similar size thanks to imatrix. Best low-RAM pick. |
Q4_K_M | — | Recommended default. Best balance of size, speed and quality. |
UD-Q4_K_XL | — | Dynamic. Embeddings and output kept at Q8_0 for higher quality at a Q4 footprint. |
Q6_K | — | Near lossless. |
Q8_0 | — | Effectively lossless, reference quality. |
[!TIP] Sizes fill in once the quants finish uploading. Pick the largest file that fits your (V)RAM with room for context.
[!NOTE] Qwen3.8-Flash-Next is a brand-new Qwen4-preview architecture (Gated DeltaNet, Qwen Sparse Attention, n-gram embedding). The quants in this repo are still uploading, and running them needs a
llama.cppbuild that has landed Qwen3.8-Flash-Next support. Until then, Atomic Chat is the easiest way to run it as support ships.
Run Qwen3.8-Flash-Next locally with:
AtomicChat/Qwen3.8-Flash-Next-GGUF, pick a quant, hit Use this model.llama-server -hf AtomicChat/Qwen3.8-Flash-Next-GGUF:Q4_K_M --jinja -c 8192ollama run hf.co/AtomicChat/Qwen3.8-Flash-Next-GGUF:Q4_K_M| Parameter | Value |
|---|---|
| temperature | 1.0 |
| top_p | 0.95 |
| top_k | 20 |
| min_p | 0.0 |
Qwen's recommended thinking-mode settings. For non-thinking (instruct) use temperature=0.7, top_p=0.80, top_k=20, presence_penalty=1.5. Allocate generous output length for agentic tasks.
git clone https://github.com/ggerganov/llama.cpp
cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --target llama-cli llama-server
./llama.cpp/build/bin/llama-server \
-hf AtomicChat/Qwen3.8-Flash-Next-GGUF:UD-Q4_K_XL \
--jinja -ngl 99 -c 8192 -fa on
Qwen/Qwen3.8-Flash-Next (original weights).--imatrix; UD-Q4_K_XL additionally pins the token-embedding and output tensors to Q8_0.Released by Qwen under the Qwen Community License 1.0. Quantized by Atomic Chat.