by ARahim3
Up to 4× faster LLM decoding on Apple Silicon, lossless. Native MLX port of DeepSeek's DSpark & z-lab's DFlash speculative decoding — Gemma-4, Qwen3.8, Muse-Glimmer, Nemotron, LFM2.5, Ornith-1.0, ternary Bonsai-27B.
# Add to your Claude Code skills
git clone https://github.com/ARahim3/mlx-dsparkLast scanned: 11/29/2026
{
"issues": [
{
"file": "README.md",
"line": 174,
"type": "secret-exfiltration",
"message": "Instruction appears to send credentials/secrets to an external endpoint",
"severity": "medium"
}
],
"status": "PASSED",
"scannedAt": "2026-11-29T13:41:24.711Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}mlx-dspark is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by ARahim3. Up to 4× faster LLM decoding on Apple Silicon, lossless. Native MLX port of DeepSeek's DSpark & z-lab's DFlash speculative decoding — Gemma-4, Qwen3.8, Muse-Glimmer, Nemotron, LFM2.5, Ornith-1.0, ternary Bonsai-27B. It has 807 GitHub stars.
Yes. mlx-dspark passed AgentsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/ARahim3/mlx-dspark" and add it to your Claude Code skills directory (see the Installation section above).
mlx-dspark is primarily written in Python. It is open-source under ARahim3 on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mlx-dspark against similar tools.
No comments yet. Be the first to share your thoughts!
mlx-dspark runs EAGLE-family speculative-decoding drafters natively on Apple Silicon: DeepSeek's DSpark (semi-autoregressive, from the DeepSpec codebase, used to accelerate DeepSeek-V4), z-lab's DFlash (block diffusion), and the two heads built on DFlash since — Inco AI's DFlash 2 and Tencent's DSpine. All of them are lossless — the target verifies every token, so output is identical to normal decoding — and run under one verify loop, so you can serve them, script them, or benchmark them head-to-head.
Documentation: arahim.dev/mlx-dspark — setup for every agent and app, the HTTP API, a model picker, and how speculation behaves on a Mac.
What this is not: DeepSeek-V4 inference. The targets are consumer-size models (Gemma-4, Qwen3, Meta's Muse-Glimmer, NVIDIA's Nemotron, PrismML's ternary Bonsai-27B, …) with published DSpark drafters — so this runs the real drafter method on a Mac, but the model producing tokens is one of those, not V4. V4 Flash/Pro (MoE, batched serving) is DSpark's own headline use case.
Every row auto-resolves its drafter from --model (any quant of the target matches). Measured warm on
an M4 Pro, medians of 3 — most rows with mlx-dspark benchmark --trials 3 (three prompts:
chat/code/math), the Muse row per-content best (footnoted); full tables, baselines, and method in
Results at a glance. Sorted by best measured speedup. These are
short-context numbers; at agent-sized prompts (16k–32k tokens) see
Long context:
| target | best measured speedup | speed (chat → best) |
|---|---|---|
| Nanbeige4.2-3B (bf16, looped)[^nanbeige] | 4.31× math · 2.50× code · 1.98× chat | ~34–74 tok/s |
| Gemma-4 12B (8-bit) | 4.24× math · 2.90× code · 2.62× chat | ~48–78 tok/s |
| Qwen3.8-27B (4-bit, DFlash 2)[^q38] | 4.23× math · 3.80× code · 2.72× chat | ~42–65 tok/s decode |
| Qwen3.8-27B (8-bit, DFlash 2)[^q38] | 4.22× math · 3.80× code · 2.99× chat | ~25–35 tok/s |
| MiniCPM5-2B (bf16, dense)[^minicpm5] | 4.21× math · 3.15× code · 2.12× chat | ~107–213 tok/s |
| LFM2.5-1.2B (bf16, conv-hybrid)[^lfm2] | 3.83× code · 3.82× math · 2.40× chat | ~240–385 tok/s |
| LFM2.5-2.6B (bf16, conv-hybrid)[^lfm2] | 3.49× math · 2.65× code · 2.24× chat | ~97–152 tok/s |
| Muse-Glimmer-30B (8-bit, dense)[^muse] | 3.27× math · 2.50× code · 2.22× chat | ~18–26 tok/s |
| Inkling-2-Mini (NVFP4, looped MoE, DFlash 2)[^inkling] | 3.18× math · 3.07× code · 1.65× chat over stock mlx-vlm (2.63× overall, 27.5 → 72.2 tok/s) · over our own plain decode: 2.41× · 2.30× · 1.28× | ~46–88 tok/s decode · opt-in --target-bits 8: +15% (+32% plain), not the released weights |
| Qwen3-8B (8-bit) | 2.83× math · 2.03× code · 1.71× chat | ~50–83 tok/s |
| Qwen3.6-27B (8-bit) | 2.67× math · 2.26× chat · 1.96× code | ~16–22 tok/s |
| Ornith-1.0-9B (8-bit) | 2.53× code · 2.48× math · 2.21× chat | ~59–68 tok/s |
| Qwen3-4B (8-bit) | 2.46× math · 1.78× chat · 1.72× code | ~89–126 tok/s |
| Qwen3-14B (8-bit) | 2.36× math · 2.11× code · 1.62× chat | ~25–36 tok/s |
| Qwen3.6-35B-A3B (4-bit, MoE)[^moe] | 1.67× math · 1.24× code · 1.05× chat | ~91–145 tok/s |
| Nemotron-3.5-Lightning-30B-A3B (4-bit, MoE+Mamba)[^nemotron] | 1.34× math · 1.27× code · 1.07× chat | ~87–112 tok/s |
| Ternary-Bonsai-27B (2-bit) | 1.13× code | ~26–29 tok/s |
The speed column is the measured range across the three benchmark contents at the row's best configuration — chat at the low end, code/math at the high end (decoding speed depends on what is being generated: copy- and structure-heavy content accepts longer drafts). Baselines and per-content splits are in Results at a glance.
This table is the set of pairs we have measured and vouch for, which is also exactly the
auto-resolve registry — that is the only thing the registry is for. It is not the set of models
that work: any DeepSpec-native drafter runs against any compatible target via --drafter, and any
target at all gets drafter-free speculation via --mode auto. See
Bring your own drafter. Per-model caveats and
methodology live in the numbered footnotes at the end of this page — click a marker to jump.
Target precision: the quant shown is each model's measured best. Where a model ships quants, 8-bit gives the best ratio and 4-bit the highest absolute speed; the bf16 rows are small models published in bf16. More under Which target should I use?.
Nothing in this table is hand-tuned per model or pinned to this M4 Pro: with no
--max-draft, mlx-dspark measures your machine's cost curves once (~5 s, cached) and derives
the draft cap from them, so an M1 or an M5 gets its own optimum
(how).
Copy-heavy code editing goes further: when the model re-emits or refactors code already in its
context (the daily agent/assistant workload), match-scaled lookup drafts reach 4.5× on Gemma-12B
(75 tok/s) and 3.6× on Ornith-9B (93 tok/s). Any model not listed still gets drafter-free
lookup speculation via --mode auto.
Everything below is also available as a native Mac app — chat with saved sessions, a model manager that answers "will this fit my Mac?" before you download, live speculative-decoding telemetry (per-round acceptance, this machine's measured cost curves), a "This Mac" roofline view (your measured memory bandwidth, the plain-decode ceiling for the loaded model and how far above it speculation runs, macOS memory pressure and swap), a decoder Race with a checked lossless verdict, one-click coding-agent setup, and a menu-bar gauge with live tok/s and model memory.
brew tap ARahim3/mlx-dspark https://github.com/ARahim3/mlx-dspark
brew trust arahim3/mlx-dspark # Homebrew 6+: third-party taps need explicit trust
brew install --cask mlx-dspark
xattr -dr com.apple.quarantine /Applications/mlx-dspark.app # not notarized yet: clear
# quarantine once, or use System Settings › Privacy &
# Security › "Open Anyway" after the first launch
(On Homebrew ≤ 5, brew install --cask --no-quarantine mlx-dspark still works and replaces
the trust/xattr steps — Homebrew 6 removed that flag.)
Or download the DMG from Releases (app-v*
tags) and drag it to Applications. First launch sets up its own private engine runtime (no
Homebrew Python, no venv of yours touched, ~2–4 min once) and keeps the engine on the latest
release automatically; the app itself tells you when a newer app version exists
(brew upgrade --cask mlx-dspark). pip install mlx-dspark stays engine-only — the app is
not in the wheel, and the app never touches a pip-installed engine.
pip install mlx-dspark # or: uv pip install mlx-dspark
Apple Silicon + Python ≥ 3.10; installs mlx ≥ 0.32.5 automatically (its few-row kernels make every verify pass cheaper; the tables below were measured on 0.32.0–0.32.2). Model weights download from the Hugging Face cache on first use (none bundled). No server framework is pulled in — the API server is built on the standard library.
mlx-dspark generate --model mlx-community/Qwen3-8B-8bit --prompt "Explain rainbows."
mlx-dspark serve --model mlx-community/Qwen3-8B-8bit # OpenAI + Anthropic API on :8080
That's the whole setup — swap in any target from the table above. Three things worth knowing, then you can stop reading:
--model takes any HF repo or local path (exactly like
mlx-lm); the matching drafter and that pair's measured-best settings resolve automatically.
A model that isn't in the table still gets drafter-free speculation via --mode auto, or pass
--drafter <repo> yourself.