Instructions to use mlx-community/Qwen3.8-27B-OptiQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Qwen3.8-27B-OptiQ-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("mlx-community/Qwen3.8-27B-OptiQ-4bit") config = load_config("mlx-community/Qwen3.8-27B-OptiQ-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 mlx-community/Qwen3.8-27B-OptiQ-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 "mlx-community/Qwen3.8-27B-OptiQ-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": "mlx-community/Qwen3.8-27B-OptiQ-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use mlx-community/Qwen3.8-27B-OptiQ-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 "mlx-community/Qwen3.8-27B-OptiQ-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 mlx-community/Qwen3.8-27B-OptiQ-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mlx-community/Qwen3.8-27B-OptiQ-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 "mlx-community/Qwen3.8-27B-OptiQ-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 "mlx-community/Qwen3.8-27B-OptiQ-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-community/Qwen3.8-27B-OptiQ-4bit
Built with mlx-optiq, the MLX-native toolkit to quantize, fine-tune, and serve LLMs locally on Apple Silicon, no PyTorch and no cloud. Try the Lab · All OptiQ quants · Docs
A 4-bit mixed-precision MLX quant of Qwen/Qwen3.8-27B, an image+text model. Per-layer bit-widths come from a KL-divergence sensitivity pass on a six-domain calibration mix (prose · reasoning · code · agent · tool-call · constraint-bearing instructions). Sensitive layers go to 8-bit; robust ones stay at 4-bit.
The vision tower is kept at bf16 in a sidecar, so this repo loads text-only under stock mlx-lm and image+text under OptiQ.
Quantization details
| Property | Value |
|---|---|
| Predominant precision | 4-bit |
| Layers at 8-bit (sensitive) | 261 |
| Layers at 4-bit (robust) | 237 |
| Total quantized layers | 498 |
| Group size | 64 |
| Vision tower | bf16, optiq/optiq_vision.safetensors (0.9 GB) |
| Calibration mix | six-domain mix (40 samples × 6 domains) |
| Reference for sensitivity | uniform-4-bit (bf16 at this size does not fit 36 GB) |
| On-disk size | 19.0 GB |
Qwen3.8-27B is a hybrid: three quarters of its 64 blocks use linear attention (five projections each) and the rest full attention, which is why the sweep scores 498 tensors rather than the ~450 a dense model of this size would have.
We follow the same naming convention llama.cpp uses for Q4_K_M and similar mixed-precision quants: the "4-bit" label is for the predominant precision, not the weighted average.
Usage
Load it with mlx-lm for text:
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/Qwen3.8-27B-OptiQ-4bit")
response = generate(
model, tokenizer,
prompt="Explain quantum computing in simple terms.",
max_tokens=200,
)
For image+text, mixed-precision KV-cache serving, sensitivity-aware LoRA fine-tuning, an OpenAI + Anthropic-compatible inference server, hot-swap mounted adapters and sandboxed Python execution, install mlx-optiq:
pip install mlx-optiq
optiq serve --model mlx-community/Qwen3.8-27B-OptiQ-4bit
See the Qwen family guide on mlx-optiq.com for sampling defaults, training recipes, and family-specific caveats.
Benchmarks
| Metric | Score |
|---|---|
| MMLU (5-shot, 1000) | 84.1% |
| GSM8K (3-shot CoT) | 96.1% |
| IFEval (prompt-level, strict) | 77.1% |
| BFCL-V3 simple (AST) | 93.5% |
| HumanEval (pass@1) | 92.1% |
| HashHop (long-context retrieval) | 85.0% |
| Capability Score (mean of 6) | 87.98 |
18.9 GB on disk.
Every metric gets one equal vote, and disk size is reported next to the score as an honest second axis rather than folded into it. See the eval-framework writeup for the methodology.
Links
- Project website: mlx-optiq.com
- PyPI: pypi.org/project/mlx-optiq
- Calibration mix: mlx-optiq.com/blog/calibration-mix
- Eval framework: mlx-optiq.com/blog/eval-framework
- Base model: Qwen/Qwen3.8-27B
Quantize your own
This quant was produced by mlx-optiq. Point it at any Hugging Face model to get the same sensitivity-aware mixed precision:
pip install mlx-optiq
optiq convert Qwen/Qwen3.8-27B --target-bpw 5.0 --candidate-bits 4,8
optiq lab # or drive the whole thing from the browser
- Downloads last month
- 1,902
4-bit
Model tree for mlx-community/Qwen3.8-27B-OptiQ-4bit
Base model
Qwen/Qwen3.8-27B