Anbeeld commited on
Commit
0dfa14d
·
verified ·
1 Parent(s): 05e3584

Fix README metadata and assets

Browse files
Files changed (1) hide show
  1. README.md +128 -0
README.md ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: z-lab/Qwen3-Coder-Next-DFlash
3
+ tags:
4
+ - transformers
5
+ - safetensors
6
+ - qwen3
7
+ - feature-extraction
8
+ - dflash
9
+ - speculative-decoding
10
+ - block-diffusion
11
+ - draft-model
12
+ - efficiency
13
+ - qwen
14
+ - diffusion-language-model
15
+ - text-generation
16
+ - custom_code
17
+ - arxiv:2602.06036
18
+ - license:mit
19
+ - text-generation-inference
20
+ - endpoints_compatible
21
+ - region:us
22
+ ---
23
+
24
+ # Qwen 3 Coder Next DFlash GGUF
25
+
26
+ GGUF quantizations of [**z-lab DFlash draft model**](https://huggingface.co/z-lab/Qwen3-Coder-Next-DFlash) for [**Qwen 3 Coder Next**](https://huggingface.co/Qwen/Qwen3-Coder-Next).
27
+
28
+ Use with [BeeLlama.cpp](https://github.com/Anbeeld/beellama.cpp), a llama.cpp fork with advanced quantization features.
29
+
30
+ ---
31
+
32
+ # Qwen3-Coder-Next-DFlash
33
+
34
+ [**Paper**](https://arxiv.org/abs/2602.06036) | [**GitHub**](https://github.com/z-lab/dflash) | [**Blog**](https://z-lab.ai/projects/dflash/)
35
+
36
+ **DFlash** is a speculative decoding method that uses a lightweight **block diffusion** model to draft multiple tokens in parallel. This is the drafter model, which must be paired with [Qwen/Qwen3-Coder-Next](https://huggingface.co/Qwen/Qwen3-Coder-Next).
37
+
38
+ <div align="center">
39
+ <img src="assets/dflash_system.png" alt="DFlash Architecture" width="85%">
40
+ </div>
41
+
42
+ ## Quick Start
43
+
44
+ ### Installation
45
+
46
+ vLLM:
47
+ ```bash
48
+ uv pip install vllm
49
+ uv pip install -U vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly
50
+ ```
51
+
52
+ SGLang:
53
+ ```bash
54
+ uv pip install "git+https://github.com/sgl-project/sglang.git@refs/pull/20547/head#subdirectory=python"
55
+ ```
56
+
57
+ ### Launch Server
58
+
59
+ vLLM:
60
+ ```bash
61
+ vllm serve Qwen/Qwen3-Coder-Next \
62
+ --speculative-config '{"method": "dflash", "model": "z-lab/Qwen3-Coder-Next-DFlash", "num_speculative_tokens": 15}' \
63
+ --attention-backend flash_attn \
64
+ --max-num-batched-tokens 32768
65
+ ```
66
+
67
+ SGLang:
68
+ ```bash
69
+ # Optional: enable schedule overlapping (experimental, may not be stable)
70
+ # export SGLANG_ENABLE_SPEC_V2=1
71
+ # export SGLANG_ENABLE_DFLASH_SPEC_V2=1
72
+ # export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1
73
+
74
+ python -m sglang.launch_server \
75
+ --model-path Qwen/Qwen3-Coder-Next \
76
+ --speculative-algorithm DFLASH \
77
+ --speculative-draft-model-path z-lab/Qwen3-Coder-Next-DFlash \
78
+ --speculative-num-draft-tokens 16 \
79
+ --tp-size 1 \
80
+ --attention-backend fa3 \
81
+ --mem-fraction-static 0.75 \
82
+ --mamba-scheduler-strategy extra_buffer \
83
+ --trust-remote-code
84
+ ```
85
+ > **Tip:** For long-context or agentic workloads, add `--speculative-dflash-draft-window-size WINDOW_SIZE` to enable sliding-window attention for the drafter.
86
+
87
+ ### Usage
88
+
89
+ ```python
90
+ from openai import OpenAI
91
+
92
+ client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")
93
+
94
+ response = client.chat.completions.create(
95
+ model="Qwen/Qwen3-Coder-Next",
96
+ messages=[{"role": "user", "content": "Write a quicksort in Python."}],
97
+ max_tokens=4096,
98
+ temperature=0.0
99
+ )
100
+ print(response.choices[0].message.content)
101
+ ```
102
+
103
+ ## Acceptance Length
104
+
105
+ - Max new tokens: 4096
106
+ - Block size: 16
107
+ | Dataset | Accept Length |
108
+ |-----------|---------------|
109
+ | HumanEval | 7.25 |
110
+ | MBPP | 5.50 |
111
+ | LiveCodeBench | 5.50 |
112
+
113
+ ## Acknowledgements
114
+
115
+ Special thanks to [David Wang](https://davidwa.ng/) for his outstanding engineering support on this project. We are also grateful to [Modal](https://modal.com/), [InnoMatrix](https://innomatrix.ai), and [Yotta Labs](https://www.yottalabs.ai/) for providing the compute resources used to train this draft model.
116
+
117
+ ## Citation
118
+
119
+ If you find DFlash useful, please cite our work. To share feedback on DFlash or request new model support, please fill out this form: [DFlash Feedback](https://forms.gle/4YNwfqb4nJdqn6hq9).
120
+
121
+ ```bibtex
122
+ @article{chen2026dflash,
123
+ title = {{DFlash: Block Diffusion for Flash Speculative Decoding}},
124
+ author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
125
+ journal = {arXiv preprint arXiv:2602.06036},
126
+ year = {2026}
127
+ }
128
+ ```