Downloads · 30 days
33
9% of all-time downloads
petergilani/Qwen3.8-27B-MTP-8bit
Qwen3.8-27B-MTP-8bit is a text generation model from petergilani. Use it when you need the model to write or continue text. It is set up for mlx-lm. The card lists the license as apache-2.0.
8-bit quantized version of Qwen3.8-27B with multi-token prediction (MTP) capabilities preserved. Quantization performed using mlx-lm pull request https://github.com/ml-explore/mlx-lm/pull/990 to preserve MTP weights.…
Downloads · 30 days
33
9% of all-time downloads
All-time downloads
372
Public
Parameters
7.7B
29.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors29 GB · 100%
How the weights are stored.
U326.8B · 89%
From the Hugging Face model README
8-bit quantized version of Qwen3.8-27B with multi-token prediction (MTP) capabilities preserved. Quantization performed using mlx-lm pull request https://github.com/ml-explore/mlx-lm/pull/990 to preserve MTP weights. Original model: https://huggingface.co/Qwen/Qwen3.8-27B
config_1M.json for hot-swapping to enable YaRN (Yet another RoPE extensioN) for ultra-long context processing up to 1M tokens, and config_default.json to switch back. The main config.json ships with the default 256K context configuration. Per Qwen's guidance, static YaRN can impact performance on shorter texts, so only swap to config_1M.json when long-context processing is required. For details on using YaRN with this model, see https://huggingface.co/Qwen/Qwen3.8-27Bpreserve_thinking: False.8-bit is the highest-quality MTP quantization of Qwen3.8-27B, making it the recommended quantized option on hardware where the full bf16 weights saturate memory bandwidth (e.g. Apple M4 Max) — in that regime, enabling MTP on the full weights actually decreases TPS, while 8-bit with MTP restores and exceeds it. The full weights remain the best choice for maximum quality wherever they fit, while 8-bit with MTP provides the best speed/quality trade-off for large output tasks. For the optimal balance of speed and quality, you can re-use your KV cache and hot toggle between the full weights and MTP-8bit within the same conversation:
You can give your agent a toggle_mtp tool with these instructions so it can dynamically switch between the appropriate weights for maximum performance for both prefill and decode.
config_1M.json (YaRN)MTP support for this model currently requires installing mlx-lm from PR #990 (not yet in main/release):
# Option 1: pip install
pip install https://github.com/ml-explore/mlx-lm/archive/refs/pull/990/head.zip
# Option 2: uv run (no virtual env needed)
uv run --with https://github.com/ml-explore/mlx-lm/archive/refs/pull/990/head.zip python example.py
import mlx_lm
from mlx_lm.sample_utils import make_sampler
model_path = "petergilani/Qwen3.8-27B-MTP-8bit"
model, tokenizer = mlx_lm.load(model_path)
sampler = make_sampler(temp=1.0, top_p=0.95, top_k=20)
prompt = "Explain multi-token prediction in language models."
response = mlx_lm.generate(
model,
tokenizer,
prompt=prompt,
sampler=sampler,
max_tokens=512,
mtp=True # Enable Multi-Token Prediction for faster generation
)
print(response)