Instructions to use ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp 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 ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp 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 ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M # Run inference directly in the terminal: llama cli -hf ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M # Run inference directly in the terminal: llama cli -hf ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
Use Docker
docker model run hf.co/ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
- Ollama
How to use ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp with Ollama:
ollama run hf.co/ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
- Unsloth Desktop
- Pi
How to use ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp: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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp with Docker Model Runner:
docker model run hf.co/ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
- Lemonade
How to use ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
Run and chat with the model
lemonade run user.DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp: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:9931/v1 hermes config set model.default ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp: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:9931/v1 \ --custom-model-id "ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp: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"
DFlash2 draft for Ternary Bonsai 2.5 27B on llama.cpp and its forks
A DFlash2 draft model (Qwen3.8-27B backbone by Inco AI) adapted to draft for Ternary Bonsai 2.5 27B, bringing speculative decoding to the ternary target on unpatched llama.cpp while preserving the target's outputs.
Because the fix lives in the card and not in the engine, nothing in it is specific to one build: the card is made for llama.cpp and for the builds derived from it, and none of them needs a patch of its own. It loads and drafts on stock llama.cpp (b12345) and on the mainline builds b12774 and b12845. On Unsloth's build b12827-mix-034de92 the pair also holds a 240k context with every layer on a 16 GB GPU, where stock b12345 runs out of memory (see Running on Unsloth's build).
Draft backbone: Qwen3.8-27B-DFlash2 by Inco AI (1.9B parameters) ยท Target: Ternary Bonsai 2.5 27B, Q2_0 by Prism ML ยท Runtime: llama.cpp, stock (tested on b12345, b12774, b12845) and derived builds (tested on Unsloth's b12827-mix-034de92) ยท Build code and measurements: GitHub ยท Model page
The problem
Ternary Bonsai 2.5 27B is a Hadamard-latent model: llama.cpp loads its token embedding table rotated and every weight that reads the residual stream folded (prism.hadamard). The target restores the primal basis inside its own graph, right after the embedding lookup.
A DFlash2 draft has no embedding table and no output head of its own. It borrows both from the target and uses them as they are. On a Hadamard-latent target that means rotated embedding rows and a folded head, so every drafted token is rejected: acceptance is exactly 0 (0 of 5,932 tokens over 12 configurations), and the target still pays for every useless draft round.
There are two independent gaps. Fixing only the embedding still yields zero acceptance (0 of 8,358 drafted tokens), because the borrowed head is folded.
What is in this repository
Six adapted draft cards. Each one is a DFlash2 draft body (the original Q4_K_M one copied byte for byte, or its Q3_K_M tier), plus two tensors in the primal basis: token_embd.weight and output.weight. Both are optional tensors of the DFlash architecture, so llama.cpp uses them instead of borrowing. The variants differ in how the two tables are quantized and in the size of the draft vocabulary.
| File | Embedding table | Head table | Size | Draft vocabulary | Draft in VRAM | Draft in host RAM | Window on a 16 GB GPU* |
|---|---|---|---|---|---|---|---|
DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q3_K_M-IMX-TQ2_K_Q6_K-DV98304.gguf (recommended) |
Q2_K (398 MiB) | Q6_K, 98,304 rows (394 MiB) | 1.63 GiB | 98,304 tokensยน | 1,258 MiB | 398 MiB | 224,000 |
DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q4_K_M-TQ4_K_Q6_K.gguf |
Q4_K (682 MiB) | Q6_K (995 MiB) | 2.75 GiB | full (248,320) | 2,122 MiB | 682 MiB | 185,600 |
DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q4_K_M-TQ4_K.gguf |
Q4_K (682 MiB) | Q4_K (682 MiB) | 2.44 GiB | full (248,320) | 1,809 MiB | 682 MiB | 199,936 |
DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q4_K_M-TQ2_K_Q4_K-IMX-DV98304.gguf |
Q2_K (398 MiB) | Q4_K, calibratedยณ, 98,304 rows (270 MiB) | 1.76 GiB | 98,304 tokensยน | 1,397 MiB | 398 MiB | 217,600 |
DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q4_K_M-TQ2_K_Q6_K-DV98304.gguf |
Q2_K (398 MiB) | Q6_K, 98,304 rows (394 MiB) | 1.88 GiB | 98,304 tokensยน | 1,522 MiB | 398 MiB | 211,968 |
DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q4_K_M-TQ8_0.gguf |
Q8_0 (1288 MiB) | Q8_0 (1288 MiB) | 3.63 GiB | full (248,320) | 2,415 MiB | 1288 MiB | 172,288 |
* Context size chosen by the server's memory fitting with every layer of the target and the draft on the GPU, q4_0 KV cache, on stock b12345. The bare target fits 262,144. On Unsloth's build the combined card fits 245,760 with 1.0โ1.2 GB to spare and the full 262,144 with 0.5 GB; the recommended compact card fits the full 262,144 with 0.6 GB to spare (see Running on Unsloth's build).
ยน The recommended card carries a reduced draft vocabulary: the head has 98,304 rows and a d2t table maps them to the target's token ids. A token outside this list is never drafted. On our probes the card matched the full-vocabulary card within 3 % of tau under greedy decoding and within run-to-run noise on sampled runs; we did not measure long material, where rare tokens outside the list may cost acceptance. Research welcome.
ยฒ The body of this card is the Q3_K_M tier of the same draft published by andrew-paul, quantized with an importance matrix; the two tables are those of the combined card, byte for byte. Measured against the combined card it is level on tau (see Calibrated head and compact body) at 264 MiB less VRAM and a larger window, which is why it is the recommended one.
ยณ The head table of this card was quantized with an importance matrix collected from the draft's own activations in a live speculative session (see Calibrated head and compact body).
SHA-256:
94ab3e6b12a2e1d638a4416b68f340f3819ae095216ad4544e2e8a8fb59f543d ...-TQ2_K_Q6_K-DV98304.gguf
b2a6bb8a3c8afde618f990aaa856654a840ac63a22f37db485cc28d8619fef82 ...-TQ4_K_Q6_K.gguf
fc01b48102955fe63e1a61986783ea3c0a260707bd16b22e382ff604681cca5a ...-TQ4_K.gguf
ddad3dcdd8004a65a990e240f0177bf0c02363d4f16fcd6b36be37257d3370aa ...-TQ8_0.gguf
a281b555a9d61a1d87d1b7b6047a015e095b843fe3aebff6444f00b7e2ba08ae ...-TQ2_K_Q4_K-IMX-DV98304.gguf
496880632674fbc3a36a9f685a390b5fa25f9adea1ce7382fb0d521ed7fe54db ...-Q3_K_M-IMX-TQ2_K_Q6_K-DV98304.gguf
What takes memory
A draft card has three parts, and two of them occupy VRAM:
| Part | Where it lives | Why |
|---|---|---|
| Draft body: 5 layers and the candidate selector, about 1,127 MiB | VRAM | Runs on the GPU at every draft step |
Head (output.weight) |
VRAM | Read in full at every draft step; its size sets the VRAM cost and the window |
Embedding (token_embd.weight) |
Host memory (pinned) | One row is read per token, so llama.cpp keeps it out of VRAM; it counts against system RAM only |
Per card, as reported by the server at load time:
| Card | Draft body, VRAM | Head, VRAM | Embedding, host RAM | VRAM total | Host RAM total |
|---|---|---|---|---|---|
| Combined, 98,304-token head | 1,127 MiB | 394 MiB | 398 MiB | 1,522 MiB | 398 MiB |
| Q4_K + Q6_K | 1,127 MiB | 995 MiB | 682 MiB | 2,122 MiB | 682 MiB |
| Q4_K + Q4_K | 1,127 MiB | 682 MiB | 682 MiB | 1,809 MiB | 682 MiB |
| Q8_0 + Q8_0 | 1,127 MiB | 1,288 MiB | 1,288 MiB | 2,415 MiB | 1,288 MiB |
| Calibrated Q4_K head, 98,304-token | 1,127 MiB | 270 MiB | 398 MiB | 1,397 MiB | 398 MiB |
| Compact body (Q3_K_M), 98,304-token head โ recommended | 864 MiB | 394 MiB | 398 MiB | 1,258 MiB | 398 MiB |
For reference: the target alone takes 6,966 MiB of VRAM and 341 MiB of host memory, and the vendor's own MTP head adds 228 MiB of VRAM on top of that.
Quick start
Requirements: a llama.cpp build, stock or derived, with the Hadamard activation runtime (release b11556 or newer, which the Q2_0 target needs anyway) and DFlash2 draft support. Tested on stock b12345 and on the mainline builds b12774 and b12845, CUDA 13.5, RTX 4070 Ti SUPER 16 GB. Unsloth's build has its own section below.
Use the base target file, not the -mtp variant (the MTP head and an external draft are not meant to be combined).
huggingface-cli download ARRANCORE/DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp \
DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q3_K_M-IMX-TQ2_K_Q6_K-DV98304.gguf --local-dir .
huggingface-cli download prism-ml/Ternary-Bonsai-2.5-27B-GGUF Ternary-Bonsai-2.5-27B-Q2_0.gguf --local-dir .
llama-server -m Ternary-Bonsai-2.5-27B-Q2_0.gguf \
--model-draft DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q3_K_M-IMX-TQ2_K_Q6_K-DV98304.gguf \
--spec-type draft-dflash --spec-draft-n-max 4 --spec-draft-p-min 0 --spec-draft-n-cpu-moe 0 \
-fa on -b 1024 -np 1 -jinja --metrics \
-c 8192 -ctk q8_0 -ctv q8_0 \
--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 --repeat-penalty 1.0 \
--host 127.0.0.1 --port 1234
The server reads the reduced vocabulary from the card's d2t tensor and logs DFlash using d2t mapping (draft_vocab_size = 98304); no extra flag is needed.
For the largest window, drop -c and the q8 cache flags and add -ctk q4_0 -ctv q4_0 -ub 256 --spec-draft-n-ubatch 64; the server then picks the context that fits. Check the log (run with -lv 4) for offloaded 65/65 layers: with a window that does not fit, the server silently moves layers to the CPU and decode collapses. On Unsloth's build the card fits a context of 245,760 and more; see Running on Unsloth's build.
Sampling follows the target's recommended thinking-mode chain (temperature 1.0, top_p 0.95, top_k 20, min_p 0). llama.cpp defaults to min_p 0.05; pass --min-p 0.
How it works
The target stores an embedding row rotated and restores it in its graph as h = signs โ (H z), where H is the normalized SylvesterโWalshโHadamard transform applied per block of 1024 along the last axis and signs is a ยฑ1 vector of the embedding width. The folded head obeys the same relation along its input axis: W_primal[i, v] = signs[i] ยท (H W_folded)[i, v]. Both relations were verified against the target: layer-0 inputs of 256 tokens match the unwrapped rows with cosine 1.000000, while the raw rows are orthogonal to them (โ0.0001).
Everything is offline. The target file is not modified.
Tokens per verification round
A draft card is judged by tau: the number of tokens the target emits per verification round. 1.00 means no speculation. tau is a property of the draft and of the material, not of the GPU, and it is the quantity to compare between draft cards. Its ceiling is n_max + 1: 5 for these cards (n_max 4) and 4 for the MTP head (n_max 3). The share of drafted tokens that gets accepted is not comparable between drafts with different n_max, so it is not the headline number.
The reference is the stock MTP head that ships with the target (the -mtp file, --spec-type draft-mtp, n_max 3, p_min 0): on llama.cpp it is the only other way to speculate on this model. All rows below come from one session, same prompts, same sampling chain.
Sampled runs (temperature 1.0, 600โ700 tokens, thinking on):
| Card | Code, English | Code, multilingual | Prose, multilingual | All runs |
|---|---|---|---|---|
Stock MTP head (n_max 3) |
2.63 (n=4, 2.35โ3.26) | 2.37 (n=4, 2.09โ2.84) | 2.10 (n=4, 1.83โ2.30) | 2.38 (n=18) |
| Full vocabulary (Q4_K + Q6_K) | 3.01 (n=4, 2.40โ3.67) | 2.90 (n=4, 2.09โ3.65) | 2.10 (n=4, 1.92โ2.28) | 2.68 (n=18) |
| Combined (Q2_K + Q6_K, 98,304 tokens) | 2.53 (n=10, 2.15โ3.89) | 2.71 (n=4, 2.23โ3.26) | 1.95 (n=4, 1.79โ2.12) | 2.52 (n=24) |
Longer code runs (700 tokens, six runs in two server restarts): MTP 2.42 (2.21โ2.63), full vocabulary 2.71 (2.13โ3.12), combined 2.75 (2.12โ3.82).
Greedy decoding (deterministic, same prompts):
| Card | Code, English | Code, multilingual | Prose, multilingual |
|---|---|---|---|
Stock MTP head (n_max 3) |
2.66 | 2.83 | 2.33 |
| Full vocabulary (Q4_K + Q6_K) | 2.87 | 3.06 | 2.03 |
| Combined (Q2_K + Q6_K, 98,304 tokens) | 2.84 | 3.14 | 2.07 |
What this says:
- On code, the DFlash2 cards earn more tokens per round than the stock MTP head in nine of ten comparisons, by 7โ22 %. The tenth (combined card, sampled English code) came out 4 % lower, within the spread of the runs.
- On multilingual prose, the MTP head is ahead or level: 2.33 against 2.03โ2.07 under greedy decoding.
- Pooled over all sampled runs: full vocabulary +13 %, combined +6 % against the MTP head.
- The combined card and the full-vocabulary card agree within 3 % of
tauunder greedy decoding, where both produce the same text token for token. - The recommended compact card carries the tables of the combined card and is level with it on
tau(2.62 against 2.63 pooled on sampled text with thinking on, 2.35 against 2.37 on greedy); see Calibrated head and compact body. taumoves a lot between sampled runs (1.8โ3.9 here) because the material changes with every sample; single runs mean little.
Decode speed follows from tau and from round costs that depend on the GPU and on the engine build, so it is not tabulated here; the build comparison in the next section mentions it in passing. On stock b12345 a verification round cost about 2.3 single-token steps of the target, so there a draft pays off only when tau is above that mark.
Calibrated head and compact body
The head is read in full at every draft step and its input weights are lopsided (the largest is 34 times the mean), so a smaller head quantization needs calibration. llama.cpp's llama-imatrix cannot run a DFlash draft on its own, and importance matrices published for the dense Qwen3.8-27B hold no entry for output.weight. We collected the matrix inside a running speculative session with a callback on the draft context (the patch by andrew-paul, ported to b12345), over 16 minutes of code, reasoning and prose in two languages.
Ten cards built from the same tables were measured in two sessions (greedy on both builds, sampled text with thinking on, code with thinking off). The outcome is parity. The compact Q3_K_M body (264 MiB less VRAM) against the combined card: tau 2.35 against 2.37 on the deterministic greedy run (โ1 %, n = 12, same text), 2.62 against 2.63 on sampled text with thinking on (0 %, n = 36), 3.92 against 4.09 on code (โ4 %, n = 8); decode within the spread (138 against 142 t/s on code). The calibrated Q4_K head (124 MiB less VRAM) stays within 1 % on greedy, +1 % on sampled text with thinking on (n = 36) and within 4 % on code. The first session showed +6โ13 % for the calibrated heads and the second โ3โ10 % for every variant, while the combined card itself moved by as much between the sessions, so no tau gain is claimed. What they buy is VRAM and window: 1,397 and 1,258 MiB of VRAM against 1,522 (as the server reports at load time), 217,600 and 224,000 against 211,968 tokens of context on a 16 GB GPU, chosen by the server's memory fitting. The compact card is the recommended one for that reason: same tau, 264 MiB less VRAM, 12,032 more tokens of context. A Q2_K body lost 4 % on the greedy run and a Q4_K embedding changed nothing; neither is published. Numbers: docs/measurements.md.
Running on Unsloth's build
Nothing in the card is specific to one engine. Unsloth's llama.cpp build b12827-mix-034de92 runs it with the same flags, and on our 16 GB card that build differs from stock b12345 in two ways: the pair fits a larger context, and a verification round costs less, so more of tau turns into speed.
Settings. Same as Quick start. For a long context with every layer of the target and of the draft on the GPU (command shown with the combined card, the one the tables below were measured with; the recommended compact card takes the same flags):
llama-server -m Ternary-Bonsai-2.5-27B-Q2_0.gguf \
--model-draft DFlash2-Ternary-Bonsai-2.5-27B-llama.cpp-Q4_K_M-TQ2_K_Q6_K-DV98304.gguf \
--spec-type draft-dflash --spec-draft-n-max 4 --spec-draft-p-min 0 --spec-draft-n-cpu-moe 0 \
-fa on -b 1024 -ub 256 --spec-draft-n-ubatch 64 \
-c 245760 -fitt 512 -ctk q4_0 -ctv q4_0 -np 1 -jinja --metrics \
--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 --repeat-penalty 1.0 \
--host 127.0.0.1 --port 1234
This leaves 1.0โ1.2 GB of VRAM free. The full context of 262,144 also fits with -c 262144 -fitt 480, with 0.5 GB left under load. With the recommended compact card the full 262,144 fits with -c 262144 -fitt 512: every layer on the GPU, 659 MiB of VRAM free after load (we did not run the depth ladder for it on this build). On stock b12345 the 245,760 configuration does not fit: the server moves three layers of the target to the CPU and decode falls to 10โ20 t/s.
The reference lane is the stock MTP head on the same trunk and the same context flags: --spec-type draft-mtp --spec-draft-n-min 0 --spec-draft-n-max 3 --spec-draft-p-min 0. The -mtp file can stand in for the base file as the trunk of this card when --spec-type draft-mtp is absent: the server reports the extra head block as unused and loads nothing of it. The tables below were measured that way.
tau by context depth. Both drafts on the same trunk, same sampling chain (temperature 1.0, top_p 0.95, top_k 20, min_p 0). The context is filled with repeated text and closed by one task; each probe is its own conversation on a fresh server. Two passes per point, each with a new sample, shown as first / second. The 8k rows were taken with a q8_0 KV cache and the default micro-batch, the others with q4_0 and -ub 256.
Code, thinking off, 700 tokens per probe (coding tasks on a source-code context):
| Window | Draft | 0.2k | 7k | 16k | 53k | 115k | 205k |
|---|---|---|---|---|---|---|---|
| 8k | Stock MTP head | 3.25 / 3.43 | 3.79 / 3.53 | โ | โ | โ | โ |
| 8k | This card | 4.14 / 4.26 | 4.02 / 4.34 | โ | โ | โ | โ |
| 120k | Stock MTP head | 3.13 / 3.19 | โ | 3.68 / 3.48 | 3.60 / 3.51 | 3.40 / 3.09 | โ |
| 120k | This card | 3.97 / 4.14 | โ | 4.51 / 4.16 | 4.06 / 4.23 | 3.88 / 4.29 | โ |
| 240k | Stock MTP head | 3.39 / 3.28 | โ | 3.76 / 3.70 | 3.55 / 3.67 | 3.53 / 3.66 | 3.68 / 3.06 |
| 240k | This card | 3.42 / 3.78 | โ | 4.16 / 4.14 | 4.14 / 4.34 | 3.99 / 4.03 | 4.45 / 4.31 |
Prose, thinking on, 256 tokens per probe:
| Window | Draft | 0.2k | 7k | 16k | 53k | 115k | 205k |
|---|---|---|---|---|---|---|---|
| 8k | Stock MTP head | 3.00 / 3.26 | 2.33 / 2.14 | โ | โ | โ | โ |
| 8k | This card | 2.90 / 3.15 | 2.42 / 2.76 | โ | โ | โ | โ |
| 120k | Stock MTP head | 3.15 / 2.93 | โ | 2.04 / 2.74 | 2.30 / 2.03 | 2.19 / 2.28 | โ |
| 120k | This card | 3.59 / 3.09 | โ | 2.35 / 2.22 | 2.10 / 2.21 | 2.12 / 2.74 | โ |
| 240k | Stock MTP head | 3.40 / 2.80 | โ | 2.32 / 2.27 | 2.87 / 1.85 | 2.33 / 2.17 | 2.44 / 2.32 |
| 240k | This card | 4.11 / 3.12 | โ | 3.59 / 2.06 | 1.82 / 2.07 | 1.93 / 1.98 | 2.23 / 2.41 |
What this says:
- Code: the card is ahead in all 22 comparisons, both passes at every depth of all three windows, by 8โ30 % on the mean of the two passes. The MTP head comes close to its ceiling of 4 on this material; the card's ceiling is 5.
- Prose: neither leads reliably. The card was ahead in both passes on a short context of the 120k and 240k windows (3.1โ4.1 against 2.8โ3.4) and at 7k of the 8k window; the MTP head in both passes at 115k of the 240k window and, by 3โ4 %, on a short context of the 8k window. At the other six points the two passes disagree on who leads.
- The same coding prompts with thinking on never reach the code within 700 tokens, so they measure reasoning: at 8k they gave 2.4 for the card against 2.6 for the MTP head (six runs each), in line with the prose rows.
- Speed, in passing: on this build the code probes decoded 1.1โ1.4 times as fast with the card as with the MTP head at every depth (154 against 120 t/s on a short context and 68 against 51 at 115k on the 120k window); on prose the two were within about 20 % of each other.
One machine and one session (30 November 2026), repeated boilerplate as filler, probes of 256โ700 tokens. At temperature 1.0 tau moves by about ยฑ0.5 between samples, so read the tables by agreement between the two passes, not by single cells. Raw numbers: docs/measurements.md.
Lossless
The draft never changes what the target computes. With greedy decoding on five prompts (400 tokens each) the full-vocabulary card reproduced the bare target's output exactly on four; on the fifth the two diverged once, 65 % into the output, where the target picked modulo and the pair taking the remainder, two synonymous continuations of the same sentence. That is what a near-tie looks like when the target scores several tokens per step instead of one; the outputs are identical except on such near-ties. The combined card produced the same greedy text as the full-vocabulary card on every probe.
Limitations and gotchas
- The gain is not guaranteed: it depends on
tau. A draft pays only whentauexceeds the cost of a round (about 2.3 on our setup); watchtauin/metricson your own material. On code the DFlash2 cards earned more tokens per round than the MTP head; on prose with thinking on the MTP head was ahead or level. - The recommended card (and the combined card) drafts from 98,304 tokens only. Tokens outside the list are never proposed. Short probes showed no loss; long material was not measured.
n_max 7andp_min 0.2did not help on this pair: both were slower thann_max 4withp_min 0on our setup.- A window that does not fit fails silently. Newer llama.cpp servers fit layers to free memory: check
offloaded 65/65 layersin the log. - A 240k context with the draft fits on a 16 GB GPU only on some builds. On Unsloth's build it does, with 1.0โ1.2 GB to spare, and so does the full 262,144 with 0.5 GB; on stock b12345 the 245,760 configuration moved three layers of the target to the CPU and decode fell to 10โ20 t/s.
- Other builds derived from llama.cpp are untested. The card asks nothing of them beyond DFlash2 draft support and the Hadamard runtime, but we could only try b12345, b12774, b12845 and Unsloth's
b12827-mix-034de92. Reports are welcome. - Do not switch
enable_thinkingbetween requests of one conversation. The chat template changes from its first token, which costs a full re-prefill. - The first request after a server start is slower.
- All numbers come from one machine in one session. Treat them as a starting point, not as a settled result.
Acknowledgements
- Inco AI for DFlash 2 and the Qwen3.8-27B-DFlash2 draft this repository adapts (Apache 2.0), and Jian Chen, Yesheng Liang and Zhijian Liu for the original DFlash paper.
- Prism ML for Ternary Bonsai 2.5 27B, the prism.hadamard format and its llama.cpp runtime (PrismML-Eng). Created using Bonsai by Prism ML.
- Qwen (Alibaba Cloud) for Qwen3.8-27B, the common ancestor of the draft and the target.
- llama.cpp contributors for the runtime, gguf-py and llama-quantize, which encoded the Q2_K, Q4_K and Q6_K tables.
- kristobalus for the draft vocabulary order used by the combined card (Apache 2.0,
kristobalus/Ternary-Bonsai-2-27B-DFlash2-dv98304-GGUF), and empyrealworks for the card that pointed us to it. - andrew-paul for the imatrix-calibrated Q3_K_M tier of the draft body and the collector patch behind the calibration of the tables.
- Unsloth for the UD-Q4_K_M conversion the target's upstream MTP head derives from, and for their llama.cpp build
b12827-mix-034de92, on which the fork measurements were taken. - Dogukan Urker for community measurements of Bonsai 2.5 with speculative decoding that informed the VRAM budget.
License
Apache 2.0. The draft body derives from incoai/Qwen3.8-27B-DFlash2 (Apache 2.0); the added tables are derived from prism-ml/Ternary-Bonsai-2.5-27B-GGUF (Apache 2.0, see its NOTICE.txt for upstream attribution); the draft vocabulary order of the combined card derives from kristobalus/Ternary-Bonsai-2-27B-DFlash2-dv98304-GGUF (Apache 2.0). See NOTICE.txt in this repository.
- Downloads last month
- 9,983
2-bit
4-bit
6-bit
8-bit