Downloads · 30 days
167
33% of all-time downloads
petergilani/Qwen3.8-27B-MTP-4bit
Qwen3.8-27B-MTP-4bit 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.
4-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
167
33% of all-time downloads
All-time downloads
499
Public
Parameters
4.3B
15.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors15.4 GB · 100%
How the weights are stored.
U323.4B · 80%
From the Hugging Face model README
4-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.4-bit is the most memory-efficient MTP quantization of Qwen3.8-27B, making it the option for hardware where the full bf16 or 8-bit weights do not fit comfortably. As with the 8-bit release, the full weights remain the best choice for maximum quality wherever they fit, while 4-bit with MTP provides the best speed/quality trade-off for large output tasks on memory-constrained machines. For the optimal balance of speed and quality, you can re-use your KV cache and hot toggle between the full weights and MTP-4bit 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-4bit"
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)