Text Generation
MLX
Safetensors
qwen3_5
mtp
qwen
speculative-decoding
conversational
8-bit precision
Instructions to use trevon/Qwen3.5-27B-MLX-MTP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use trevon/Qwen3.5-27B-MLX-MTP 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("trevon/Qwen3.5-27B-MLX-MTP") 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 trevon/Qwen3.5-27B-MLX-MTP with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "trevon/Qwen3.5-27B-MLX-MTP"
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": "trevon/Qwen3.5-27B-MLX-MTP" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use trevon/Qwen3.5-27B-MLX-MTP 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 "trevon/Qwen3.5-27B-MLX-MTP"
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 trevon/Qwen3.5-27B-MLX-MTP
Run Hermes
hermes
- MLX LM
How to use trevon/Qwen3.5-27B-MLX-MTP with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "trevon/Qwen3.5-27B-MLX-MTP"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "trevon/Qwen3.5-27B-MLX-MTP" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trevon/Qwen3.5-27B-MLX-MTP", "messages": [ {"role": "user", "content": "Hello"} ] }'
Qwen3.5-27B-MLX-MTP (affine-8)
MLX conversion of Qwen/Qwen3.5-27B, affine 8-bit (group_size 64), with the native Multi-Token-Prediction (MTP) head embedded in the main weight shards for native speculative decoding.
What changed from the previous packaging
This release replaces the previous full-precision sidecar packaging:
- Quantization: full-precision → affine 8-bit (group_size 64). ~50 GB → ~27 GB.
- MTP head: previously a
mtp.safetensorssidecar that requiredmlx_lm_extra_tensorsmetadata to be honored. Now embedded directly inmodel.safetensors.index.json, so both stockmlx-lm(which silently strips MTP) and the AirRunnerfeat/mtp-nativebranch (PR 990) load it without any glue or symlink hack. - Fully verified for
--mtp: produced as a one-stepmlx_lm.convert -q --q-mode affineagainst the upstream Qwen base, no intermediate dequant→requant.
Conversion command
mlx_lm.convert --hf-path Qwen/Qwen3.5-27B \
--mlx-path Qwen3.5-27B-MLX-MTP \
-q --q-mode affine --q-bits 8 --q-group-size 64
Run
Without MTP (stock mlx-lm from PyPI):
mlx_lm.generate --model trevon/Qwen3.5-27B-MLX-MTP \
--prompt "..." --max-tokens 100
With MTP (AirRunner fork):
git clone https://github.com/AirRunner/mlx-lm.git
cd mlx-lm && git checkout feat/mtp-native
uv venv && uv pip install -e .
mlx_lm.generate --model trevon/Qwen3.5-27B-MLX-MTP \
--prompt "..." --max-tokens 100 --mtp
Benchmarks (Apple M4 Max)
| Mode | tokens/sec |
|---|---|
no --mtp |
14.5 |
--mtp |
23.9 (+64%) |
Apache 2.0 per upstream Qwen3.5.
- Downloads last month
- 791
Model size
27B params
Tensor type
BF16
·
U32 ·
F32 ·
Hardware compatibility
Log In to add your hardware
8-bit
Model tree for trevon/Qwen3.5-27B-MLX-MTP
Base model
Qwen/Qwen3.5-27B