Text Generation
MLX
Safetensors
qwen3_5
mtplx
qwen
qwen3.8
speculative-decoding
mtp
quantized
conversational
8-bit precision
Instructions to use Kecven/Qwen3.8-27B-MTPLX-Q8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Kecven/Qwen3.8-27B-MTPLX-Q8 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("Kecven/Qwen3.8-27B-MTPLX-Q8") 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 Kecven/Qwen3.8-27B-MTPLX-Q8 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Kecven/Qwen3.8-27B-MTPLX-Q8"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Kecven/Qwen3.8-27B-MTPLX-Q8" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Kecven/Qwen3.8-27B-MTPLX-Q8 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Kecven/Qwen3.8-27B-MTPLX-Q8"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Kecven/Qwen3.8-27B-MTPLX-Q8" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kecven/Qwen3.8-27B-MTPLX-Q8", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Kecven/Qwen3.8-27B-MTPLX-Q8 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 "Kecven/Qwen3.8-27B-MTPLX-Q8"
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 Kecven/Qwen3.8-27B-MTPLX-Q8
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Kecven/Qwen3.8-27B-MTPLX-Q8 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Kecven/Qwen3.8-27B-MTPLX-Q8"
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 "Kecven/Qwen3.8-27B-MTPLX-Q8" \ --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"
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,7 +1,128 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
library_name: mlx
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
-
tags:
|
| 6 |
-
- mlx
|
| 7 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- Qwen/Qwen3.8-27B
|
| 5 |
+
tags:
|
| 6 |
+
- mlx
|
| 7 |
+
- mtplx
|
| 8 |
+
- qwen
|
| 9 |
+
- qwen3.8
|
| 10 |
+
- speculative-decoding
|
| 11 |
+
- mtp
|
| 12 |
+
- quantized
|
| 13 |
library_name: mlx
|
| 14 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# Qwen3.8-27B-MTPLX-Q8
|
| 18 |
+
|
| 19 |
+
MTPLX-compatible 8-bit conversion of `Qwen/Qwen3.8-27B`, built from the original BF16 checkpoint while preserving the model's native MTP weights in BF16.
|
| 20 |
+
|
| 21 |
+
## Quantization
|
| 22 |
+
|
| 23 |
+
- Base model: `Qwen/Qwen3.8-27B`
|
| 24 |
+
- Body: 8-bit affine
|
| 25 |
+
- Group size: 64
|
| 26 |
+
- MTP sidecar: native BF16
|
| 27 |
+
- Maximum verified MTP depth: 3
|
| 28 |
+
- Source format: native BF16 + MTP
|
| 29 |
+
|
| 30 |
+
Forge recipe:
|
| 31 |
+
|
| 32 |
+
```json
|
| 33 |
+
{
|
| 34 |
+
"body_bits": 8,
|
| 35 |
+
"body_dtype": "auto",
|
| 36 |
+
"body_group_size": 64,
|
| 37 |
+
"body_mode": "affine",
|
| 38 |
+
"mtp_policy": "keep_bf16"
|
| 39 |
+
}
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Verification Results
|
| 43 |
+
|
| 44 |
+
The model was verified locally with MTPLX Forge.
|
| 45 |
+
|
| 46 |
+
| Mode | Speed | vs AR | Acceptance |
|
| 47 |
+
|---|---:|---:|---|
|
| 48 |
+
| AR / depth 0 | 9.36 tok/s | 1.00× | — |
|
| 49 |
+
| MTP depth 1 | 18.84 tok/s | 2.01× | 100.00% |
|
| 50 |
+
| MTP depth 2 | 26.84 tok/s | 2.87× | 95.92% / 93.20% |
|
| 51 |
+
| MTP depth 3 | **29.03 tok/s** | **3.10×** | 97.38% / 90.09% / 83.67% |
|
| 52 |
+
|
| 53 |
+
Forge verdict:
|
| 54 |
+
|
| 55 |
+
```text
|
| 56 |
+
mtp_depth_wins
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
All tested MTP depths passed the Forge quality verification gate.
|
| 60 |
+
|
| 61 |
+
## Performance
|
| 62 |
+
|
| 63 |
+
The strongest verified configuration was MTP depth 3:
|
| 64 |
+
|
| 65 |
+
```text
|
| 66 |
+
AR: 9.36 tok/s
|
| 67 |
+
MTP depth 3: 29.03 tok/s
|
| 68 |
+
Speedup: 3.10×
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
The third speculative position was still accepted approximately 83.7% of the time.
|
| 72 |
+
|
| 73 |
+
These throughput numbers are hardware-specific and should primarily be used as relative measurements between AR and MTP on the same machine.
|
| 74 |
+
|
| 75 |
+
## Q4 vs Q8
|
| 76 |
+
|
| 77 |
+
A separate 4-bit build of the same model was also tested on the same system.
|
| 78 |
+
|
| 79 |
+
| Quantization | AR | MTP D3 | MTP Speedup |
|
| 80 |
+
|---|---:|---:|---:|
|
| 81 |
+
| Q4 | 15.74 tok/s | **44.34 tok/s** | 2.82× |
|
| 82 |
+
| Q8 | 9.36 tok/s | **29.03 tok/s** | 3.10× |
|
| 83 |
+
|
| 84 |
+
The Q8 build achieves a larger relative MTP multiplier, but the Q4 build has substantially higher absolute throughput because the smaller model body requires less memory bandwidth.
|
| 85 |
+
|
| 86 |
+
The Q8 variant is intended for users who prefer higher weight precision and can accept the additional memory usage and lower decode throughput.
|
| 87 |
+
|
| 88 |
+
## MTP Acceptance
|
| 89 |
+
|
| 90 |
+
At the selected depth 3:
|
| 91 |
+
|
| 92 |
+
```text
|
| 93 |
+
Position 1: 97.38%
|
| 94 |
+
Position 2: 90.09%
|
| 95 |
+
Position 3: 83.67%
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
This high acceptance rate allows native MTP speculative decoding to provide a substantial speedup over standard autoregressive decoding.
|
| 99 |
+
|
| 100 |
+
## Architecture
|
| 101 |
+
|
| 102 |
+
```text
|
| 103 |
+
Base architecture: Qwen3.8-27B
|
| 104 |
+
MTPLX architecture: qwen3-next-mtp
|
| 105 |
+
Body precision: 8-bit affine
|
| 106 |
+
MTP precision: BF16
|
| 107 |
+
Maximum MTP depth: 3
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
The native MTP weights were preserved from the original checkpoint and were not requantized.
|
| 111 |
+
|
| 112 |
+
## Usage
|
| 113 |
+
|
| 114 |
+
This model is intended for MTPLX on Apple Silicon.
|
| 115 |
+
|
| 116 |
+
MTPLX can use the included `mtplx_runtime.json` metadata to determine the MTP contract, supported speculative depth, sampler configuration, and locally verified performance profile.
|
| 117 |
+
|
| 118 |
+
## Related Model
|
| 119 |
+
|
| 120 |
+
For significantly higher throughput with a smaller memory footprint, see:
|
| 121 |
+
|
| 122 |
+
`Kecven/Qwen3.8-27B-MTPLX-Q4`
|
| 123 |
+
|
| 124 |
+
The Q4 build reached approximately **44.34 tok/s** at MTP depth 3 on the same verification setup.
|
| 125 |
+
|
| 126 |
+
## License
|
| 127 |
+
|
| 128 |
+
Apache-2.0, following the license of the original `Qwen/Qwen3.8-27B` model.
|