Instructions to use johninthepool/Qwen3.8-27B-MTPLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use johninthepool/Qwen3.8-27B-MTPLX-4bit 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("johninthepool/Qwen3.8-27B-MTPLX-4bit") 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 johninthepool/Qwen3.8-27B-MTPLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "johninthepool/Qwen3.8-27B-MTPLX-4bit"
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": "johninthepool/Qwen3.8-27B-MTPLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use johninthepool/Qwen3.8-27B-MTPLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "johninthepool/Qwen3.8-27B-MTPLX-4bit"
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 "johninthepool/Qwen3.8-27B-MTPLX-4bit" \ --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 johninthepool/Qwen3.8-27B-MTPLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "johninthepool/Qwen3.8-27B-MTPLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "johninthepool/Qwen3.8-27B-MTPLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "johninthepool/Qwen3.8-27B-MTPLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use johninthepool/Qwen3.8-27B-MTPLX-4bit 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 "johninthepool/Qwen3.8-27B-MTPLX-4bit"
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 johninthepool/Qwen3.8-27B-MTPLX-4bit
Run Hermes
hermes
- Atomic Chat
Qwen3.8-27B-MTPLX-4bit
MTP weights kept. This build does not strip the model's multi-token-prediction head — it is preserved at full bf16 precision (
mtp_policy: keep_bf16) alongside the 4-bit quantized body, so native speculative decoding still works.
A 4-bit MLX build of Qwen/Qwen3.8-27B for Apple Silicon, produced with mtplx forge. Unlike a standard mlx_lm.convert quantization, this build preserves the model's native multi-token-prediction (MTP) head instead of discarding it, so it runs with real speculative decoding on mtplx — not just a quantized weight dump.
Why this build exists
Qwen3.8-27B is a hybrid architecture (Gated DeltaNet linear attention interleaved with Gated Attention, 16 groups of 3:1). Standard MLX conversion paths (mlx_lm.convert, and MLX inference engines built around dense-attention assumptions) silently strip the model's 15 MTP tensors during conversion — the model still loads and generates, but you lose the native speculative-decoding speedup entirely, often without any error or warning.
This build's recipe uses mtp_policy: keep_bf16, which retains the MTP block in full precision alongside the quantized body, and validates it with mtplx's tune verification suite (long-code-uncapped, 2048 max tokens) before shipping.
Quantization recipe
| Parameter | Value |
|---|---|
| Body precision | 4-bit affine |
| Group size | 64 |
| MTP head | kept at bf16 (not quantized) |
| Source | Qwen/Qwen3.8-27B (bf16 native) |
Group size 64 was chosen over the tighter g32 default because the target hardware (Apple Silicon with 64GB+ unified memory) has headroom to trade a small amount of table overhead for faster dequantization, with no measurable quality cost at this bit depth.
Requirements
- Apple Silicon Mac (M-series)
- mtplx — required to use the native MTP speculative-decode path. Standard
mlx-lmcan load this model's body weights but will not use the MTP head.
Usage
mtplx quickstart --model johninthepool/Qwen3.8-27B-MTPLX-4bit --port 8020 \
--reasoning off --paged-kv-quantization q8
--reasoning off is recommended for agentic/tool-calling workloads — leaving reasoning on causes this model to spend a large number of tokens per turn on hidden thinking before it produces usable output.
--paged-kv-quantization q8 quantizes the KV cache to 8-bit, giving substantially larger usable context at negligible quality cost. Qwen3.8-27B natively supports up to 262,144 tokens of context (extendable to ~1M with YaRN).
What you get vs. what you give up
You get: native speculative decoding via the preserved MTP head, full 4-bit body compression (~17GB on disk), long-context serving via paged KV quantization.
You give up relative to the 8-bit sibling: a small amount of body-weight precision. If output quality matters more than footprint/throughput for your use case, see johninthepool/Qwen3.8-27B-MTPLX-8bit.
Provenance
Built from the original Qwen/Qwen3.8-27B weights with no fine-tuning, distillation, or calibration pass applied — this is a direct affine (round-to-nearest) quantization of the release weights, with the MTP head kept unquantized. No behavioral changes beyond quantization noise are expected relative to the source model.
- Downloads last month
- -
4-bit
Model tree for johninthepool/Qwen3.8-27B-MTPLX-4bit
Base model
Qwen/Qwen3.8-27B