Instructions to use Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2 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("Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2") 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 Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2"
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 "Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2" \ --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"
- MLX LM
How to use Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2 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 "Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2"
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 Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2
Run Hermes
hermes
Qwen3.6-27B MTPLX Optimized Speed V2
The recommended 27B model for local coding and agent work with MTPLX on Apple Silicon.
V2 is a hand-calibrated quantization of Qwen3.6-27B built for one job: fast, high-quality coding on a Mac. It cuts quantization loss by 47% compared to the original Optimized Speed release, and it pulls further ahead the longer an agent session runs.
Quickstart
brew install youssofal/mtplx/mtplx
mtplx start
mtplx start recommends this model automatically on Macs with 32 GB of
unified memory or more, and offers smaller verified models below that.
Direct usage:
mtplx pull Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2
mtplx run "hello" --model Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2
mtplx serve --model Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2 --port 8000
mtplx serve exposes OpenAI and Anthropic compatible endpoints, so the model
works inside OpenCode, Claude Code, Cline, and other coding agents.
The numbers
Measured on an M5 Max against the original Optimized Speed release, same engine, same prompts:
- KL divergence to the full-precision bf16 model: 0.072 vs 0.135, on an 86k-token held-out battery. 47% less quantization loss than the original.
- Draft acceptance at 17k tokens of agent context: 98 / 86 / 78% per draft position, vs 73 / 50 / 33% for the original.
- Decode at that context: 45.7 vs 36.1 tok/s, about 27% faster.
- Peak speculative multiplier: 2.86x over the matched autoregressive baseline, the highest we have measured on any 27B build.
These numbers are one story, not four. Speculative decoding is only as fast as its drafts are accurate, and a trunk that stays this close to full precision keeps its drafts landing deep into long contexts. Quality is the speed lever.
The tradeoff: V2 is 19.9 GB vs 16.4 GB for the original, so cold short chats can be a few percent slower. Everything else is faster.
How it is built
Not a round-to-nearest conversion. The layout was tuned tensor by tensor against the bf16 reference:
- Most weights are 4-bit with small groups, refit against real activation statistics with error-weighted least squares instead of naive rounding.
- The tensors that hurt most at 4-bit were promoted by hand: embeddings, the output head, convolution and attention output projections, and the late MLP layers run at 8-bit, with the most sensitive layers kept in full bf16.
- The native multi-token-prediction head ships as a calibrated sidecar
(
mtp/weights.safetensors). No external draft model is needed.
The result lands at roughly 5.8 bits per weight. The goal was never the smallest file. It is the best coding model that still fits comfortably in unified memory.
About MTPLX
MTPLX is an MLX-native inference engine built around Qwen's native
multi-token prediction: the model drafts its own tokens and the engine
verifies them with exact probability-ratio acceptance, so output quality
matches non-speculative decoding at any temperature. It adds warm session
caching for fast agent round-trips, a native macOS app, and a one-line
install via Homebrew or pip install mtplx.
Which model to pick
- Coding, tool use, long agent sessions: this model.
- Tight on storage, mostly short chat: Qwen3.6-27B-MTPLX-Optimized-Speed is 3.5 GB smaller.
- Lower-memory Macs: Qwen3.5-9B and Qwen3.5-4B are verified for smaller memory tiers.
Verification
mtplx_runtime.json records the verified runtime contract:
- architecture:
qwen3-next-mtp, maximum MTP depth 3,turboprofile - sampler: temperature 0.6, top-p 0.95, top-k 20
- KLD and perplexity measured against the bf16 teacher on an 86k-token held-out battery
- verified hardware: Apple M5 Max, 128 GB unified memory
- served model id:
mtplx-qwen36-27b-optimized-speed-v2
Files
model-*.safetensors: calibrated hybrid-quantized model shardsmtp/weights.safetensors: native MTP sidecarmtplx_runtime.json: verified MTPLX runtime contract- tokenizer and processor files from the Qwen model family
Sources and attribution
| Component | Source | License |
|---|---|---|
| Base model | Qwen/Qwen3.6-27B | Apache-2.0 |
| MTPLX conversion, calibration, and runtime contract | youssofal/MTPLX | Apache-2.0 |
- Downloads last month
- 408
4-bit
Model tree for Youssofal/Qwen3.6-27B-MTPLX-Optimized-Speed-V2
Base model
Qwen/Qwen3.6-27B