Model or dataset
z-lab/dflash avatar
z-lab/dflash

One release, three backends, two names for the reasoning knob, and a block size ceiling on quantized MLX

DFlash: Block Diffusion for Flash Speculative Decoding

6,255 stars445 forksPythonMIT

At a glance

What is it?
DFlash is a draft model for speculative decoding that fills several tokens at once with a small diffusion block instead of one token at a time. The repository is one package and one manifest, and the interesting decisions are all in how narrowly each backend is allowed to run: which model families it accepts, what the reasoning parameter is called, and how large a block a quantized kernel can verify efficiently.
Who is it for?
DFlash is for people running inference locally who want a drafter that proposes several tokens in parallel rather than one at a time, and the package is small enough to read: one directory of code, one manifest, one release. Three things to establish before you plan a rollout.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 98 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • z-lab/dflash6,255 ★ · +138
Star history
Repository2026-09-232026-11-23
z-lab/dflash6.1k6.3k

138 Stars in the last 61 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

One release, one version, and a repository with six entries

The whole project is small on disk. The top level holds a code directory, a manifest, a license, a readme, a gitignore and a .github directory, with no test tree, no examples directory and no documentation beyond the readme itself. There is a single release, version 0.1.0, and the manifest declares the same number, which is the healthy case. The release was published at the same moment as the last push to the default branch, so the tagged build and the branch head are the same commit. The console entry point is one function, a main inside the package's command line module, which is what makes the two verbs on the page, generate and benchmark, work. The manifest classifies the project as beta and as operating system independent, and declares a floor of Python 3.10 with classifiers through 3.13.

Three backends, three names for the same reasoning setting

The command line takes the same verb on all three backends and the same flag, but what the flag means depends on which model family you point it at. The Transformers backend supports the second generation for one model and the first generation for two families, and for the Muse model it calls the setting reasoning strength, offering low, medium, high and xhigh with high as the default. The MLX backend calls the same idea the reasoning effort and offers low, medium and xhigh, with xhigh as the default and no high in the list at all. So a command line that works against one target can fail against another for a reason that has nothing to do with the flag name, and the defaults are not the same either: the Transformers example passes high while the MLX example passes xhigh, each matching its own documented default.

The checkpoint list is much longer than the list the local backends accept

The supported models section names a lot of families: several Qwen generations with sizes from 4B to a 397B mixture, a Gemma 4 line, two MiniMax versions, three Kimi versions including a code variant, GPT-OSS at two sizes, Llama 3.1 at 8B, GLM 5.1 and an Alpamayo release. That list is a list of published checkpoints, not a list of things you can run locally, and the page says so directly. The instruction is to use the Transformers or MLX backends for the model families they explicitly list, and to benchmark anything else through an OpenAI-compatible server. So a checkpoint for a family nobody has wired up locally is still usable, just by a different route: install a serving stack separately, launch it, and point this package at its base address.

Quantized MLX runs at a block size of five or less

One hardware constraint is documented with a reason, which makes it more useful than a rule with no explanation. For quantized targets or drafts on the MLX backend, the page sets the block size at five or below and gives the mechanism: the current quantized matrix multiplication kernel becomes less efficient at larger verify widths. That is the whole of the tuning guidance in the repository, and it is not a round number chosen for convenience. The example that demonstrates it runs both the target and the draft at four-bit weights with a block size of five and the highest reasoning setting, which makes it a complete configuration for the constrained case rather than a partial one:

bash
dflash generate mlx \
    --model mlx-community/Qwen3.8-27B-4bit \
    --draft z-lab/Qwen3.8-27B-DFlash2 \
    --draft-bits 4 --block-size 5 --reasoning xhigh \
    "How many positive whole-number divisors does 196 have?"

Anyone planning to push the block size higher on Apple hardware should expect the kernel, not the memory, to be the limit.

The sample count flag is named differently on the server path

Evaluation is described as sharing one set of datasets across every benchmark: grade school maths, a harder maths set, two code sets and a chat benchmark, downloaded and cached by the datasets library from the hub. The three benchmark commands are otherwise almost identical, with one difference that will bite you in a script. The server path takes a prompt count and a concurrency setting, while both local paths take a maximum sample count instead. So the same run, with the same dataset and the same size, is spelled two different ways depending on which backend executes it. The MLX command also passes the block size and the draft bit width, which have no counterpart in the server command.

The base install already pulls the datasets library

There are two installs, and the smaller one is not as small as it looks:

bash
pip install dflash
pip install "dflash[local]"  # local inference

The base package exists to drive an OpenAI-compatible server, and its three dependencies are a progress bar, an HTTP client and the datasets library, each pinned to an exact version rather than a range. The datasets library is what downloads and caches the benchmark files, so a user who only wants to send prompts to somebody else's server still installs the benchmark machinery. The extra for local inference is where the real weight sits, and it is split by platform rather than by feature: on Linux it adds a template engine, PyTorch and the Transformers library, and on macOS on arm64 it adds MLX, an MLX language layer and the hub client. Nothing is added for other combinations, and the manifest still describes the distribution as operating system independent.

Server support is pinned to three specific pull requests

Running the benchmark against a real serving stack means installing something else first, and the page is unusually precise about which build. Three of the four options are given as links to particular pull requests rather than to release pages: one in the SGLang repository, one in the vLLM repository, and one in the llama.cpp repository. The fourth is a prebuilt disk image, an arm64 build of a fork of another serving project, versioned for this second generation of the model. The instruction is the same in each case: install it, launch its OpenAI-compatible server with DFlash enabled, then pass the base address to this package. The acknowledgements say where that support came from, naming two individuals and one organisation for the SGLang work and one person at a hardware vendor for the vLLM work.

The second generation is documented by a different organisation

The page describes two generations, and they are not presented the same way. The first has a paper, with an identifier on a preprint server, and a project page on the organisation's own domain. The second has no paper link at all: it has a blog post on a different company's domain and a model collection on the hub. The citation block follows suit, with a three-author article entry for the first and a second entry credited to a corporate author with a month and year and the blog address as its locator. The first entry lists the preprint server as if it were a journal, which is a common shortcut in bibliographies and worth recognising when you cite it. Feedback and requests for new model support go through a web form rather than the issue tracker, even though the manifest points its issues link at the repository.

Editorial conclusion

DFlash is for people running inference locally who want a drafter that proposes several tokens in parallel rather than one at a time, and the package is small enough to read: one directory of code, one manifest, one release. Three things to establish before you plan a rollout. Which backend you can actually use, because the two local ones are platform-gated and the checkpoint list is far longer than the list either of them accepts. Which reasoning parameter your model family uses, because the two local backends do not agree on the name or on the default. And what happens at larger block sizes on Apple hardware, where the page sets a ceiling of five whenever weights are quantized and gives the reason. On the server path, the requirements are equally specific: three of the four supported serving projects are pinned to particular pull requests.

Frequently asked questions

what is dflash

A lightweight block diffusion model designed for speculative decoding, which means it drafts tokens that a target model then verifies, and it is built to fill several positions in parallel rather than one at a time. It ships as a Python package named dflash with a console entry point of the same name.

how to use dflash

Install the package, then pick one of three backends. The Transformers backend needs a target and a draft checkpoint, the MLX backend runs on Apple silicon and takes draft bit width and block size, and the openai backend takes a base address of a server you launched yourself.

Which models can DFlash draft for without a server?

The Transformers backend is listed for the Muse model on the second generation and for Qwen3 and Llama 3.1 at 8B on the first. The MLX backend is listed for Qwen3.8 at 27B on the second and for Qwen3, Qwen3.5, Qwen3.6 and Gemma 4 on the first. Other published checkpoints go through a server.

Does DFlash change what the model outputs?

The page does not address it. It describes DFlash as a draft model for speculative decoding and says the drafting is parallel and high quality, but it says nothing about whether a drafted token can differ from what the target model would have produced on its own.

What does DFlash need before it can benchmark against a server?

A serving stack installed separately, at a supported version: three of the four options are given as specific pull requests in the SGLang, vLLM and llama.cpp repositories, and the fourth is a prebuilt arm64 image of a fork of another serving project. You launch its OpenAI-compatible server with DFlash and pass the base address to the package.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. z-lab/dflash on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/z-lab-dflash.svg)](https://hysenlabs.com/projects/z-lab-dflash)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/z-lab-dflash.svg)](https://hysenlabs.com/projects/z-lab-dflash)

Was this useful?