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: 8/24/2026
{
"issues": [
{
"file": "README.md",
"line": 203,
"type": "secret-exfiltration",
"message": "Instruction appears to send credentials/secrets to an external endpoint",
"severity": "medium"
},
{
"file": "README.md",
"line": 274,
"type": "secret-exfiltration",
"message": "Instruction appears to send credentials/secrets to an external endpoint",
"severity": "medium"
}
],
"status": "PASSED",
"scannedAt": "2026-08-24T04:42:31.970Z",
"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 584 GitHub stars.
Yes. mlx-dspark passed SkillsLLM'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. SkillsLLM 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!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
mlx-dspark runs two EAGLE-family speculative-decoding drafters natively on Apple Silicon: DeepSeek's DSpark (semi-autoregressive, from the DeepSpec codebase, used to accelerate DeepSeek-V4) and z-lab's DFlash (block diffusion). Both 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.
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:
| target | best measured speedup | speed (chat → best) |
|---|---|---|
| Qwen3.8-27B (8-bit, DFlash 2)[^q38] | 4.06× math · 4.05× code · 2.79× chat | ~24–34 tok/s |
| LFM2.5-1.2B (bf16, conv-hybrid)[^lfm2] | 3.78× math · 3.70× code · 2.44× chat | ~245–380 tok/s |
| LFM2.5-2.6B (bf16, conv-hybrid)[^lfm2] | 3.37× math · 2.39× code · 2.11× chat | ~93–148 tok/s |
| Muse-Glimmer-30B (8-bit, dense)[^muse] | 3.27× math · 2.50× code · 2.22× chat | ~18–26 tok/s |
| Gemma-4 12B (8-bit) | 3.09× math · 2.63× chat · 2.61× code | ~46–55 tok/s |
| Qwen3.6-27B (8-bit) | 2.67× math · 2.26× chat · 1.96× code | ~16–22 tok/s |
| Qwen3.8-27B (4-bit, DFlash 2)[^q38] | 2.63× math · 2.62× code · 1.68× chat | ~25–38 tok/s |
| Ornith-1.0-9B (8-bit) | 2.53× code · 2.48× math · 2.21× chat | ~59–68 tok/s |
| Qwen3-14B (8-bit) | 2.36× math · 2.11× code · 1.62× chat | ~25–36 tok/s |
| Qwen3-8B (8-bit) | 2.29× math · 2.06× code · 1.81× chat | ~51–64 tok/s |
| Qwen3-4B (8-bit) | 1.98× math · 1.77× chat · 1.70× code | ~87–101 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 |
[!TIP] Qwen3.8-27B's measured best is now a DFlash 2 drafter, on both quants —
incoai/Qwen3.8-27B-DFlash2(Inco AI's DFlash successor: a candidate path selector + dynamic convs that lift acceptance at the same verify width). Measured paired, same session, identical width 8: 8-bit 3.63× mean (4.06× math · 4.05× code · 2.79× chat, accept 5.53) vs the DSpark head's 2.92×; 4-bit 2.30× (accept 5.14, 33.8 tok/s — the fastest decode among the project's 27B-class targets) vs 2.01×. Chat gains the most (+40% at 8-bit). Greedy-lossless like everything here, and prefix caching covers this mode too. No flags needed:--mode auto— the default, and what the Mac app uses — resolves each row's measured-best mode, which is DFlash 2 here:# the default mode (auto) resolves DFlash 2 for this target (downloads it once): mlx-dspark serve --model mlx-community/Qwen3.8-27B-8bit mlx-dspark generate --model mlx-community/Qwen3.8-27B-8bit --prompt "…" # name a mode explicitly to A/B; --mode dspark still gets the DSpark heads: mlx-dspark generate --model mlx-community/Qwen3.8-27B-4bit --mode dspark --prompt "…"No cap flag needed: the dflash default (full block = cap 7) is the measured optimum on both quants. The DSpark rows remain the measured best of their mode —
DimInfer/Qwen3.8-27B-Dspark-v1at 4-bit (1.99–2.01×, cap 7, no confidence flag) andRadixArk/Qwen3.8-27B-DSparkat 8-bit (2.72–2.92×, cap 7) — see DSpark vs DFlash for the head-to-head.
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 quants shown are each model's measured best — ratios are non-monotone in bits and peak at 8-bit on current MLX (full Ornith sweep: 4-bit 1.38× · 8-bit 2.17× · bf16 1.54× on code; bf16 loses in both ratio and absolute speed because MLX's unquantized matmul pays a ~2× cost cliff at verify width 2). Details in Results at a glance.
Nothing in this table is hand-tuned per model, and none of it is pinned to this M4 Pro:
with no --max-draft, mlx-dspark measures your machine's verify/drafter cost curves once
(~5 s, cached per model + quant + mlx version) and derives the draft cap from them — an M1 or
an M5 gets its own optimum, not the one these rows were measured at. --max-draft auto
additionally adapts the cap per round while generating. See Tuning.
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.0 automatically (0.32's quantized-matmul kernels are what current speedup numbers are measured on). Model weights download from the Hugging