Instructions to use nathansutton/Qwen3.8-27B-DFlash2-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use nathansutton/Qwen3.8-27B-DFlash2-MLX with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("nathansutton/Qwen3.8-27B-DFlash2-MLX") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use nathansutton/Qwen3.8-27B-DFlash2-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nathansutton/Qwen3.8-27B-DFlash2-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "nathansutton/Qwen3.8-27B-DFlash2-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use nathansutton/Qwen3.8-27B-DFlash2-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "nathansutton/Qwen3.8-27B-DFlash2-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "nathansutton/Qwen3.8-27B-DFlash2-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nathansutton/Qwen3.8-27B-DFlash2-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use nathansutton/Qwen3.8-27B-DFlash2-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nathansutton/Qwen3.8-27B-DFlash2-MLX"
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:8080/v1 hermes config set model.default nathansutton/Qwen3.8-27B-DFlash2-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use nathansutton/Qwen3.8-27B-DFlash2-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "nathansutton/Qwen3.8-27B-DFlash2-MLX"
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:8080/v1 \ --custom-model-id "nathansutton/Qwen3.8-27B-DFlash2-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Qwen3.8-27B-DFlash2-MLX
The DFlash2 block drafter and the tokenizer for Qwen3.8-27B, and nothing else: no target weights. It is the sidecar chad attaches to any Qwen3.8-27B checkpoint it loads — in particular to Unsloth's GGUF files, which chad runs natively in its MLX engine and which download from Unsloth, not from here.
Use it
uvx chad-code --model ~/models/Qwen3.8-27B-UD-Q3_K_XL.gguf
Download the GGUF you want from unsloth/Qwen3.8-27B-GGUF.
chad reads the file directly (no conversion), fetches this repository on first use (~1.2 GB),
builds a small model directory around the file and decodes with the drafter attached.
Nothing here needs to be downloaded by hand.
Rough guide for a 24 GB Mac, drafter attached (the governor sizes the window from the actual machine):
| Unsloth file | weights | context |
|---|---|---|
UD-Q2_K_XL |
9.8 GB | ~170k |
UD-IQ3_XXS |
10.9 GB | ~138k |
UD-IQ3_S |
12.0 GB | ~107k |
UD-Q3_K_XL |
13.2 GB | ~74k |
Contents
dflash/— the DFlash2 drafter: a 1.9B model that reads the target's residual stream at five tapped layers and proposes a whole block of tokens in one forward, quantized to 4-bit group-64 in MLX format. A drafter reads the residual stream, which the target's weight quantization only perturbs, so one drafter trained against the bf16 base serves every quant of this model. chad verifies each block in one batched target forward with exact rejection sampling: greedy output is token-identical to unspeculated decoding (to kernel rounding), sampled output keeps the model's distribution at any temperature. It is in a subdirectory on purpose:mlx-lmglobsmodel*.safetensorsat the repo root, so it is invisible to a base-model loader.tokenizer.json,tokenizer_config.json,chat_template.jinja,generation_config.json— Qwen3.8-27B's tokenizer and chat template. chad uses this template rather than the one embedded in a GGUF because this one rendersreasoning_effort=mediumunless told otherwise (the GGUF's defaults toxhigh), and a byte-stable prompt is what keeps chad's prefix cache warm.
Provenance and license
Apache-2.0. The drafter weights are converted from
z-lab/Qwen3.8-27B-DFlash2; the method
is Chen et al., DFlash: Block Diffusion for Flash Speculative Decoding (arXiv:2602.06036).
Only the quantization and the MLX layout are ours; please honor the original release's
license and citation terms. The tokenizer files are Qwen3.8-27B's (Alibaba Cloud,
Apache-2.0). See NOTICE.txt.
Quantized
Model tree for nathansutton/Qwen3.8-27B-DFlash2-MLX
Base model
Qwen/Qwen3.8-27B