Instructions to use spiritbuun/Qwen3.5-27B-DFlash-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use spiritbuun/Qwen3.5-27B-DFlash-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 spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf spiritbuun/Qwen3.5-27B-DFlash-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 spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf spiritbuun/Qwen3.5-27B-DFlash-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 spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf spiritbuun/Qwen3.5-27B-DFlash-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 spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M
Use Docker
docker model run hf.co/spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use spiritbuun/Qwen3.5-27B-DFlash-GGUF with Ollama:
ollama run hf.co/spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use spiritbuun/Qwen3.5-27B-DFlash-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf spiritbuun/Qwen3.5-27B-DFlash-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": "spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use spiritbuun/Qwen3.5-27B-DFlash-GGUF with Docker Model Runner:
docker model run hf.co/spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M
- Lemonade
How to use spiritbuun/Qwen3.5-27B-DFlash-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3.5-27B-DFlash-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use spiritbuun/Qwen3.5-27B-DFlash-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 spiritbuun/Qwen3.5-27B-DFlash-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 spiritbuun/Qwen3.5-27B-DFlash-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use spiritbuun/Qwen3.5-27B-DFlash-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf spiritbuun/Qwen3.5-27B-DFlash-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 "spiritbuun/Qwen3.5-27B-DFlash-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"
Upload Q4_K_M GGUF + model card
Browse files- .gitattributes +1 -0
- README.md +136 -0
- dflash-draft-q4_k_m.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
dflash-draft-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: gguf
|
| 4 |
+
base_model: z-lab/Qwen3.5-27B-DFlash
|
| 5 |
+
tags:
|
| 6 |
+
- gguf
|
| 7 |
+
- speculative-decoding
|
| 8 |
+
- dflash
|
| 9 |
+
- drafter
|
| 10 |
+
- llama.cpp
|
| 11 |
+
- quantized
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Qwen3.5-27B-DFlash — GGUF (Q4_K_M)
|
| 15 |
+
|
| 16 |
+
**Q4_K_M llama.cpp quantization** of [`z-lab/Qwen3.5-27B-DFlash`](https://huggingface.co/z-lab/Qwen3.5-27B-DFlash), the block-diffusion drafter for DFlash speculative decoding. Pair it with any Qwen3.5-27B target model (e.g. `Qwen/Qwen3.5-27B`).
|
| 17 |
+
|
| 18 |
+
Only **Q4_K_M** is published here — on our RTX 3090 benchmarks Q4_K_M was the optimal operating point for this drafter; Q8_0 and F16 did not produce better end-to-end decode throughput, so they're intentionally omitted to keep the pairing simple.
|
| 19 |
+
|
| 20 |
+
## Requirements
|
| 21 |
+
|
| 22 |
+
DFlash speculative decoding is **not yet in upstream `llama.cpp`**. You need the fork that carries the tape-replay rollback, hidden-state capture, and tree-aware SSM kernels:
|
| 23 |
+
|
| 24 |
+
- Fork: [`spiritbuun/buun-llama-cpp`](https://github.com/spiritbuun/buun-llama-cpp) (branch `master`)
|
| 25 |
+
- Built with: `cmake -B build -DGGML_CUDA=ON -DGGML_NATIVE=ON -DGGML_CUDA_FA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON`
|
| 26 |
+
|
| 27 |
+
## Usage
|
| 28 |
+
|
| 29 |
+
### `llama-server`
|
| 30 |
+
```bash
|
| 31 |
+
./build/bin/llama-server \
|
| 32 |
+
-m /path/to/Qwen3.5-27B-target.Q4_K_M.gguf \
|
| 33 |
+
-md /path/to/dflash-draft-q4_k_m.gguf \
|
| 34 |
+
--spec-type dflash \
|
| 35 |
+
-ngl 99 -ngld 99 \
|
| 36 |
+
-np 1 -c 6048 -cd 256 \
|
| 37 |
+
-fa on -b 256 -ub 64 \
|
| 38 |
+
--host 0.0.0.0 --port 8080 --jinja
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
### `llama-speculative-simple`
|
| 42 |
+
```bash
|
| 43 |
+
./build/bin/llama-speculative-simple \
|
| 44 |
+
-m /path/to/Qwen3.5-27B-target.Q4_K_M.gguf \
|
| 45 |
+
-md /path/to/dflash-draft-q4_k_m.gguf \
|
| 46 |
+
--spec-type dflash \
|
| 47 |
+
-ngl 99 -ngld 99 \
|
| 48 |
+
-c 4096 --draft-max 16 --draft-min 1 \
|
| 49 |
+
-p "Write a Python mergesort."
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Observed performance (RTX 3090, Qwen3.5-27B-heretic target Q4_K_M)
|
| 53 |
+
|
| 54 |
+
| Workload | Draft ON (t/s) | Draft OFF (t/s) | Acceptance |
|
| 55 |
+
|---------------------------|---------------:|----------------:|-----------:|
|
| 56 |
+
| Code (raw prompt) | 140 | 40 | 69 % |
|
| 57 |
+
| Code (chat template) | 99 | 40 | 37 % |
|
| 58 |
+
| Prose (raw prompt) | 60 | 40 | 77 % |
|
| 59 |
+
|
| 60 |
+
**Heads-up on chat templates.** The drafter was trained on raw continuations; wrapping the prompt in Qwen chat-template tokens (`<|im_start|>` etc.) shifts the hidden-state distribution the drafter's cross-attention expects. Acceptance on code drops from **69 % → 37 %** when the template is applied, and end-to-end throughput drops correspondingly. Raw-mode generation is still a strong speedup; chat-mode is a more modest one. A drafter retrained on chat-formatted data would be needed to recover the full speedup under a chat template.
|
| 61 |
+
|
| 62 |
+
## Quantization details
|
| 63 |
+
|
| 64 |
+
- Source: `z-lab/Qwen3.5-27B-DFlash` (BF16 safetensors, 2 B parameters)
|
| 65 |
+
- Converter: `convert_hf_to_gguf.py` from [`spiritbuun/buun-llama-cpp`](https://github.com/spiritbuun/buun-llama-cpp) (adds `DFlashDraftModel` arch)
|
| 66 |
+
- Quant: `llama-quantize` → `Q4_K_M`
|
| 67 |
+
- File size: ~1.0 GB
|
| 68 |
+
- Tensors: drafter transformer + projection heads + cross-attention layers targeting Qwen3.5-27B layer ids `[1, 16, 31, 46, 61]`
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
# Original model card — `z-lab/Qwen3.5-27B-DFlash`
|
| 73 |
+
|
| 74 |
+
*Reproduced from the upstream model page. License: MIT.*
|
| 75 |
+
|
| 76 |
+
## Overview
|
| 77 |
+
**Qwen3.5-27B-DFlash** is a lightweight **drafter** component for DFlash speculative decoding. It must be used with the target model `Qwen/Qwen3.5-27B`.
|
| 78 |
+
|
| 79 |
+
- **Paper**: https://arxiv.org/abs/2602.06036
|
| 80 |
+
- **GitHub**: https://github.com/z-lab/dflash
|
| 81 |
+
- **Blog**: https://z-lab.ai/projects/dflash/
|
| 82 |
+
- **Model Size**: 2B parameters (BF16)
|
| 83 |
+
- **Context Length**: 4096 tokens
|
| 84 |
+
|
| 85 |
+
## What is DFlash?
|
| 86 |
+
DFlash is a novel speculative decoding method using a lightweight block diffusion model for drafting, enabling efficient, high-quality parallel drafting that significantly speeds up inference.
|
| 87 |
+
|
| 88 |
+
## Upstream Quick Start (vLLM / SGLang)
|
| 89 |
+
|
| 90 |
+
### vLLM
|
| 91 |
+
```bash
|
| 92 |
+
uv pip install -U vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly
|
| 93 |
+
|
| 94 |
+
vllm serve Qwen/Qwen3.5-27B \
|
| 95 |
+
--speculative-config '{"method": "dflash", "model": "z-lab/Qwen3.5-27B-DFlash", "num_speculative_tokens": 15}' \
|
| 96 |
+
--attention-backend flash_attn \
|
| 97 |
+
--max-num-batched-tokens 32768
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### SGLang
|
| 101 |
+
```bash
|
| 102 |
+
uv pip install "git+https://github.com/sgl-project/sglang.git@refs/pull/20547/head#subdirectory=python"
|
| 103 |
+
|
| 104 |
+
python -m sglang.launch_server \
|
| 105 |
+
--model-path Qwen/Qwen3.5-27B \
|
| 106 |
+
--speculative-algorithm DFLASH \
|
| 107 |
+
--speculative-draft-model-path z-lab/Qwen3.5-27B-DFlash \
|
| 108 |
+
--speculative-num-draft-tokens 16 \
|
| 109 |
+
--tp-size 1 \
|
| 110 |
+
--attention-backend fa3 \
|
| 111 |
+
--mem-fraction-static 0.75 \
|
| 112 |
+
--trust-remote-code
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
## Upstream Benchmarks (NVIDIA B200, BF16)
|
| 116 |
+
|
| 117 |
+
**Up to 5.2× speedup** over autoregressive baseline at concurrency 1 on HumanEval with block size 16.
|
| 118 |
+
|
| 119 |
+
| Task | Concurrency | AR | DFlash (B16) | Speedup |
|
| 120 |
+
|-----------|-------------|-----|--------------|---------|
|
| 121 |
+
| Math500 | 1 | 84 | **397** | **4.7×** |
|
| 122 |
+
| HumanEval | 1 | 83 | **427** | **5.2×** |
|
| 123 |
+
| GSM8K | 1 | 83 | **330** | **4.0×** |
|
| 124 |
+
|
| 125 |
+
## Citation
|
| 126 |
+
```bibtex
|
| 127 |
+
@article{chen2026dflash,
|
| 128 |
+
title = {{DFlash: Block Diffusion for Flash Speculative Decoding}},
|
| 129 |
+
author = {Chen, Jian and Liang, Yesheng and Liu, Zhijian},
|
| 130 |
+
journal = {arXiv preprint arXiv:2602.06036},
|
| 131 |
+
year = {2026}
|
| 132 |
+
}
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
## License
|
| 136 |
+
**MIT** — inherited from the upstream model. This repository redistributes a quantized derivative under the same terms.
|
dflash-draft-q4_k_m.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3adbef5d972993175c086d92e8bdb6391feb90b7ef01e480c6e82197ea6929b
|
| 3 |
+
size 1033066912
|