Text Generation
Transformers
GGUF
Safetensors
qwen3
dflash2
speculative-decoding
block-diffusion
draft-model
sglang
vllm
text-generation-inference
conversational
Instructions to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Anbeeld/Qwen3.8-27B-DFlash2-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Anbeeld/Qwen3.8-27B-DFlash2-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Anbeeld/Qwen3.8-27B-DFlash2-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 Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
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 Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
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 Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Anbeeld/Qwen3.8-27B-DFlash2-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": "Anbeeld/Qwen3.8-27B-DFlash2-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
- SGLang
How to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Anbeeld/Qwen3.8-27B-DFlash2-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Anbeeld/Qwen3.8-27B-DFlash2-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Anbeeld/Qwen3.8-27B-DFlash2-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Anbeeld/Qwen3.8-27B-DFlash2-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with Ollama:
ollama run hf.co/Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with Docker Model Runner:
docker model run hf.co/Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
- Lemonade
How to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3.8-27B-DFlash2-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Anbeeld/Qwen3.8-27B-DFlash2-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 Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
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 Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Anbeeld/Qwen3.8-27B-DFlash2-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M
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 "Anbeeld/Qwen3.8-27B-DFlash2-GGUF:Q4_K_M" \ --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"
Restore README image asset
Browse files
README.md
CHANGED
|
@@ -1,285 +1,285 @@
|
|
| 1 |
-
---
|
| 2 |
-
base_model: incoai/Qwen3.8-27B-DFlash2
|
| 3 |
-
tags:
|
| 4 |
-
- transformers
|
| 5 |
-
- safetensors
|
| 6 |
-
- qwen3
|
| 7 |
-
- dflash2
|
| 8 |
-
- speculative-decoding
|
| 9 |
-
- block-diffusion
|
| 10 |
-
- draft-model
|
| 11 |
-
- sglang
|
| 12 |
-
- vllm
|
| 13 |
-
- text-generation
|
| 14 |
-
- base_model:Qwen/Qwen3.8-27B
|
| 15 |
-
- base_model:finetune:Qwen/Qwen3.8-27B
|
| 16 |
-
- license:apache-2.0
|
| 17 |
-
- text-generation-inference
|
| 18 |
-
- region:us
|
| 19 |
-
---
|
| 20 |
-
|
| 21 |
-
# Qwen 3.8 27B DFlash2 GGUF
|
| 22 |
-
|
| 23 |
-
GGUF quantizations of [**Inco AI DFlash2 draft model**](https://huggingface.co/incoai/Qwen3.8-27B-DFlash2) for [**Qwen 3.8 27B**](https://huggingface.co/Qwen/Qwen3.8-27B).
|
| 24 |
-
|
| 25 |
-
Use with [BeeLlama.cpp](https://github.com/Anbeeld/beellama.cpp), a llama.cpp fork with advanced quantization features.
|
| 26 |
-
|
| 27 |
-
## Benchmark results
|
| 28 |
-
|
| 29 |
-
### Machine configuration
|
| 30 |
-
|
| 31 |
-
- OS: Windows 11 Pro
|
| 32 |
-
- CPU: AMD Ryzen 9 9950X 16-Core Processor
|
| 33 |
-
- GPU: NVIDIA GeForce RTX 3090
|
| 34 |
-
- Server CPU thread pool: 16 threads
|
| 35 |
-
|
| 36 |
-
### Test setup
|
| 37 |
-
|
| 38 |
-
- Runtime: [BeeLlama.cpp v0.4.4](https://github.com/Anbeeld/beellama.cpp), CUDA 13.1
|
| 39 |
-
- Target model: [Qwen3.8-27B-UD-Q4_K_M](https://huggingface.co/unsloth/Qwen3.8-27B-GGUF)
|
| 40 |
-
- 15 generations per each prompt + quant pair
|
| 41 |
-
- DFlash2 setup: 7 draft tokens per block
|
| 42 |
-
- Context: 8192 tokens
|
| 43 |
-
- Batch size 4096, micro-batch size 1024
|
| 44 |
-
- Temperature 1.0, top-p 0.95, top-k 20
|
| 45 |
-
- Reasoning disabled
|
| 46 |
-
|
| 47 |
-
### Task store module
|
| 48 |
-
|
| 49 |
-
<details>
|
| 50 |
-
<summary>Show prompt</summary>
|
| 51 |
-
|
| 52 |
-
```text
|
| 53 |
-
Write one complete Python 3 file using only the standard library.
|
| 54 |
-
|
| 55 |
-
Return only Python code. Do not use markdown, comments, tests, examples, or explanatory text.
|
| 56 |
-
|
| 57 |
-
Implement a deterministic Task store module with a compact, repetitive structure that is easy to predict.
|
| 58 |
-
|
| 59 |
-
Required shape:
|
| 60 |
-
- imports: dataclasses, datetime, typing
|
| 61 |
-
- dataclass Task with fields id: int, title: str, status: str, created_at: str
|
| 62 |
-
- class TaskStore with an internal dict[int, Task]
|
| 63 |
-
- methods: add, get, rename, mark_done, reopen, delete, clear, list_all, list_open, list_done, count_open, count_done, titles, to_dicts, __len__, __contains__
|
| 64 |
-
- add assigns increasing integer ids starting at 1
|
| 65 |
-
- valid statuses are "open" and "done"
|
| 66 |
-
- all list methods return tasks sorted by id
|
| 67 |
-
- count_open and count_done use explicit loops
|
| 68 |
-
- titles returns task titles sorted by task id
|
| 69 |
-
- to_dicts returns deterministic dictionaries sorted by id
|
| 70 |
-
- to_dicts includes id, title, status, and created_at keys for every task
|
| 71 |
-
- raise ValueError for empty title or missing task id
|
| 72 |
-
- use straightforward if statements and explicit loops
|
| 73 |
-
- keep method bodies short and similar in style
|
| 74 |
-
- no argparse, no JSON, no file IO, no unittest, no pytest
|
| 75 |
-
- target about 110 to 132 lines of code
|
| 76 |
-
- define __all__ = ["Task", "TaskStore"]
|
| 77 |
-
- stop immediately after defining __all__
|
| 78 |
-
```
|
| 79 |
-
|
| 80 |
-
</details>
|
| 81 |
-
|
| 82 |
-
| Quant type | Size (MB) | Mean length | Median tok/s | Mean tok/s | Median AR | Mean AR |
|
| 83 |
-
|---|---:|---:|---:|---:|---:|---:|
|
| 84 |
-
| Baseline | n/a | 897.93 | 42.222 | 42.237 | n/a | n/a |
|
| 85 |
-
| Q2_K | 705.43 | 891.20 | 109.128 | 109.079 | 0.912 | 0.913 |
|
| 86 |
-
| Q3_K_M | 916.70 | 891.20 | 108.330 | 108.747 | 0.916 | 0.915 |
|
| 87 |
-
| Q4_K_M | 1,143.01 | 893.00 | 108.123 | 107.906 | 0.910 | 0.908 |
|
| 88 |
-
| Q5_K_M | 1,359.93 | 899.87 | 107.408 | 107.332 | 0.906 | 0.907 |
|
| 89 |
-
| Q6_K | 1,590.41 | 906.80 | 106.738 | 107.123 | 0.895 | 0.900 |
|
| 90 |
-
| Q8_0 | 2,056.41 | 890.93 | 109.767 | 109.067 | 0.916 | 0.911 |
|
| 91 |
-
| bf16 | 3,860.29 | 899.47 | 108.508 | 108.468 | 0.915 | 0.914 |
|
| 92 |
-
|
| 93 |
-
### Key-value report module
|
| 94 |
-
|
| 95 |
-
<details>
|
| 96 |
-
<summary>Show prompt</summary>
|
| 97 |
-
|
| 98 |
-
```text
|
| 99 |
-
Write one complete Python 3 file using only the standard library.
|
| 100 |
-
|
| 101 |
-
Return only Python code. Do not use markdown, comments, tests, examples, or explanatory text.
|
| 102 |
-
|
| 103 |
-
Implement a deterministic KV report module with a compact, repetitive structure that is easy to predict.
|
| 104 |
-
|
| 105 |
-
Required shape:
|
| 106 |
-
- imports: dataclasses, typing
|
| 107 |
-
- dataclass Row with fields key: str, value: str
|
| 108 |
-
- class Report with an internal list[Row]
|
| 109 |
-
- methods: add, set, get, delete, clear, keys, values, items, sorted_rows, render_lines, render_text, render_csv, filter_prefix, update_many, to_dict, copy, count_prefix, first_key, __len__, __contains__
|
| 110 |
-
- add appends a new row and rejects duplicate keys
|
| 111 |
-
- set updates an existing row or appends a new row
|
| 112 |
-
- get returns the value for a key
|
| 113 |
-
- delete removes a row by key
|
| 114 |
-
- keys, values, and items preserve insertion order
|
| 115 |
-
- sorted_rows returns rows sorted by key
|
| 116 |
-
- render_lines returns strings formatted as "key: value"
|
| 117 |
-
- render_text joins render_lines with newline characters
|
| 118 |
-
- render_csv returns deterministic "key,value" lines with a header
|
| 119 |
-
- filter_prefix returns a new Report containing keys that start with the prefix
|
| 120 |
-
- update_many applies set for each key and value in a dictionary sorted by key
|
| 121 |
-
- to_dict returns a deterministic dictionary sorted by key
|
| 122 |
-
- copy returns a new Report with the same rows in the same order
|
| 123 |
-
- count_prefix returns the number of keys that start with the prefix using an explicit loop
|
| 124 |
-
- first_key returns the first key and raises ValueError when there are no rows
|
| 125 |
-
- raise ValueError for empty keys, duplicate keys, or missing keys
|
| 126 |
-
- use straightforward if statements and explicit loops
|
| 127 |
-
- keep method bodies short and similar in style
|
| 128 |
-
- no enum, no alignment modes, no markdown table, no textwrap, no itertools, no unittest, no pytest
|
| 129 |
-
- target about 130 to 155 lines of code
|
| 130 |
-
- define __all__ = ["Row", "Report"]
|
| 131 |
-
- stop immediately after defining __all__
|
| 132 |
-
```
|
| 133 |
-
|
| 134 |
-
</details>
|
| 135 |
-
|
| 136 |
-
| Quant type | Size (MB) | Mean length | Median tok/s | Mean tok/s | Median AR | Mean AR |
|
| 137 |
-
|---|---:|---:|---:|---:|---:|---:|
|
| 138 |
-
| Baseline | n/a | 1,026.60 | 41.865 | 41.829 | n/a | n/a |
|
| 139 |
-
| Q2_K | 705.43 | 980.80 | 105.876 | 105.453 | 0.888 | 0.886 |
|
| 140 |
-
| Q3_K_M | 916.70 | 1,007.53 | 105.543 | 105.158 | 0.885 | 0.883 |
|
| 141 |
-
| Q4_K_M | 1,143.01 | 1,002.20 | 106.475 | 105.659 | 0.895 | 0.890 |
|
| 142 |
-
| Q5_K_M | 1,359.93 | 1,003.00 | 104.483 | 104.082 | 0.886 | 0.883 |
|
| 143 |
-
| Q6_K | 1,590.41 | 1,022.80 | 107.050 | 106.483 | 0.900 | 0.894 |
|
| 144 |
-
| Q8_0 | 2,056.41 | 992.40 | 108.184 | 108.047 | 0.893 | 0.895 |
|
| 145 |
-
| bf16 | 3,860.29 | 1,001.47 | 103.355 | 103.295 | 0.874 | 0.878 |
|
| 146 |
-
|
| 147 |
-
---
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
# Qwen3.8-27B-DFlash2
|
| 151 |
-
|
| 152 |
-
[Blog](https://inco.ai/blog/dflash2/) | [GitHub](https://github.com/z-lab/dflash)
|
| 153 |
-
|
| 154 |
-
This repository contains the DFlash 2 draft model for
|
| 155 |
-
[`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B).
|
| 156 |
-
It is not a standalone language model: it runs inside a speculative
|
| 157 |
-
decoding server and drafts tokens for the target model to verify. The checkpoint is also
|
| 158 |
-
mirrored at [`z-lab/Qwen3.8-27B-DFlash2`](https://huggingface.co/z-lab/Qwen3.8-27B-DFlash2).
|
| 159 |
-
|
| 160 |
-
DFlash 2 is a block-diffusion drafter for speculative decoding. It predicts
|
| 161 |
-
a whole block of tokens in a single pass and keeps the top candidates at
|
| 162 |
-
every position. A lightweight selector then traces one coherent path through them.
|
| 163 |
-
Two-tap dynamic convolutions in the backbone keep the draft from decaying
|
| 164 |
-
toward the end of the block. Decoding is lossless: greedy output
|
| 165 |
-
matches the target model exactly, and sampling preserves its distribution.
|
| 166 |
-
|
| 167 |
-
<div align="center">
|
| 168 |
-
<img src="
|
| 169 |
-
</div>
|
| 170 |
-
|
| 171 |
-
## Quick Start
|
| 172 |
-
|
| 173 |
-
Serve with [SGLang](https://github.com/sgl-project/sglang):
|
| 174 |
-
|
| 175 |
-
```bash
|
| 176 |
-
pip install "sglang[all] @ git+https://github.com/sgl-project/sglang.git#subdirectory=python"
|
| 177 |
-
|
| 178 |
-
python -m sglang.launch_server \
|
| 179 |
-
--model-path Qwen/Qwen3.8-27B \
|
| 180 |
-
--speculative-algorithm DFLASH \
|
| 181 |
-
--speculative-draft-model-path incoai/Qwen3.8-27B-DFlash2 \
|
| 182 |
-
--speculative-num-draft-tokens 8
|
| 183 |
-
```
|
| 184 |
-
|
| 185 |
-
Or with [vLLM](https://github.com/vllm-project/vllm):
|
| 186 |
-
|
| 187 |
-
```bash
|
| 188 |
-
pip install -U "vllm @ git+https://github.com/vllm-project/vllm.git@refs/pull/52816/head"
|
| 189 |
-
|
| 190 |
-
vllm serve Qwen/Qwen3.8-27B \
|
| 191 |
-
--speculative-config '{
|
| 192 |
-
"method": "dflash",
|
| 193 |
-
"model": "incoai/Qwen3.8-27B-DFlash2",
|
| 194 |
-
"num_speculative_tokens": 7
|
| 195 |
-
}'
|
| 196 |
-
```
|
| 197 |
-
|
| 198 |
-
See the [blog post](https://inco.ai/blog/dflash2/) for other engines and more details.
|
| 199 |
-
|
| 200 |
-
## Evaluation
|
| 201 |
-
|
| 202 |
-
- Runtime: SGLang on one NVIDIA H200, with FlashAttention 3 for target and draft attention
|
| 203 |
-
- Speculation block size: 8 (7 draft tokens per verification step)
|
| 204 |
-
- Sampling: Qwen3.8's officially recommended parameters (temperature 1.0, top-p 0.95, top-k 20), with `xhigh` reasoning effort
|
| 205 |
-
- Maximum new tokens: 4096
|
| 206 |
-
- Prompts: benchmark formatting from [`z-lab/dflash`](https://github.com/z-lab/dflash)
|
| 207 |
-
|
| 208 |
-
We compare autoregressive decoding, Qwen3.8's built-in seven-token MTP,
|
| 209 |
-
a community DSpark drafter
|
| 210 |
-
([`RadixArk/Qwen3.8-27B-DSpark`](https://huggingface.co/RadixArk/Qwen3.8-27B-DSpark)),
|
| 211 |
-
and DFlash 2. All speculative methods propose seven draft tokens per
|
| 212 |
-
verification step.
|
| 213 |
-
|
| 214 |
-
### Acceptance Length
|
| 215 |
-
|
| 216 |
-
Acceptance length is the per-request mean of completion tokens divided by verification steps.
|
| 217 |
-
Higher is better.
|
| 218 |
-
|
| 219 |
-
| Task | MTP | DSpark | DFlash 2 |
|
| 220 |
-
| :--- | ---: | ---: | ---: |
|
| 221 |
-
| GSM8K | 5.02 | 4.36 | **5.46** |
|
| 222 |
-
| MATH-500 | 4.72 | 3.92 | **5.28** |
|
| 223 |
-
| HumanEval | 3.91 | 3.30 | **4.39** |
|
| 224 |
-
| MBPP | 3.99 | 3.51 | **4.79** |
|
| 225 |
-
| MT-Bench | 3.74 | 3.01 | **4.10** |
|
| 226 |
-
|
| 227 |
-
### Throughput
|
| 228 |
-
|
| 229 |
-
Throughput is total output tokens divided by end-to-end wall time.
|
| 230 |
-
Each cell shows `output tok/s (speedup vs. autoregressive)`.
|
| 231 |
-
|
| 232 |
-
#### Concurrency 1
|
| 233 |
-
|
| 234 |
-
| Task | Autoregressive | MTP | DSpark | DFlash 2 |
|
| 235 |
-
| :--- | ---: | ---: | ---: | ---: |
|
| 236 |
-
| GSM8K | 68.9 | 178.5 (2.59×) | 185.3 (2.69×) | **236.1 (3.43×)** |
|
| 237 |
-
| MATH-500 | 69.0 | 172.8 (2.51×) | 174.5 (2.53×) | **230.7 (3.34×)** |
|
| 238 |
-
| HumanEval | 69.0 | 151.9 (2.20×) | 159.9 (2.32×) | **214.6 (3.11×)** |
|
| 239 |
-
| MBPP | 69.0 | 153.1 (2.22×) | 163.3 (2.37×) | **226.9 (3.29×)** |
|
| 240 |
-
| MT-Bench | 68.9 | 134.9 (1.96×) | 137.6 (2.00×) | **184.0 (2.67×)** |
|
| 241 |
-
|
| 242 |
-
#### Concurrency 8
|
| 243 |
-
|
| 244 |
-
| Task | Autoregressive | MTP | DSpark | DFlash 2 |
|
| 245 |
-
| :--- | ---: | ---: | ---: | ---: |
|
| 246 |
-
| GSM8K | 467.2 | 1,022.1 (2.19×) | 1,040.8 (2.23×) | **1,328.7 (2.84×)** |
|
| 247 |
-
| MATH-500 | 480.0 | 1,023.5 (2.13×) | 1,025.8 (2.14×) | **1,368.3 (2.85×)** |
|
| 248 |
-
| HumanEval | 483.4 | 934.2 (1.93×) | 956.5 (1.98×) | **1,291.5 (2.67×)** |
|
| 249 |
-
| MBPP | 478.0 | 938.1 (1.96×) | 974.1 (2.04×) | **1,328.0 (2.78
|
| 250 |
-
| MT-Bench | 480.5 | 835.2 (1.74×) | 802.3 (1.67×) | **1,090.2 (2.27×)** |
|
| 251 |
-
|
| 252 |
-
#### Concurrency 32
|
| 253 |
-
|
| 254 |
-
| Task | Autoregressive | MTP | DSpark | DFlash 2 |
|
| 255 |
-
| :--- | ---: | ---: | ---: | ---: |
|
| 256 |
-
| GSM8K | 1,329.8 | 1,381.1 (1.04×) | 1,506.5 (1.13×) | **1,922.5 (1.45×)** |
|
| 257 |
-
| MATH-500 | 1,505.8 | 1,415.6 (0.94×) | 1,429.0 (0.95×) | **1,951.8 (1.30×)** |
|
| 258 |
-
| HumanEval | 1,546.5 | 1,296.8 (0.84×) | 1,330.1 (0.86×) | **1,799.0 (1.16×)** |
|
| 259 |
-
| MBPP | 1,507.7 | 1,314.9 (0.87×) | 1,361.3 (0.90×) | **1,886.8 (1.25×)** |
|
| 260 |
-
| MT-Bench | 1,507.4 | 1,159.7 (0.77×) | 1,115.5 (0.74×) | **1,525.3 (1.01×)** |
|
| 261 |
-
|
| 262 |
-
## Citation
|
| 263 |
-
|
| 264 |
-
If you find DFlash 2 useful, please cite:
|
| 265 |
-
|
| 266 |
-
```bibtex
|
| 267 |
-
@misc{inco2026dflash2,
|
| 268 |
-
title = {{DFlash 2: Keep Drafting Parallel}},
|
| 269 |
-
author = {{Inco AI}},
|
| 270 |
-
year = {2026},
|
| 271 |
-
month = {August},
|
| 272 |
-
url = {https://inco.ai/blog/dflash2/}
|
| 273 |
-
}
|
| 274 |
-
```
|
| 275 |
-
|
| 276 |
-
Please also cite the original DFlash paper:
|
| 277 |
-
|
| 278 |
-
```bibtex
|
| 279 |
-
@inproceedings{chen2026dflash,
|
| 280 |
-
title = {{DFlash: Block Diffusion for Flash Speculative Decoding}},
|
| 281 |
-
author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
|
| 282 |
-
booktitle = {International Conference on Machine Learning (ICML)},
|
| 283 |
-
year = {2026}
|
| 284 |
-
}
|
| 285 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: incoai/Qwen3.8-27B-DFlash2
|
| 3 |
+
tags:
|
| 4 |
+
- transformers
|
| 5 |
+
- safetensors
|
| 6 |
+
- qwen3
|
| 7 |
+
- dflash2
|
| 8 |
+
- speculative-decoding
|
| 9 |
+
- block-diffusion
|
| 10 |
+
- draft-model
|
| 11 |
+
- sglang
|
| 12 |
+
- vllm
|
| 13 |
+
- text-generation
|
| 14 |
+
- base_model:Qwen/Qwen3.8-27B
|
| 15 |
+
- base_model:finetune:Qwen/Qwen3.8-27B
|
| 16 |
+
- license:apache-2.0
|
| 17 |
+
- text-generation-inference
|
| 18 |
+
- region:us
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# Qwen 3.8 27B DFlash2 GGUF
|
| 22 |
+
|
| 23 |
+
GGUF quantizations of [**Inco AI DFlash2 draft model**](https://huggingface.co/incoai/Qwen3.8-27B-DFlash2) for [**Qwen 3.8 27B**](https://huggingface.co/Qwen/Qwen3.8-27B).
|
| 24 |
+
|
| 25 |
+
Use with [BeeLlama.cpp](https://github.com/Anbeeld/beellama.cpp), a llama.cpp fork with advanced quantization features.
|
| 26 |
+
|
| 27 |
+
## Benchmark results
|
| 28 |
+
|
| 29 |
+
### Machine configuration
|
| 30 |
+
|
| 31 |
+
- OS: Windows 11 Pro
|
| 32 |
+
- CPU: AMD Ryzen 9 9950X 16-Core Processor
|
| 33 |
+
- GPU: NVIDIA GeForce RTX 3090
|
| 34 |
+
- Server CPU thread pool: 16 threads
|
| 35 |
+
|
| 36 |
+
### Test setup
|
| 37 |
+
|
| 38 |
+
- Runtime: [BeeLlama.cpp v0.4.4](https://github.com/Anbeeld/beellama.cpp), CUDA 13.1
|
| 39 |
+
- Target model: [Qwen3.8-27B-UD-Q4_K_M](https://huggingface.co/unsloth/Qwen3.8-27B-GGUF)
|
| 40 |
+
- 15 generations per each prompt + quant pair
|
| 41 |
+
- DFlash2 setup: 7 draft tokens per block
|
| 42 |
+
- Context: 8192 tokens
|
| 43 |
+
- Batch size 4096, micro-batch size 1024
|
| 44 |
+
- Temperature 1.0, top-p 0.95, top-k 20
|
| 45 |
+
- Reasoning disabled
|
| 46 |
+
|
| 47 |
+
### Task store module
|
| 48 |
+
|
| 49 |
+
<details>
|
| 50 |
+
<summary>Show prompt</summary>
|
| 51 |
+
|
| 52 |
+
```text
|
| 53 |
+
Write one complete Python 3 file using only the standard library.
|
| 54 |
+
|
| 55 |
+
Return only Python code. Do not use markdown, comments, tests, examples, or explanatory text.
|
| 56 |
+
|
| 57 |
+
Implement a deterministic Task store module with a compact, repetitive structure that is easy to predict.
|
| 58 |
+
|
| 59 |
+
Required shape:
|
| 60 |
+
- imports: dataclasses, datetime, typing
|
| 61 |
+
- dataclass Task with fields id: int, title: str, status: str, created_at: str
|
| 62 |
+
- class TaskStore with an internal dict[int, Task]
|
| 63 |
+
- methods: add, get, rename, mark_done, reopen, delete, clear, list_all, list_open, list_done, count_open, count_done, titles, to_dicts, __len__, __contains__
|
| 64 |
+
- add assigns increasing integer ids starting at 1
|
| 65 |
+
- valid statuses are "open" and "done"
|
| 66 |
+
- all list methods return tasks sorted by id
|
| 67 |
+
- count_open and count_done use explicit loops
|
| 68 |
+
- titles returns task titles sorted by task id
|
| 69 |
+
- to_dicts returns deterministic dictionaries sorted by id
|
| 70 |
+
- to_dicts includes id, title, status, and created_at keys for every task
|
| 71 |
+
- raise ValueError for empty title or missing task id
|
| 72 |
+
- use straightforward if statements and explicit loops
|
| 73 |
+
- keep method bodies short and similar in style
|
| 74 |
+
- no argparse, no JSON, no file IO, no unittest, no pytest
|
| 75 |
+
- target about 110 to 132 lines of code
|
| 76 |
+
- define __all__ = ["Task", "TaskStore"]
|
| 77 |
+
- stop immediately after defining __all__
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
</details>
|
| 81 |
+
|
| 82 |
+
| Quant type | Size (MB) | Mean length | Median tok/s | Mean tok/s | Median AR | Mean AR |
|
| 83 |
+
|---|---:|---:|---:|---:|---:|---:|
|
| 84 |
+
| Baseline | n/a | 897.93 | 42.222 | 42.237 | n/a | n/a |
|
| 85 |
+
| Q2_K | 705.43 | 891.20 | 109.128 | 109.079 | 0.912 | 0.913 |
|
| 86 |
+
| Q3_K_M | 916.70 | 891.20 | 108.330 | 108.747 | 0.916 | 0.915 |
|
| 87 |
+
| Q4_K_M | 1,143.01 | 893.00 | 108.123 | 107.906 | 0.910 | 0.908 |
|
| 88 |
+
| Q5_K_M | 1,359.93 | 899.87 | 107.408 | 107.332 | 0.906 | 0.907 |
|
| 89 |
+
| Q6_K | 1,590.41 | 906.80 | 106.738 | 107.123 | 0.895 | 0.900 |
|
| 90 |
+
| Q8_0 | 2,056.41 | 890.93 | 109.767 | 109.067 | 0.916 | 0.911 |
|
| 91 |
+
| bf16 | 3,860.29 | 899.47 | 108.508 | 108.468 | 0.915 | 0.914 |
|
| 92 |
+
|
| 93 |
+
### Key-value report module
|
| 94 |
+
|
| 95 |
+
<details>
|
| 96 |
+
<summary>Show prompt</summary>
|
| 97 |
+
|
| 98 |
+
```text
|
| 99 |
+
Write one complete Python 3 file using only the standard library.
|
| 100 |
+
|
| 101 |
+
Return only Python code. Do not use markdown, comments, tests, examples, or explanatory text.
|
| 102 |
+
|
| 103 |
+
Implement a deterministic KV report module with a compact, repetitive structure that is easy to predict.
|
| 104 |
+
|
| 105 |
+
Required shape:
|
| 106 |
+
- imports: dataclasses, typing
|
| 107 |
+
- dataclass Row with fields key: str, value: str
|
| 108 |
+
- class Report with an internal list[Row]
|
| 109 |
+
- methods: add, set, get, delete, clear, keys, values, items, sorted_rows, render_lines, render_text, render_csv, filter_prefix, update_many, to_dict, copy, count_prefix, first_key, __len__, __contains__
|
| 110 |
+
- add appends a new row and rejects duplicate keys
|
| 111 |
+
- set updates an existing row or appends a new row
|
| 112 |
+
- get returns the value for a key
|
| 113 |
+
- delete removes a row by key
|
| 114 |
+
- keys, values, and items preserve insertion order
|
| 115 |
+
- sorted_rows returns rows sorted by key
|
| 116 |
+
- render_lines returns strings formatted as "key: value"
|
| 117 |
+
- render_text joins render_lines with newline characters
|
| 118 |
+
- render_csv returns deterministic "key,value" lines with a header
|
| 119 |
+
- filter_prefix returns a new Report containing keys that start with the prefix
|
| 120 |
+
- update_many applies set for each key and value in a dictionary sorted by key
|
| 121 |
+
- to_dict returns a deterministic dictionary sorted by key
|
| 122 |
+
- copy returns a new Report with the same rows in the same order
|
| 123 |
+
- count_prefix returns the number of keys that start with the prefix using an explicit loop
|
| 124 |
+
- first_key returns the first key and raises ValueError when there are no rows
|
| 125 |
+
- raise ValueError for empty keys, duplicate keys, or missing keys
|
| 126 |
+
- use straightforward if statements and explicit loops
|
| 127 |
+
- keep method bodies short and similar in style
|
| 128 |
+
- no enum, no alignment modes, no markdown table, no textwrap, no itertools, no unittest, no pytest
|
| 129 |
+
- target about 130 to 155 lines of code
|
| 130 |
+
- define __all__ = ["Row", "Report"]
|
| 131 |
+
- stop immediately after defining __all__
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
</details>
|
| 135 |
+
|
| 136 |
+
| Quant type | Size (MB) | Mean length | Median tok/s | Mean tok/s | Median AR | Mean AR |
|
| 137 |
+
|---|---:|---:|---:|---:|---:|---:|
|
| 138 |
+
| Baseline | n/a | 1,026.60 | 41.865 | 41.829 | n/a | n/a |
|
| 139 |
+
| Q2_K | 705.43 | 980.80 | 105.876 | 105.453 | 0.888 | 0.886 |
|
| 140 |
+
| Q3_K_M | 916.70 | 1,007.53 | 105.543 | 105.158 | 0.885 | 0.883 |
|
| 141 |
+
| Q4_K_M | 1,143.01 | 1,002.20 | 106.475 | 105.659 | 0.895 | 0.890 |
|
| 142 |
+
| Q5_K_M | 1,359.93 | 1,003.00 | 104.483 | 104.082 | 0.886 | 0.883 |
|
| 143 |
+
| Q6_K | 1,590.41 | 1,022.80 | 107.050 | 106.483 | 0.900 | 0.894 |
|
| 144 |
+
| Q8_0 | 2,056.41 | 992.40 | 108.184 | 108.047 | 0.893 | 0.895 |
|
| 145 |
+
| bf16 | 3,860.29 | 1,001.47 | 103.355 | 103.295 | 0.874 | 0.878 |
|
| 146 |
+
|
| 147 |
+
---
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
# Qwen3.8-27B-DFlash2
|
| 151 |
+
|
| 152 |
+
[Blog](https://inco.ai/blog/dflash2/) | [GitHub](https://github.com/z-lab/dflash)
|
| 153 |
+
|
| 154 |
+
This repository contains the DFlash 2 draft model for
|
| 155 |
+
[`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B).
|
| 156 |
+
It is not a standalone language model: it runs inside a speculative
|
| 157 |
+
decoding server and drafts tokens for the target model to verify. The checkpoint is also
|
| 158 |
+
mirrored at [`z-lab/Qwen3.8-27B-DFlash2`](https://huggingface.co/z-lab/Qwen3.8-27B-DFlash2).
|
| 159 |
+
|
| 160 |
+
DFlash 2 is a block-diffusion drafter for speculative decoding. It predicts
|
| 161 |
+
a whole block of tokens in a single pass and keeps the top candidates at
|
| 162 |
+
every position. A lightweight selector then traces one coherent path through them.
|
| 163 |
+
Two-tap dynamic convolutions in the backbone keep the draft from decaying
|
| 164 |
+
toward the end of the block. Decoding is lossless: greedy output
|
| 165 |
+
matches the target model exactly, and sampling preserves its distribution.
|
| 166 |
+
|
| 167 |
+
<div align="center">
|
| 168 |
+
<img src="assets/dflash2-figure.png" alt="DFlash 2: parallel block drafting with a candidate path selector" width="100%">
|
| 169 |
+
</div>
|
| 170 |
+
|
| 171 |
+
## Quick Start
|
| 172 |
+
|
| 173 |
+
Serve with [SGLang](https://github.com/sgl-project/sglang):
|
| 174 |
+
|
| 175 |
+
```bash
|
| 176 |
+
pip install "sglang[all] @ git+https://github.com/sgl-project/sglang.git#subdirectory=python"
|
| 177 |
+
|
| 178 |
+
python -m sglang.launch_server \
|
| 179 |
+
--model-path Qwen/Qwen3.8-27B \
|
| 180 |
+
--speculative-algorithm DFLASH \
|
| 181 |
+
--speculative-draft-model-path incoai/Qwen3.8-27B-DFlash2 \
|
| 182 |
+
--speculative-num-draft-tokens 8
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
Or with [vLLM](https://github.com/vllm-project/vllm):
|
| 186 |
+
|
| 187 |
+
```bash
|
| 188 |
+
pip install -U "vllm @ git+https://github.com/vllm-project/vllm.git@refs/pull/52816/head"
|
| 189 |
+
|
| 190 |
+
vllm serve Qwen/Qwen3.8-27B \
|
| 191 |
+
--speculative-config '{
|
| 192 |
+
"method": "dflash",
|
| 193 |
+
"model": "incoai/Qwen3.8-27B-DFlash2",
|
| 194 |
+
"num_speculative_tokens": 7
|
| 195 |
+
}'
|
| 196 |
+
```
|
| 197 |
+
|
| 198 |
+
See the [blog post](https://inco.ai/blog/dflash2/) for other engines and more details.
|
| 199 |
+
|
| 200 |
+
## Evaluation
|
| 201 |
+
|
| 202 |
+
- Runtime: SGLang on one NVIDIA H200, with FlashAttention 3 for target and draft attention
|
| 203 |
+
- Speculation block size: 8 (7 draft tokens per verification step)
|
| 204 |
+
- Sampling: Qwen3.8's officially recommended parameters (temperature 1.0, top-p 0.95, top-k 20), with `xhigh` reasoning effort
|
| 205 |
+
- Maximum new tokens: 4096
|
| 206 |
+
- Prompts: benchmark formatting from [`z-lab/dflash`](https://github.com/z-lab/dflash)
|
| 207 |
+
|
| 208 |
+
We compare autoregressive decoding, Qwen3.8's built-in seven-token MTP,
|
| 209 |
+
a community DSpark drafter
|
| 210 |
+
([`RadixArk/Qwen3.8-27B-DSpark`](https://huggingface.co/RadixArk/Qwen3.8-27B-DSpark)),
|
| 211 |
+
and DFlash 2. All speculative methods propose seven draft tokens per
|
| 212 |
+
verification step.
|
| 213 |
+
|
| 214 |
+
### Acceptance Length
|
| 215 |
+
|
| 216 |
+
Acceptance length is the per-request mean of completion tokens divided by verification steps.
|
| 217 |
+
Higher is better.
|
| 218 |
+
|
| 219 |
+
| Task | MTP | DSpark | DFlash 2 |
|
| 220 |
+
| :--- | ---: | ---: | ---: |
|
| 221 |
+
| GSM8K | 5.02 | 4.36 | **5.46** |
|
| 222 |
+
| MATH-500 | 4.72 | 3.92 | **5.28** |
|
| 223 |
+
| HumanEval | 3.91 | 3.30 | **4.39** |
|
| 224 |
+
| MBPP | 3.99 | 3.51 | **4.79** |
|
| 225 |
+
| MT-Bench | 3.74 | 3.01 | **4.10** |
|
| 226 |
+
|
| 227 |
+
### Throughput
|
| 228 |
+
|
| 229 |
+
Throughput is total output tokens divided by end-to-end wall time.
|
| 230 |
+
Each cell shows `output tok/s (speedup vs. autoregressive)`.
|
| 231 |
+
|
| 232 |
+
#### Concurrency 1
|
| 233 |
+
|
| 234 |
+
| Task | Autoregressive | MTP | DSpark | DFlash 2 |
|
| 235 |
+
| :--- | ---: | ---: | ---: | ---: |
|
| 236 |
+
| GSM8K | 68.9 | 178.5 (2.59×) | 185.3 (2.69×) | **236.1 (3.43×)** |
|
| 237 |
+
| MATH-500 | 69.0 | 172.8 (2.51×) | 174.5 (2.53×) | **230.7 (3.34×)** |
|
| 238 |
+
| HumanEval | 69.0 | 151.9 (2.20×) | 159.9 (2.32×) | **214.6 (3.11×)** |
|
| 239 |
+
| MBPP | 69.0 | 153.1 (2.22×) | 163.3 (2.37×) | **226.9 (3.29×)** |
|
| 240 |
+
| MT-Bench | 68.9 | 134.9 (1.96×) | 137.6 (2.00×) | **184.0 (2.67×)** |
|
| 241 |
+
|
| 242 |
+
#### Concurrency 8
|
| 243 |
+
|
| 244 |
+
| Task | Autoregressive | MTP | DSpark | DFlash 2 |
|
| 245 |
+
| :--- | ---: | ---: | ---: | ---: |
|
| 246 |
+
| GSM8K | 467.2 | 1,022.1 (2.19×) | 1,040.8 (2.23×) | **1,328.7 (2.84×)** |
|
| 247 |
+
| MATH-500 | 480.0 | 1,023.5 (2.13×) | 1,025.8 (2.14×) | **1,368.3 (2.85×)** |
|
| 248 |
+
| HumanEval | 483.4 | 934.2 (1.93×) | 956.5 (1.98×) | **1,291.5 (2.67×)** |
|
| 249 |
+
| MBPP | 478.0 | 938.1 (1.96×) | 974.1 (2.04×) | **1,328.0 (2.78×)** |
|
| 250 |
+
| MT-Bench | 480.5 | 835.2 (1.74×) | 802.3 (1.67×) | **1,090.2 (2.27×)** |
|
| 251 |
+
|
| 252 |
+
#### Concurrency 32
|
| 253 |
+
|
| 254 |
+
| Task | Autoregressive | MTP | DSpark | DFlash 2 |
|
| 255 |
+
| :--- | ---: | ---: | ---: | ---: |
|
| 256 |
+
| GSM8K | 1,329.8 | 1,381.1 (1.04×) | 1,506.5 (1.13×) | **1,922.5 (1.45×)** |
|
| 257 |
+
| MATH-500 | 1,505.8 | 1,415.6 (0.94×) | 1,429.0 (0.95×) | **1,951.8 (1.30×)** |
|
| 258 |
+
| HumanEval | 1,546.5 | 1,296.8 (0.84×) | 1,330.1 (0.86×) | **1,799.0 (1.16×)** |
|
| 259 |
+
| MBPP | 1,507.7 | 1,314.9 (0.87×) | 1,361.3 (0.90×) | **1,886.8 (1.25×)** |
|
| 260 |
+
| MT-Bench | 1,507.4 | 1,159.7 (0.77×) | 1,115.5 (0.74×) | **1,525.3 (1.01×)** |
|
| 261 |
+
|
| 262 |
+
## Citation
|
| 263 |
+
|
| 264 |
+
If you find DFlash 2 useful, please cite:
|
| 265 |
+
|
| 266 |
+
```bibtex
|
| 267 |
+
@misc{inco2026dflash2,
|
| 268 |
+
title = {{DFlash 2: Keep Drafting Parallel}},
|
| 269 |
+
author = {{Inco AI}},
|
| 270 |
+
year = {2026},
|
| 271 |
+
month = {August},
|
| 272 |
+
url = {https://inco.ai/blog/dflash2/}
|
| 273 |
+
}
|
| 274 |
+
```
|
| 275 |
+
|
| 276 |
+
Please also cite the original DFlash paper:
|
| 277 |
+
|
| 278 |
+
```bibtex
|
| 279 |
+
@inproceedings{chen2026dflash,
|
| 280 |
+
title = {{DFlash: Block Diffusion for Flash Speculative Decoding}},
|
| 281 |
+
author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
|
| 282 |
+
booktitle = {International Conference on Machine Learning (ICML)},
|
| 283 |
+
year = {2026}
|
| 284 |
+
}
|
| 285 |
+
```
|