Instructions to use leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx") config = load_config("leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use leonsarmiento/Qwen3.8-27B-MTP-4bit-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 "leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx"
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": "leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use leonsarmiento/Qwen3.8-27B-MTP-4bit-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 "leonsarmiento/Qwen3.8-27B-MTP-4bit-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 leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use leonsarmiento/Qwen3.8-27B-MTP-4bit-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 "leonsarmiento/Qwen3.8-27B-MTP-4bit-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 "leonsarmiento/Qwen3.8-27B-MTP-4bit-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"
leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx
⚠️ This is NOT a standalone model. This is an MTP drafter — a companion model that accelerates a Qwen3.8-27B base quant via speculative decoding. You need BOTH models: a Qwen3.8-27B base + this drafter. Loading only this repo generates nothing useful.
Recommended base: leonsarmiento/Qwen3.8-27B-3bit-mlx
(VLM, 3-bit with 4-bit embeds/lm_head + 8-bit vision, reasoning effort baked to low).
Also compatible with any other Qwen3.8-27B MLX quant of the same architecture (e.g. mlx-community 4-bit).
How to pair
LM Studio
- Load the base model (e.g.
Qwen3.8-27B-3bit-mlx) - In the model's settings, set the Draft / Speculative model to this drafter
- Enable speculative decoding (MTP)
- Disable TurboQuant KV cache — MTP shows no advantage with it enabled
oMLX
- Load the base model
- Point the draft model setting at this drafter's path/repo (model settings via the
admin API,
PUT /admin/api/models/{model_id}/settings) - Disable TurboQuant KV cache
When NOT to pair: thinking-mode / reasoning-heavy tasks. MTP is a throughput win for instruct/fast generation; on long thinking chains it tends to increase wall time and can degrade accuracy (measured on Qwen3.6-35B-A3B MATHQA: −7pp with MTP on). Also note this drafter accelerates text decode only — it does not participate in vision processing.
Standalone MTP (Multi-Token Prediction) drafter for Qwen3.8-27B MLX quantizations.
Extracted from Qwen/Qwen3.8-27B (the
mtp.* tensors in shard 18) and quantized to 4-bit affine, group_size=64 —
same depth as the community 4-bit drafter, built directly from source. Only
258 MB.
Drafter details
model_type: qwen3_5_mtp,block_size: 3(proposes 3 tokens per step)- 15 tensors:
fc, one transformer layer (layers.0.*: gated attention + MLP),norm,pre_fc_norm_embedding/pre_fc_norm_hidden - Norm weights stored in MLX RMSNorm convention (+1.0 shifted from HF raw)
- Linear layers: 4-bit affine (
weight+scales+biases), group_size=64 {"format":"mlx"}safetensors metadata (verified)- Norms kept bf16;
mtp_use_dedicated_embeddings: false(shares base embeddings)
Verification
Built and verified against source shard 18:
| Check | Result |
|---|---|
| Norm convention (7 tensors) | = source + 1.0 (bf16 rounding only) |
| Key set vs mlx-community 4-bit drafter | identical (31 tensors) |
| safetensors metadata | {"format":"mlx"} |
| Size | 258 MB |
- Downloads last month
- -
4-bit
Model tree for leonsarmiento/Qwen3.8-27B-MTP-4bit-mlx
Base model
Qwen/Qwen3.8-27B