Instructions to use p4ik/Qwen3.8-27B-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use p4ik/Qwen3.8-27B-MLX-4bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("p4ik/Qwen3.8-27B-MLX-4bit") config = load_config("p4ik/Qwen3.8-27B-MLX-4bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use p4ik/Qwen3.8-27B-MLX-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 "p4ik/Qwen3.8-27B-MLX-4bit"
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": "p4ik/Qwen3.8-27B-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use p4ik/Qwen3.8-27B-MLX-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 "p4ik/Qwen3.8-27B-MLX-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 p4ik/Qwen3.8-27B-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use p4ik/Qwen3.8-27B-MLX-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 "p4ik/Qwen3.8-27B-MLX-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 "p4ik/Qwen3.8-27B-MLX-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"
Qwen3.8-27B-MLX-4bit
A uniform 4-bit MLX quantization (group size 64) of Qwen/Qwen3.8-27B for Apple Silicon — as a full package: bf16 vision tower, MTP speculative-decoding head, processor configs, hardened chat template. Every layer at 4 bits, no mixed precision.
Tip: the smallest full package of this base. For quality per byte take the OptiQ-5bit — a third of the flip rate at +3.6 GiB.
Highlights
- 🖼️ Image input on all three stacks:
optiq serve,mlx-vlm,vllm-mlx. Ships the base model's processor configs, which quantization pipelines commonly drop — without them, images are silently ignored. - ⚡ MTP speculative decoding, engine-agnostic.
Head at
mtp/weights.safetensors— the default pathoptiq serveandvllm-mlxboth search. - 🔧 Hardened chat template, adopted from unsloth.
Accepts
developer, merges system messages, guards tool-call arguments; renders byte-identically to the original (verified).
How it compares
| Publisher | |||||
| Weights (GiB) | 26.62 |
17.67 |
18.06 |
18.09 |
14.09 |
| BPW¹ | 8.50 |
5.64 |
5.77 |
5.78 |
4.50 |
| Allocation | uniform² |
measured (bf16) |
measured (bf16) |
measured (u4) |
uniform² |
| Split 4/5/8 | all @8 |
100/262/136 |
270/–/228 |
237/–/261 |
all @4 |
| Measured KV | — |
✓ |
✓ |
— |
— |
| Vision³ | ✓ |
✓ |
✓ |
OptiQ only |
✓ |
| MTP head³ | ✓ |
✓ |
✓ |
OptiQ only |
✓ |
| Hardened template | ✓ |
✓ |
✓ |
— |
✓ |
| ΔNLL overall⁴ | 0.000 (anchor) |
+0.019 ± 0.019 |
+0.029 ± 0.015 |
+0.040 ± 0.030 |
+0.038 ± 0.045 |
| — German prose⁵ | 0 |
+0.023 ± 0.003 |
+0.019 ± 0.002 |
+0.022 ± 0.002 |
+0.039 ± 0.003 |
| — tool-call spans | 0 |
−0.001 ± 0.013 |
−0.008 ± 0.017 |
+0.004 ± 0.005 |
+0.013 ± 0.009 |
| — thinking spans | 0 |
−0.001 ± 0.014 |
+0.004 ± 0.013 |
−0.005 ± 0.021 |
+0.008 ± 0.013 |
| Flips per 10k⁶ | — |
216 |
503 |
566 |
772 |
| Divergence⁷ | (anchor) |
10.3 |
10.3 |
9.7 |
7.9 |
¹ Bits per weight, file-based: shard bytes × 8 / parameters, same formula for every column.
² Our uniform reference builds — full packages (bf16 vision, MTP head, hardened template), deliberately without measured allocation or KV config.
³ ✓ = works on all three stacks (optiq serve, mlx-vlm, vllm-mlx).
Vision needs the base model's processor configs, which quantization
pipelines commonly drop; the MTP head needs the engine-neutral path
mtp/weights.safetensors. "OptiQ only": runs solely under
optiq serve — that repo lacks the processor configs, and its MTP
head sits on optiq's internal path that other engines do not search.
⁴ Paired next-token NLL over a 196k-token corpus (agentic transcripts with tool calls and thinking, German prose, WikiText) against the uniform 8-bit anchor; corpus and method are ours.
⁵ All German-prose deltas lie beyond 2 SE; every other ΔNLL row is within noise.
⁶ Tokens the 8-bit anchor is near-certain about (NLL < 0.05) that jump above NLL 0.5 — the failure mode that breaks tool-call syntax. Lower is better.
⁷ Free-running greedy decoding, 32 tokens from 168 held-out prompt windows of the NLL corpus: mean position of the first token that departs from the anchor's trajectory (higher is better). Share of trajectories still identical after 8 tokens: 46 / 48 / 46 / 35 %.
Use
Image input, uniform 4-bit KV cache, MTP speculation — one line:
pip install mlx-optiq
optiq serve --model p4ik/Qwen3.8-27B-MLX-4bit --mtp --kv-bits 4
--kv-bits 4 (group size 64) matches the cache to the all-4-bit
footprint — the smallest total. For measured per-layer KV, take the
OptiQ repos. Text-only use works with plain mlx-lm; image input
also runs under mlx-vlm and vllm-mlx.
Files
| File | Purpose |
|---|---|
model-*.safetensors |
Uniform 4-bit weights, group size 64 |
preprocessor_config.json |
Image preprocessing for mlx-vlm / vllm-mlx |
mtp/weights.safetensors |
MTP head — default path for optiq serve and vllm-mlx |
optiq/optiq_vision.safetensors |
Vision tower, bf16 |
No measured KV config and no sensitivity table — those are products of the measured OptiQ builds.
Sampling
From the base model card, unchanged: temperature 1.0 / top_p 0.95 (thinking), 0.7 / 0.8 (instruct).
- Downloads last month
- 51
4-bit
Model tree for p4ik/Qwen3.8-27B-MLX-4bit
Base model
Qwen/Qwen3.8-27B