Image-Text-to-Text
Safetensors
Merlin
English
vllm
qwen4_exp
qwen3.8
flash-next
w4a16
autoround
mtp
speculative-decoding
fp8-kv
long-context
vision
rtx-3090
ampere
sm86
conversational
compressed-tensors
Instructions to use halt95/Qwen3.8-Flash-Next-W4A16-Merlin with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Merlin
How to use halt95/Qwen3.8-Flash-Next-W4A16-Merlin with Merlin:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Model card: Merlin 3.0.0 template (audited)
Browse files- .gitattributes +2 -0
- README.md +251 -80
- assets/hero.png +3 -0
- assets/speed.png +3 -0
.gitattributes
CHANGED
|
@@ -35,3 +35,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
model.safetensors.index.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
model.safetensors.index.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
assets/hero.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
assets/speed.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -11,129 +11,300 @@ pipeline_tag: image-text-to-text
|
|
| 11 |
tags:
|
| 12 |
- qwen3.8
|
| 13 |
- flash-next
|
|
|
|
| 14 |
- w4a16
|
| 15 |
- autoround
|
| 16 |
- mtp
|
| 17 |
- speculative-decoding
|
| 18 |
- fp8-kv
|
| 19 |
- long-context
|
|
|
|
| 20 |
- rtx-3090
|
| 21 |
- ampere
|
| 22 |
- sm86
|
| 23 |
---
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Qwen3.8-Flash-Next-W4A16-Merlin
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
-
resident at once.
|
| 40 |
-
- **Built for agents.** Follow-up turns resume from cache: in one conversation the next turn starts in **0.96 s**; with
|
| 41 |
-
8 agents at once (temperature 0), 92.5 % of follow-up tokens come from cache and the median follow-up starts in 1.61 s.
|
| 42 |
-
- **Fast.** About 162–177 tok/s single-stream (thinking on, MTP speculative decoding), 534 tok/s across 8 concurrent
|
| 43 |
-
requests, and 5,000–5,530 tok/s prefill from 10K to 261K tokens.
|
| 44 |
-
- **Quality kept.** Experts in Intel's INT4 AutoRound, attention in BF16, every release gated against the BF16
|
| 45 |
-
model (divergence, 262K needle, GSM8K 198/200, structured output 80/80).
|
| 46 |
-
- **Vision and tools.** Up to 42 images per request (4 MP each), Qwen3 tool calling and reasoning parsers, one OpenAI-compatible
|
| 47 |
-
endpoint.
|
| 48 |
|
| 49 |
-
|
|
|
|
| 50 |
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
-
runs without, with slower prefill); no NVLink needed.
|
| 55 |
-
- 96 GB of host RAM (the model's n-gram embedding table lives there), `/dev/shm` of at least 1 GB, and about 250 GB of
|
| 56 |
-
free disk (the checkpoint is 115 GiB).
|
| 57 |
-
- Linux x86-64 with glibc 2.34 or newer, an NVIDIA driver 580 or later (CUDA 13.0), Python 3.13 with venv and headers,
|
| 58 |
-
a C/C++ compiler, ninja, git and curl. The build installs its own CUDA 13.0 toolchain into the venv.
|
| 59 |
|
| 60 |
-
##
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
```bash
|
| 65 |
-
git clone
|
| 66 |
-
|
| 67 |
-
curl -fLO "$R/v2.5.2/v2.5.2-from-upstream-v0.30.0.bundle.gz" && gunzip v2.5.2-from-upstream-v0.30.0.bundle.gz
|
| 68 |
-
curl -fLO "$R/v2.2.0/build-artifacts-sm86-py313-cu130-v2.2.0.tar.gz"
|
| 69 |
-
hf download halt95/Qwen3.8-Flash-Next-W4A16-Merlin --local-dir ~/models/Flash-Next-Merlin
|
| 70 |
-
|
| 71 |
-
BUNDLE=./v2.5.2-from-upstream-v0.30.0.bundle ARTIFACTS=./build-artifacts-sm86-py313-cu130-v2.2.0.tar.gz \
|
| 72 |
-
scripts/build-v2.5.sh ./vllm-v2.5 ./venv-v2.5
|
| 73 |
-
TREE=./vllm-v2.5 VENV=./venv-v2.5 CACHE_ROOT=./.vllm-cache-v2.5 scripts/serve-v2.5.sh ~/models/Flash-Next-Merlin
|
| 74 |
```
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
```bash
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
```
|
| 83 |
|
| 84 |
-
|
| 85 |
-
recipes, a health check and troubleshooting are in the companion repository's
|
| 86 |
-
[reference](https://github.com/halt95/qwen38-flash-next-3090s/blob/main/docs/reference.md).
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
-
|
| 91 |
-
instead of 446 W in P2 on the reference host, with every bounds check still on (`VLLM_E2_GUARD_IDLE=0` restores the
|
| 92 |
-
always-polling reader). Weights, compiled ops and speed are unchanged; the same engine commit ships in the Qwen3.8-27B
|
| 93 |
-
releases. Thanks to [CoolShades](https://github.com/CoolShades) for the idle-power report in
|
| 94 |
-
[issue #2](https://github.com/halt95/qwen38-flash-next-3090s/issues/2) and
|
| 95 |
-
[PR #3](https://github.com/halt95/qwen38-flash-next-3090s/pull/3), which led to this fix. Measurements: the
|
| 96 |
-
[v2.5.2 bench card](https://github.com/halt95/qwen38-flash-next-3090s/blob/main/benchmarks/2026-10-12/BENCH-CARD.md);
|
| 97 |
-
release notes: the [CHANGELOG](https://github.com/halt95/qwen38-flash-next-3090s/blob/main/CHANGELOG.md#v252).
|
| 98 |
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
-
|
| 102 |
-
`config.json` (the v2.5 serve script needs its `ple_embedding_dtype` key). `tokenizer.json` is now the upstream file.
|
| 103 |
-
v2.5.0 was not published, so this is everything since v2.2.0.
|
| 104 |
|
| 105 |
-
-
|
| 106 |
-
|
| 107 |
-
-
|
| 108 |
-
-
|
| 109 |
-
-
|
|
|
|
|
|
|
| 110 |
|
| 111 |
-
|
| 112 |
|
| 113 |
-
|
| 114 |
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|---|---|
|
| 117 |
-
|
|
| 118 |
-
|
|
| 119 |
-
| Gated DeltaNet
|
| 120 |
-
|
|
| 121 |
-
|
|
| 122 |
-
|
|
| 123 |
|
| 124 |
-
|
| 125 |
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
|
| 128 |
## Good to know
|
| 129 |
|
| 130 |
-
-
|
| 131 |
-
- Only if you shrink the KV pool yourself: keep it larger than `--max-model-len` plus a few blocks. With the shipped
|
| 132 |
-
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
-
## Credits
|
| 136 |
|
| 137 |
-
Qwen (model
|
| 138 |
-
table), DominikBucko (MTP packing recipe), the vLLM community PLE-offload work, aikitoria (peer-to-peer on consumer
|
| 139 |
-
Ampere), and [CoolShades](https://github.com/CoolShades) (idle-power report, behind the guard fix in v2.5.2). Upstream fixes are credited by PR number in the companion repository's commit messages and by author in its `NOTICE`.
|
|
|
|
| 11 |
tags:
|
| 12 |
- qwen3.8
|
| 13 |
- flash-next
|
| 14 |
+
- merlin
|
| 15 |
- w4a16
|
| 16 |
- autoround
|
| 17 |
- mtp
|
| 18 |
- speculative-decoding
|
| 19 |
- fp8-kv
|
| 20 |
- long-context
|
| 21 |
+
- vision
|
| 22 |
- rtx-3090
|
| 23 |
- ampere
|
| 24 |
- sm86
|
| 25 |
---
|
| 26 |
|
| 27 |
+
<div align="center">
|
| 28 |
+
|
| 29 |
+
<img src="https://huggingface.co/halt95/Qwen3.8-Flash-Next-W4A16-Merlin/resolve/main/assets/hero.png" alt="Qwen3.8-Flash-Next W4A16, powered by Merlin: a 4-bit checkpoint, 115 GiB, full 262K context on four 24 GB GPUs. A 924,993-token KV pool in VRAM; 638 tok/s total for 8 agents at once; 184 tok/s decode at 262K; 6,051 tok/s prefill on a 100K prompt." width="100%">
|
| 30 |
+
|
| 31 |
+
<p>
|
| 32 |
+
<a href="https://huggingface.co/Qwen/Qwen3.8-Flash-Next"><img src="https://img.shields.io/badge/base-Qwen3.8--Flash--Next-615ced" alt="Base model: Qwen3.8-Flash-Next"></a>
|
| 33 |
+
<a href="#the-checkpoint"><img src="https://img.shields.io/badge/quant-W4A16-3987e5" alt="Quant: W4A16"></a>
|
| 34 |
+
<a href="#what-it-fits-on"><img src="https://img.shields.io/badge/context-262K-ffb000" alt="Context: 262K"></a>
|
| 35 |
+
<a href="#what-it-fits-on"><img src="https://img.shields.io/badge/GPUs-Ampere-76B900" alt="GPUs: NVIDIA Ampere (Ada profiles ship untested)"></a>
|
| 36 |
+
<a href="https://github.com/halt95/merlin-engine"><img src="https://img.shields.io/badge/runs_on-Merlin_3.0.0-a78bfa" alt="Runs on Merlin 3.0.0"></a>
|
| 37 |
+
<a href="https://huggingface.co/halt95/Qwen3.8-Flash-Next-W4A16-Merlin/blob/main/LICENSE"><img src="https://img.shields.io/badge/licence-Qwen_Community_1.0-lightgrey" alt="Licence: Qwen Community 1.0"></a>
|
| 38 |
+
</p>
|
| 39 |
+
|
| 40 |
+
<b><a href="#the-checkpoint">The checkpoint</a> · <a href="#speed">Speed</a> · <a href="#quality">Quality</a> · <a href="#what-it-fits-on">What it fits on</a> · <a href="#use-it">Use it</a> · <a href="#the-base-model">The base model</a> · <a href="https://github.com/halt95/merlin-engine/blob/main/models/flash-next/benchmarks/2026-10-20/BENCH-CARD.md">Bench card</a></b>
|
| 41 |
+
|
| 42 |
+
</div>
|
| 43 |
+
|
| 44 |
# Qwen3.8-Flash-Next-W4A16-Merlin
|
| 45 |
|
| 46 |
+
A 4-bit build of [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next), Qwen's 125B mixture-of-experts model (6B active per token, with vision), made to run at its full 262,144-token context on four 24 GB GPUs. It is 115 GiB instead of the original 335 GiB: the routed experts are INT4, the 51B-parameter n-gram table is FP8, and attention and the vision tower stay in BF16. It is served by the [Merlin engine](https://github.com/halt95/merlin-engine), a vLLM 0.32.0 fork tuned for Ampere and Ada that keeps the n-gram table in host RAM and the whole KV cache in VRAM. Measured on RTX 3090s; the engine also ships profiles for other Ampere and Ada cards, from RTX 4090s and 48 GB workstation cards to A100s and CMP 170HX (see [What it fits on](#what-it-fits-on)).
|
| 47 |
+
|
| 48 |
+
<sub>numbers: Merlin 3.0.0 on 4× RTX 3090 w/o NVLINK @ 220W, P2P on, 2026-10-20 bench card. KV pool: FP8, all in VRAM; three 262K sessions held at once. Agents: eight 16K conversations, then eight simultaneous 512-token follow-ups, thinking off. Decode: one stream, thinking on (effort low, as benchmarked), exactly 261,888 prompt tokens + 128 out, median of 3. Prefill: one cold 101,875-token prompt. Each figure is also in a table below.</sub>
|
| 49 |
+
|
| 50 |
+
<a href="https://ko-fi.com/halt95"><img src="https://storage.ko-fi.com/cdn/kofi3.png?v=3" alt="Buy me a coffee on Ko-fi" height="40"></a>
|
| 51 |
+
|
| 52 |
+
## The checkpoint
|
| 53 |
+
|
| 54 |
+
| Component | Format |
|
| 55 |
+
|---|---|
|
| 56 |
+
| Routed experts (512 per layer) | INT4 g128, from [Intel's AutoRound release](https://huggingface.co/Intel/Qwen3.8-Flash-Next-W4A16-AutoRound) |
|
| 57 |
+
| MTP draft-head experts | INT4 g128, packed in place |
|
| 58 |
+
| Gated DeltaNet QKV/Z and output projections | INT8 per channel |
|
| 59 |
+
| N-gram (PLE) embedding table, 51B parameters | FP8, kept in host RAM at serve time ([RadixArk](https://huggingface.co/RadixArk/Qwen3.8-Flash-Next-NVFP4)) |
|
| 60 |
+
| Attention, norms, embeddings, lm_head, shared expert, routers, QSA indexer, gated-residual weights, DeltaNet a/b and conv, MTP non-expert layers, vision tower | BF16, unchanged |
|
| 61 |
+
| KV cache | FP8 E4M3 with calibrated static scales (`qsa_kv_scales_262k.json`) |
|
| 62 |
+
|
| 63 |
+
**Files in this repository**
|
| 64 |
+
|
| 65 |
+
| Files | What they hold | Size |
|
| 66 |
+
|---|---|---|
|
| 67 |
+
| `model-000NN-of-00017.safetensors` (15) | Routed experts, DeltaNet projections, attention, norms, embeddings, shared expert, vision tower | 66.2 GiB |
|
| 68 |
+
| `model-plefp8-0000N.safetensors` (10) | The n-gram embedding table, FP8; loaded into host RAM at serve time | 47.7 GiB |
|
| 69 |
+
| `mtp-routed-experts-int4.safetensors` | MTP draft-head experts, INT4 | 1.2 GiB |
|
| 70 |
+
| `model_extra_tensors.safetensors` | Further tensors listed in the index | 0.2 GiB |
|
| 71 |
+
| `qsa_kv_scales_262k.json` | Calibrated static scales for the FP8 KV cache | 1.4 KiB |
|
| 72 |
+
| `model.safetensors.index.json` | Which file holds each tensor | 24.3 MiB |
|
| 73 |
+
| `chat_template.jinja` | Qwen's own chat template, unchanged (byte-identical to the upstream file). Merlin serves [Froggeric's fixed Qwen3.8 template](https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates) (v22.5) by default; see Use it | 8.7 KiB |
|
| 74 |
+
| `config.json`, `quantization_config.json`, tokenizer, processor configs | Model, quantisation, tokenizer and processor settings | 12.3 MiB |
|
| 75 |
+
| `LICENSE` | Qwen Community License 1.0 | 3.1 KiB |
|
| 76 |
+
|
| 77 |
+
<sub>115.3 GiB in total. There are no shards 00002 and 00016: `model.safetensors.index.json` maps no tensor to them, so nothing is missing.</sub>
|
| 78 |
+
|
| 79 |
+
## Speed
|
| 80 |
+
|
| 81 |
+
<img src="https://huggingface.co/halt95/Qwen3.8-Flash-Next-W4A16-Merlin/resolve/main/assets/speed.png" alt="Speed on 4x RTX 3090, Merlin 3.0.0. Decode, one stream: 168 tok/s at 4K, 170 at 131K, 184 at 262K. Cold prefill: 6,081 tok/s at 32K, 6,046 at 131K, 5,838 at 262K. Time to first token: 0.79 s at 4K, 21.6 s at 131K, 44.9 s at 262K. Agents at once, total: 222 tok/s for 2, 378 for 4, 638 for 8. The same figures are in the tables below." width="100%">
|
| 82 |
+
|
| 83 |
+
| Prompt | Decode, one stream | Prefill, cold | Time to first token |
|
| 84 |
+
|---|---|---|---|
|
| 85 |
+
| 4K | 168 tok/s | 5,159 tok/s | 0.79 s |
|
| 86 |
+
| 32K | 168 tok/s | 6,081 tok/s | 5.36 s |
|
| 87 |
+
| 131K | 170 tok/s | 6,046 tok/s | 21.6 s |
|
| 88 |
+
| 262K | 184 tok/s | 5,838 tok/s | 44.9 s |
|
| 89 |
+
|
| 90 |
+
<sub>4× RTX 3090, the needle-prompt ladder (4,076 / 32,596 / 130,416 / 261,888 prompt tokens), every send a cold prefill except at 262K, where sends 1 and 2 are cold and send 3 reuses the prefix before the needle. Decode: thinking on, ≤ 256 tokens out (128 at 262K), median of 3. Prefill: prompt tokens / time to first token (the median below 262K; the cold send 1 at 262K). The 262K needle is found in 3 of 3 thinking-off sends.</sub>
|
| 91 |
+
|
| 92 |
+
| Cold prefill, one send | Prefill | Time to first token |
|
| 93 |
+
|---|---|---|
|
| 94 |
+
| 10,187 tokens | 5,660 tok/s | 1.80 s |
|
| 95 |
+
| 101,875 tokens | 6,051 tok/s | 16.8 s |
|
| 96 |
+
| 261,888 tokens | 5,838 tok/s | 44.9 s |
|
| 97 |
+
|
| 98 |
+
<sub>One cold request per prompt, 8 tokens out; the 261,888-token row is the exact-262K prompt's cold send 1 (128 tokens out). The 101,875-token figure is the hero's prefill number.</sub>
|
| 99 |
+
|
| 100 |
+
| Agents at once | Total tok/s |
|
| 101 |
+
|---|---|
|
| 102 |
+
| 2 | 222 |
|
| 103 |
+
| 4 | 378 |
|
| 104 |
+
| 8 | 638 |
|
| 105 |
+
|
| 106 |
+
<sub>N 16K conversations, then N simultaneous 512-token follow-ups, thinking off, total tok/s while all N decode. Each overlap window was short (4.55, 5.22 and 5.97 s), so read these rows loosely.</sub>
|
| 107 |
+
|
| 108 |
+
| Sessions held at once | Needles found | Re-sent from cache, lowest |
|
| 109 |
+
|---|---|---|
|
| 110 |
+
| 3 × 262K | 3 / 3 | 99.95 % |
|
| 111 |
+
| 6 × 131K | 6 / 6 | 99.91 % |
|
| 112 |
+
|
| 113 |
+
<sub>N needle prompts (thinking off, greedy) sent at once, then re-sent one by one: every re-send served from the prefix cache means the pool held all N. Peak pool use 100 %, 0 preemptions.</sub>
|
| 114 |
|
| 115 |
+
<details>
|
| 116 |
+
<summary><b>Against the previous release (v2.5.3)</b></summary>
|
| 117 |
|
| 118 |
+
| Measure | v2.5.3 | 3.0.0 | Change |
|
| 119 |
+
|---|---|---|---|
|
| 120 |
+
| Decode, 4,076-token prompt | 162.0 | 167.7 | +3.5 % |
|
| 121 |
+
| Decode, 130,416-token prompt | 168.0 | 170.3 | +1.4 % |
|
| 122 |
+
| Decode, 259,587-token prompt | 177.2 | 187.4 | +5.8 % |
|
| 123 |
+
| Prefill, 10,187-token prompt | 5,020 | 5,660 | +12.7 % |
|
| 124 |
+
| Prefill, 101,875-token prompt | 5,417 | 6,051 | +11.7 % |
|
| 125 |
|
| 126 |
+
<sub>tok/s. Decode: thinking on, median of 3, same frozen driver and prompts. Prefill: one cold send each. v2.5.3 added the Swift1.5-Huihui checkpoint and kept the v2.5.2 engine unchanged, so its Flash-Next figures are the v2.5.2 bench card's. The exact 261,888-token row (184 tok/s) is new in 3.0.0 and has no v2.5.3 counterpart.</sub>
|
| 127 |
|
| 128 |
+
</details>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
+
<details>
|
| 131 |
+
<summary><b>How it was measured</b></summary>
|
| 132 |
|
| 133 |
+
- Host: 4× RTX 3090 (24 GB, sm_86) at 220 W, PCIe Gen4 with P2P, no NVLink, driver 610.43.02.
|
| 134 |
+
- Engine: Merlin 3.0.0 from the release wheel, installed with `release/install-env.sh`, served by `merlin serve` with the release defaults, one fresh boot.
|
| 135 |
+
- Layout: TP2 × PP2 + EP on four cards, MTP K=3, FP8 KV, BF16 draft lm_head, thinking effort `low`, the default when benchmarked on 2026-10-20 (Merlin now serves `medium` by default).
|
| 136 |
+
- Decode: T=0, a needle prompt at depth, every send a cold prefill except send 3 at 262K, which reuses the prefix before the needle; one discarded warm-up, then 3 sends per cell, median. tok/s = tokens after the first streamed event / time from first to last event.
|
| 137 |
+
- Streams are client-timed. Full tables, thinking-off rows and ITL: the [bench card](https://github.com/halt95/merlin-engine/blob/main/models/flash-next/benchmarks/2026-10-20/BENCH-CARD.md).
|
| 138 |
|
| 139 |
+
</details>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
+
## Quality
|
| 142 |
|
| 143 |
+
**This checkpoint**, measured on the Merlin engine:
|
| 144 |
+
|
| 145 |
+
| Check | Result | Setting |
|
| 146 |
+
|---|---|---|
|
| 147 |
+
| GSM8K-200 | 199 / 200 | 5-shot, thinking off |
|
| 148 |
+
| Needles at 131K | 10 / 10 | single-occurrence needles, an image in the prompt, thinking off, greedy, cold cache |
|
| 149 |
+
| Needles at 262K | 23 / 23 | as above |
|
| 150 |
+
| Needle at exactly 261,888 tokens | 3 / 3 | thinking off |
|
| 151 |
+
| Image, 4096 × 2048 (8,388,608 px) | 1 / 1 · 2 / 2 at once · 1 / 1 with four in one prompt | thinking off; names both colours of a two-colour image (with four, of the last one) |
|
| 152 |
+
|
| 153 |
+
<sub>GSM8K and images: the Merlin 3.0.0 release wheel, 2026-10-20. Needle panel: a pre-release engine build, 2026-10-17. These are checks of this checkpoint, not a matched BF16 comparison: no BF16 run of the same checks was made, so how much quality the 4-bit build keeps is not quantified here.</sub>
|
| 154 |
+
|
| 155 |
+
**The base model**, as reported by Qwen for the BF16 weights:
|
| 156 |
+
|
| 157 |
+
| Area | Benchmark | Qwen3.8-Flash-Next (BF16) |
|
| 158 |
+
|---|---|---|
|
| 159 |
+
| Coding | SWE-bench Pro | 62.5 |
|
| 160 |
+
| Coding | DeepSWE 1.1 | 58.7 |
|
| 161 |
+
| Coding | LiveCodeBench v6 | 91.9 |
|
| 162 |
+
| Agents | Toolathlon Verified (Pass@1) | 73.5 |
|
| 163 |
+
| Agents | CoWorkBench | 73.9 |
|
| 164 |
+
| Reasoning and instructions | GPQA Diamond | 91.7 |
|
| 165 |
+
| Reasoning and instructions | HLE | 35.9 |
|
| 166 |
+
| Reasoning and instructions | IFBench | 81.3 |
|
| 167 |
+
| Vision | AndroidWorld | 84.5 |
|
| 168 |
+
| Vision | RealWorldQA | 88.5 |
|
| 169 |
+
| Vision | LVBench | 76.6 |
|
| 170 |
+
|
| 171 |
+
<sub>A selection from the [upstream card](https://huggingface.co/Qwen/Qwen3.8-Flash-Next), which has the full tables and comparisons with other models. These were not re-run on this 4-bit build.</sub>
|
| 172 |
+
|
| 173 |
+
## What it fits on
|
| 174 |
+
|
| 175 |
+
| Measured on | Context per request | KV pool | Held at once | Images |
|
| 176 |
+
|---|---|---|---|---|
|
| 177 |
+
| 4× RTX 3090, 24 GB (🟢 Tested) | 262,144 tokens | 924,993 tokens, FP8, all in VRAM | 3 × 262K or 6 × 131K | 8 MP |
|
| 178 |
+
|
| 179 |
+
<sub>Measured on the reference host (2026-10-20 bench card): three 262K and six 131K sessions held at once with every re-send served from cache; a 4096 × 2048 image (8,388,608 px) with at least 1,026 MiB free on every card.</sub>
|
| 180 |
+
|
| 181 |
+
**Other GPUs.** The engine also ships profiles for these; the Status column says how far each has been run:
|
| 182 |
+
|
| 183 |
+
| GPUs | Arch | Profile | Context fit | Status |
|
| 184 |
+
|---|---|---|---|---|
|
| 185 |
+
| 4× RTX 3090 Ti, RTX A5000, A10 (24 GB) | Ampere, sm_86 | `fn-quad-3090` | ~3 × 262K (as the 3090) | ⚫ Untested |
|
| 186 |
+
| 4× RTX 3090 without P2P | Ampere, sm_86 | `fn-quad-3090-nop2p` | ~3 × 262K | ⚫ Untested |
|
| 187 |
+
| 8× RTX 3090 | Ampere, sm_86 | `fn-octo-3090-tp2pp4` | ~17 × 262K | ⚫ Untested |
|
| 188 |
+
| 4× RTX 4090 (24 GB) | Ada, sm_89 | `fn-quad-24g-sm89` | ~3 × 262K | ⚫ Untested |
|
| 189 |
+
| 4× RTX 4080 Super 32 GB (modified) | Ada, sm_89 | `fn-quad-32g-sm89` | ~10 × 262K | ⚫ Untested |
|
| 190 |
+
| 2 / 4× 48 GB: RTX A6000, A40 | Ampere, sm_86 | `fn-2x48g-pp2-sm86`, `fn-4x48g-tp2pp2-sm86` | ~5 / ~25 × 262K | ⚫ Untested |
|
| 191 |
+
| 2 / 4× 48 GB: RTX 6000 Ada, L40S | Ada, sm_89 | `fn-2x48g-pp2-sm89`, `fn-4x48g-tp2pp2-sm89` | ~5 / ~25 × 262K | ⚫ Untested |
|
| 192 |
+
| 4× A10G, L4 (cloud, 22.5 GiB as reported) | Ampere / Ada | `fn-quad-3090-nop2p`, `fn-quad-24g-sm89` | ~1 × 262K | ⚫ Untested |
|
| 193 |
+
| 1 / 2 / 4× A100 80 GB | Ampere, sm_80 | `fn-sm80-80g-x1`, `-x2-tp2`, `-x4-tp2pp2` | ~1 / ~11 / ~28 × 262K | ⚫ Untested |
|
| 194 |
+
| 4× A100 40 GB, CMP 170HX 40 GB | Ampere, sm_80 | `fn-sm80-40g-x4-pp4` | ~7 × 262K | ⚫ Untested |
|
| 195 |
+
| 3 / 4× CMP 170HX 32 GB | Ampere, sm_80 | `fn-sm80-32g-x3-pp3`, `fn-sm80-32g-x4-pp4` | ~1 / ~4 × 262K | ⚫ Untested |
|
| 196 |
+
| 4× A30 (24 GB) | Ampere, sm_80 | `fn-quad-24g-sm80` | ~1 × 262K | ⚫ Untested |
|
| 197 |
+
| 2× CMP 170HX 64 GB | Ampere, sm_80 | `fn-sm80-64g-x2-pp2` | ~6 × 262K | ⚫ Untested |
|
| 198 |
+
| 4× CMP 170HX 64 GB | Ampere, sm_80 | `fn-sm80-64g-x4-pp4` | 17 × 262K | 🟢 Tested (rented host) |
|
| 199 |
+
|
| 200 |
+
<sub>`merlin serve` and `./setup.sh` pick the profile from the GPUs they find. A `~` is the engine's estimate, not a measurement. On sm_80 cards (A100, A30, CMP 170HX) this checkpoint runs a BF16 KV cache, since its attention path takes FP8 KV only on sm_86 and sm_89 for now, so fewer sessions fit; FP8 there comes in a 3.0.x update. 🟢 measured by us (the 4× CMP 170HX row on a rented host) · ⚫ a profile ships, not yet run by us (expected to work). Every profile: the engine's [hardware matrix](https://github.com/halt95/merlin-engine/blob/main/docs/merlin/hardware-matrix.md).</sub>
|
| 201 |
+
|
| 202 |
+
| Need | Details |
|
| 203 |
+
|---|---|
|
| 204 |
+
| Host RAM | 96 GiB reference allocation; the FP8 n-gram table alone takes about 47.7 GiB. The minimum has not been re-measured on 3.0.0. |
|
| 205 |
+
| Disk | About 115 GiB for the checkpoint, plus the engine environment and caches |
|
| 206 |
+
| Engine host | Linux x86-64 (glibc 2.38 or newer), NVIDIA driver R580 or later (CUDA 13), Python 3.13, GCC/G++ 13 or newer, `/dev/shm` of at least 1 GB; GPUs headless with no other CUDA process. `merlin doctor` checks the host. |
|
| 207 |
+
|
| 208 |
+
## Use it
|
| 209 |
|
| 210 |
```bash
|
| 211 |
+
git clone https://github.com/halt95/merlin-engine.git && cd merlin-engine
|
| 212 |
+
./setup.sh --model flash-next
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
```
|
| 214 |
|
| 215 |
+
One command does the rest: after a small uv and Python bootstrap it checks the GPUs, driver, RAM and disk, shows the engine, package and checkpoint downloads with their sizes before fetching them, installs the prebuilt engine, downloads and verifies this checkpoint, and starts an OpenAI-compatible server on `127.0.0.1:8000`; requests name the model `flash-next-v2` (also `flash-next`). Enter takes the recommended answer at each question; `--yes` takes them all, `--dry-run` shows the plan. Run `./setup.sh` again to start the server, and `git pull && ./setup.sh` to update the engine without downloading the model again.
|
| 216 |
+
|
| 217 |
+
> [!IMPORTANT]
|
| 218 |
+
> This checkpoint needs the Merlin engine; stock vLLM was not tested with it.
|
| 219 |
+
|
| 220 |
+
<details>
|
| 221 |
+
<summary><b>Manual install</b></summary>
|
| 222 |
|
| 223 |
```bash
|
| 224 |
+
git clone https://github.com/halt95/merlin-engine.git && cd merlin-engine
|
| 225 |
+
curl -LO https://github.com/halt95/merlin-engine/releases/download/merlin-v3.0.0/vllm-0.32.0+merlin.7002f56537-cp313-cp313-linux_x86_64.whl
|
| 226 |
+
MERLIN_WHEEL="$PWD/vllm-0.32.0+merlin.7002f56537-cp313-cp313-linux_x86_64.whl" \
|
| 227 |
+
bash release/install-env.sh ./venv
|
| 228 |
+
|
| 229 |
+
venv/bin/hf download halt95/Qwen3.8-Flash-Next-W4A16-Merlin \
|
| 230 |
+
--local-dir ~/models/flash-next
|
| 231 |
+
(cd ~/models/flash-next && sha256sum -c "$OLDPWD/models/flash-next/checkpoint.sha256")
|
| 232 |
+
venv/bin/python merlin_cli.py serve ~/models/flash-next
|
| 233 |
```
|
| 234 |
|
| 235 |
+
`MERLIN_WHEEL` installs the prebuilt engine (sm_80, sm_86, sm_89), checked against `release/merlin-wheel.sha256`; without it the installer compiles the engine instead, about 1.5 hours on 8 cores. `merlin serve` recognises the checkpoint, picks the largest tested layout for the GPUs it finds (or, with none, the largest untested one that fits, labelled as such) and serves on `127.0.0.1:8000`. Add `--dry-run` to print the resolved command without starting anything. The first start compiles kernels.
|
|
|
|
|
|
|
| 236 |
|
| 237 |
+
</details>
|
| 238 |
|
| 239 |
+
**Recommended settings** (Qwen's, for this model):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
|
| 241 |
+
| Mode | temperature | top_p | top_k | presence_penalty |
|
| 242 |
+
|---|---|---|---|---|
|
| 243 |
+
| Thinking (default) | 1.0 | 0.95 | 20 | 0.0 |
|
| 244 |
+
| Non-thinking | 0.7 | 0.80 | 20 | 1.5 |
|
| 245 |
|
| 246 |
+
<sub>Qwen's recommendation for this model, with `min_p=0.0` and `repetition_penalty=1.0` in both modes. A `presence_penalty` between 0 and 2 reduces endless repetition; higher values can mix languages.</sub>
|
|
|
|
|
|
|
| 247 |
|
| 248 |
+
- Turn thinking off for a request with `"chat_template_kwargs": {"enable_thinking": false}`. With thinking on, a short `max_tokens` can end inside the reasoning with empty `content`.
|
| 249 |
+
- Reasoning effort: Merlin serves `medium` by default; pick another per request with `"chat_template_kwargs": {"reasoning_effort": "low"}` (`low` / `medium` / `xhigh`).
|
| 250 |
+
- Chat template: Merlin serves [Froggeric's fixed Qwen3.8 template](https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates) (v22.5) by default, not the file in this repository. It accepts system messages after the first turn, so coding agents' per-turn notes stay in place and the prefix cache keeps hitting. `CHAT_TEMPLATE=<path>` serves another template; `CHAT_TEMPLATE=` (empty) serves this repository's own.
|
| 251 |
+
- With Qwen's own template (`CHAT_TEMPLATE=`), earlier turns' reasoning is kept by default and `"chat_template_kwargs": {"preserve_thinking": false}` keeps only the latest.
|
| 252 |
+
- Images: up to 42 per request (the launcher's cap), 8 MP each; four 8 MP images in one prompt were checked on the Flash-Next checkpoint.
|
| 253 |
+
- Tool calls use the standard `tools` field, parsed with the Qwen3 coder tool parser.
|
| 254 |
+
- To reach it from other machines, answer `network` at setup's Access question (it generates an API key), or start `merlin serve` with `HOST=0.0.0.0` and `VLLM_API_KEY` set; put a TLS reverse proxy in front before opening it beyond your own network.
|
| 255 |
|
| 256 |
+
## The base model
|
| 257 |
|
| 258 |
+
Qwen3.8-Flash-Next is Qwen's preview of the architecture behind Qwen4. What changed, in short:
|
| 259 |
|
| 260 |
+
- **Hybrid attention.** Three Gated DeltaNet (linear-attention) layers for every Qwen Sparse Attention layer. QSA attends over micro-blocks instead of single tokens, which keeps long-context latency down.
|
| 261 |
+
- **Sparse experts.** 512 experts per layer with 10 routed and 1 shared active per token: 6B of the 125B parameters do the work for each token.
|
| 262 |
+
- **N-gram embedding.** A 51B-parameter bigram/trigram table at layer 2 adds parameter capacity with less computation than adding experts would. Merlin keeps it in host RAM, so the VRAM goes to KV cache.
|
| 263 |
+
- **Gated residual.** Widened residual streams with a data-dependent read gate and a per-branch write gate.
|
| 264 |
+
- **Multi-token prediction.** One MTP layer, trained over several steps; Merlin uses it for speculative decoding.
|
| 265 |
+
- **Thinking by default**, with a non-thinking mode per request; Qwen's template keeps earlier turns' reasoning by default (preserved thinking).
|
| 266 |
+
|
| 267 |
+
| Property | Qwen3.8-Flash-Next |
|
| 268 |
|---|---|
|
| 269 |
+
| Type | Causal language model with a vision encoder (images and video) |
|
| 270 |
+
| Parameters | 125B total, 6B active, plus 51B n-gram embedding and 4B MTP |
|
| 271 |
+
| Layers | 48: 12 × (3 × Gated DeltaNet → MoE, then 1 × Qwen Sparse Attention → MoE) |
|
| 272 |
+
| Experts | 512 per layer; 10 routed + 1 shared active; expert width 640 |
|
| 273 |
+
| Attention | QSA: 24 query / 2 KV heads, head dim 256, budget 512 blocks or 2,048 tokens · Gated DeltaNet: 48 V / 16 QK heads, head dim 128 |
|
| 274 |
+
| Context | 262,144 tokens native (Qwen: extensible to 1M with YaRN; this build serves 262,144) |
|
| 275 |
|
| 276 |
+
<sub>Architecture as reported by Qwen on the [upstream card](https://huggingface.co/Qwen/Qwen3.8-Flash-Next).</sub>
|
| 277 |
|
| 278 |
+
## Other builds
|
| 279 |
+
|
| 280 |
+
| Checkpoint | Base | GPUs | Decode at 262K |
|
| 281 |
+
|---|---|---|---|
|
| 282 |
+
| **Flash-Next (this card)** | **Qwen3.8-Flash-Next, 125B MoE** | **4× 3090** | **184 tok/s** |
|
| 283 |
+
| [Swift1.5](https://huggingface.co/halt95/Swift1.5-Qwen3.8-Flash-Next-W4A16-Merlin) | Flash-Next fine-tune | 4× 3090 | 177 tok/s |
|
| 284 |
+
| [Swift1.5-Huihui](https://huggingface.co/halt95/Swift1.5-Huihui-Qwen3.8-Flash-Next-W4A16-Merlin) | Swift1.5, abliterated | 4× 3090 | 189 tok/s |
|
| 285 |
+
| [Qwen3.8-27B](https://huggingface.co/halt95/Qwen3.8-27B-W4A16-Merlin) | Qwen3.8-27B, dense | 2× or 4× 3090 | 142 / 215 tok/s |
|
| 286 |
+
| [ThinkingCap](https://huggingface.co/halt95/ThinkingCap-Qwen3.8-27B-W4A16-Merlin) | Qwen3.8-27B fine-tune | 2× or 4× 3090 | 165 / 248 tok/s |
|
| 287 |
+
| [Nemotron 3.5 Super VL](https://huggingface.co/halt95/Nemotron-3.5-Super-VL-120B-A12B-W4A16-Merlin) | Nemotron 3.5 Super VL, 120B-A12B MoE | 4× 3090 | 91 tok/s |
|
| 288 |
+
| [Ornith 1.5](https://huggingface.co/halt95/Ornith-1.5-122B-A10B-W4A16-Merlin) | Qwen3.5-122B-A10B fine-tune (ornith-ai), 122B MoE | 4× 3090 | 100 tok/s |
|
| 289 |
+
|
| 290 |
+
<sub>One stream, thinking on, 261,888 prompt tokens + 128 out, median of 3; Merlin 3.0.0, 2026-10-20 bench cards. Effort as each bench card ran it: Flash-Next low; Swift1.5, Swift1.5-Huihui and ThinkingCap xhigh; Qwen3.8-27B medium. Merlin now serves `medium` on every Qwen3.8 checkpoint by default. Nemotron and Ornith 1.5 ran at full thinking: neither template reads `reasoning_effort`. Ornith 1.5 was measured on 2026-10-21 on the reference host with its engine changes (uniform MoE verify on) before they merged into 3.0.0.</sub>
|
| 291 |
|
| 292 |
## Good to know
|
| 293 |
|
| 294 |
+
- Every figure we measured for this checkpoint comes from one setup: 4× RTX 3090 at 220 W, PCIe Gen4 x16 with P2P, except the rented-host row under Other GPUs; upstream results and the Other builds rows use their stated setups. Hosts without P2P use the no-P2P profiles (see [What it fits on](#what-it-fits-on)).
|
| 295 |
+
- Only if you shrink the KV pool yourself: keep it larger than `--max-model-len` plus a few blocks. With the shipped settings this cannot occur.
|
| 296 |
+
- Coming from the `qwen38-flash-next-3090s` engine (v2.x or earlier)? It is replaced by the [Merlin engine](https://github.com/halt95/merlin-engine); this checkpoint's files are unchanged.
|
| 297 |
+
|
| 298 |
+
## Changes
|
| 299 |
+
|
| 300 |
+
| Date | Change to this repository |
|
| 301 |
+
|---|---|
|
| 302 |
+
| 2026-10-06 | `tokenizer.json` replaced with the upstream file; re-fetch it if you downloaded earlier |
|
| 303 |
+
| 2026-09-18 | `config.json` gains `ple_embedding_dtype` in `text_config`, which the engine needs since v2; re-fetch it if you downloaded earlier |
|
| 304 |
+
| 2026-09-08 | Weights published; unchanged since |
|
| 305 |
+
|
| 306 |
+
<sub>Card-only edits are not listed. Engine releases and their speed changes: the engine's [CHANGELOG](https://github.com/halt95/merlin-engine/blob/main/CHANGELOG.md).</sub>
|
| 307 |
|
| 308 |
+
## Credits and licence
|
| 309 |
|
| 310 |
+
Qwen (model; Qwen Community License 1.0, see `LICENSE`), Intel (AutoRound experts), RadixArk (FP8 PLE table), DominikBucko (MTP packing recipe), [froggeric](https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates) (the fixed Qwen3.8 chat template the engine serves), the vLLM community PLE-offload work, aikitoria (peer-to-peer on consumer Ampere), [Neiko2002](https://huggingface.co/Neiko2002), and [CoolShades](https://github.com/CoolShades) (the idle-power report behind the v2.5.2 engine fix). Upstream fixes are credited in the engine repository.
|
|
|
|
|
|
assets/hero.png
ADDED
|
Git LFS Details
|
assets/speed.png
ADDED
|
Git LFS Details
|