Text Generation
MLX
Safetensors
qwen3_5
quantized
mixed-precision
4bit
8bit
optiq
apple-silicon
qwen3.6
conversational
4-bit precision
Instructions to use mlx-community/Qwen3.6-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.6-27B-OptiQ-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("mlx-community/Qwen3.6-27B-OptiQ-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 mlx-community/Qwen3.6-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.6-27B-OptiQ-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": "mlx-community/Qwen3.6-27B-OptiQ-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use mlx-community/Qwen3.6-27B-OptiQ-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 "mlx-community/Qwen3.6-27B-OptiQ-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/Qwen3.6-27B-OptiQ-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Qwen3.6-27B-OptiQ-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use mlx-community/Qwen3.6-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.6-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.6-27B-OptiQ-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mlx-community/Qwen3.6-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.6-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.6-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"
Normalize model card: remove twitter ref, lowercase 'optiq', add multimodal stripping note
Browse files
README.md
CHANGED
|
@@ -19,10 +19,17 @@ tags:
|
|
| 19 |
|
| 20 |
> Optimized for Apple Silicon with [mlx-optiq](https://mlx-optiq.pages.dev/) — sensitivity-aware mixed-precision quantization, reusable at inference, fine-tuning, and serving time.
|
| 21 |
|
| 22 |
-
This is a mixed-precision quantized version of [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B) in MLX format. Instead of uniform 4-bit across every layer,
|
| 23 |
|
| 24 |
The `optiq_metadata.json` sidecar ships in the repo; it's what `mlx-optiq` reads to drive sensitivity-aware LoRA fine-tuning, mixed-precision KV serving, and hot-swap adapter routing.
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
## Quantization Details
|
| 27 |
|
| 28 |
| Property | Value |
|
|
@@ -76,7 +83,7 @@ optiq serve \
|
|
| 76 |
--max-tokens 32768 --temp 0.6 --top-p 0.95
|
| 77 |
```
|
| 78 |
|
| 79 |
-
**Sensitivity-aware LoRA fine-tuning** — layers
|
| 80 |
|
| 81 |
```bash
|
| 82 |
optiq lora train mlx-community/Qwen3.6-27B-OptiQ-4bit \
|
|
@@ -103,12 +110,12 @@ See the [Results page](https://mlx-optiq.pages.dev/results.html) for full method
|
|
| 103 |
|
| 104 |
- **Documentation:** https://mlx-optiq.pages.dev/
|
| 105 |
- **PyPI:** https://pypi.org/project/mlx-optiq/
|
| 106 |
-
- **Article:** [Not All Layers Are Equal](https://
|
| 107 |
- **Base model:** [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B)
|
| 108 |
|
| 109 |
## Credits
|
| 110 |
|
| 111 |
-
- **Quantization method:** [mlx-optiq](https://pypi.org/project/mlx-optiq/)
|
| 112 |
- **Base model:** [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B)
|
| 113 |
- **Runtime:** [MLX](https://github.com/ml-explore/mlx)
|
| 114 |
|
|
|
|
| 19 |
|
| 20 |
> Optimized for Apple Silicon with [mlx-optiq](https://mlx-optiq.pages.dev/) — sensitivity-aware mixed-precision quantization, reusable at inference, fine-tuning, and serving time.
|
| 21 |
|
| 22 |
+
This is a mixed-precision quantized version of [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B) in MLX format. Instead of uniform 4-bit across every layer, optiq measures each layer's sensitivity via KL divergence on calibration data and assigns **per-layer** bit-widths (some layers at 8-bit, the rest at 4-bit) at the same average bits-per-weight. Same size, higher quality.
|
| 23 |
|
| 24 |
The `optiq_metadata.json` sidecar ships in the repo; it's what `mlx-optiq` reads to drive sensitivity-aware LoRA fine-tuning, mixed-precision KV serving, and hot-swap adapter routing.
|
| 25 |
|
| 26 |
+
**Multimodal stripping (default):** the base is published as a multimodal foundation model, but this optiq release ships the language stack only. Vision/audio config + token metadata are dropped at conversion time so the artifact is smaller, leaves more RAM for KV cache + LoRA, and runs cleanly on lower-spec Apple Silicon with longer contexts. If you need the vision tower, re-convert from the base with:
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
optiq convert Qwen/Qwen3.6-27B --target-bpw 4.5 --keep-unused-modalities -o ./mmodel
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
|
| 33 |
## Quantization Details
|
| 34 |
|
| 35 |
| Property | Value |
|
|
|
|
| 83 |
--max-tokens 32768 --temp 0.6 --top-p 0.95
|
| 84 |
```
|
| 85 |
|
| 86 |
+
**Sensitivity-aware LoRA fine-tuning** — layers optiq kept at 8-bit (more sensitive) get 2× the adapter rank of layers at 4-bit, at the same base budget:
|
| 87 |
|
| 88 |
```bash
|
| 89 |
optiq lora train mlx-community/Qwen3.6-27B-OptiQ-4bit \
|
|
|
|
| 110 |
|
| 111 |
- **Documentation:** https://mlx-optiq.pages.dev/
|
| 112 |
- **PyPI:** https://pypi.org/project/mlx-optiq/
|
| 113 |
+
- **Article:** [Not All Layers Are Equal — methodology + results](https://mlx-optiq.pages.dev/experiments)
|
| 114 |
- **Base model:** [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B)
|
| 115 |
|
| 116 |
## Credits
|
| 117 |
|
| 118 |
+
- **Quantization method:** [mlx-optiq](https://pypi.org/project/mlx-optiq/)
|
| 119 |
- **Base model:** [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B)
|
| 120 |
- **Runtime:** [MLX](https://github.com/ml-explore/mlx)
|
| 121 |
|