dflash-mlx-speculative-decoding — Claude Code skill: setup guide
Speeds up MLX inference on Apple Silicon by 1.7x to 4.1x using lossless DFlash speculative decoding with block diffusion drafts.
npx skills add reason-machines/trending-skills --skill dflash-mlx-speculative-decoding -a claude-codeWhat dflash-mlx-speculative-decoding does
This skill guides the coding agent through configuring DFlash speculative decoding inside Apple Silicon MLX setups. Generation relies on a compact draft model near 1B parameters that produces 16 candidate tokens simultaneously. The primary model evaluates this entire block during one forward pass. Because only verified tokens make it into output, the generated text matches greedy decoding.
The package provides paired setups for Qwen3.5 models at 4B, 9B, 27B, and 35B. Draft checkpoints resolve automatically through an internal registry. You also get a CLI runner dflash, an OpenAI-compatible runtime dflash-serve on port 8000, and a benchmarking tool dflash-benchmark.
An Apple Silicon Mac, Python 3.10+, and MLX 0.31.1+ are mandatory. Unlisted model checkpoints fail at startup unless you supply an explicit draft model using --draft.
What it helps with
- speed up token generation under MLX
- run a local OpenAI-compatible inference server on port 8000
- benchmark inference speed gains against baseline mlx_lm
- configure speculative decoding pairs for Qwen3.5
Example prompts for the agent
- Start a local dflash-serve instance with model Qwen/Qwen3.5-9B on port 8000
- Benchmark Qwen/Qwen3.5-9B against baseline MLX with a 1024 token limit
- Write a Python script using DFlashRuntime for streaming token output
How to install dflash-mlx-speculative-decoding
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill dflash-mlx-speculative-decoding -a claude-code2Manually: put the files in place
~/.claude/skills/dflash-mlx-speculative-decoding/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/dflash-mlx-speculative-decoding/
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill dflash-mlx-speculative-decoding -a codex2Manually: put the files in place
.agents/skills/dflash-mlx-speculative-decoding/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill dflash-mlx-speculative-decoding -a cursor2Manually: put the files in place
.cursor/skills/dflash-mlx-speculative-decoding/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install reason-machines/trending-skills dflash-mlx-speculative-decoding2Manually: put the files in place
.github/skills/dflash-mlx-speculative-decoding/SKILL.md1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill dflash-mlx-speculative-decoding -a gemini-cli2Platform CLI
gemini skills install https://github.com/reason-machines/trending-skills --path skills/dflash-mlx-speculative-decodingManually: put the files in place
.devin/skills/dflash-mlx-speculative-decoding/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill dflash-mlx-speculative-decoding -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about dflash-mlx-speculative-decoding
How to install dflash-mlx-speculative-decoding in Claude Code?
Run npx skills add reason-machines/trending-skills --skill dflash-mlx-speculative-decoding -a claude-code. The file will be placed in ~/.claude/skills/dflash-mlx-speculative-decoding/SKILL.md.
What does dflash-mlx-speculative-decoding do?
It gives your assistant ready patterns to run DFlash speculative decoding inside MLX on Apple Silicon. Draft models propose 16 tokens at once, verified in a single forward pass.
What dependencies does DFlash require on Apple Silicon?
You need an Apple Silicon Mac, Python 3.10 or newer, and MLX 0.31.1+. The Python runtime installs via pip install dflash-mlx.