Instructions to use cliffordh/Qwen3.8-27B-OptiQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use cliffordh/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("cliffordh/Qwen3.8-27B-OptiQ-4bit") config = load_config("cliffordh/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 cliffordh/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 "cliffordh/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": "cliffordh/Qwen3.8-27B-OptiQ-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use cliffordh/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 "cliffordh/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 cliffordh/Qwen3.8-27B-OptiQ-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use cliffordh/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 "cliffordh/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 "cliffordh/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"
Qwen3.8-27B-OptiQ-4bit
Sensitivity-aware 4/8-bit mixed-precision OptiQ quantization of Qwen/Qwen3.8-27B for Apple Silicon via mlx-optiq.
What this is
This model was produced by mlx-optiq using a KL-divergence sensitivity pass on a six-domain calibration mix. The process measures each layer's sensitivity to quantization error, then allocates bit-widths accordingly: layers where quantization causes large KL divergence from the unquantized reference get 8-bit precision, while robust layers get 4-bit.
Per-layer bit allocation (from optiq/metadata.json)
| Metric | Value |
|---|---|
| Layers at 8-bit | 274 |
| Layers at 4-bit | 224 |
| Total quantized layers | 498 |
| Target bpw | 5.00 |
| Achieved bpw | 5.15 |
| On-disk size | ~20 GB (4 safetensors shards) |
| Total parameters | ~26.9B |
Naming convention: Following the llama.cpp convention, "4bit" in the model name refers to the predominant (lower) precision tier, not the average bits-per-weight. The actual average is ~5.15 bpw due to the mixed allocation.
Bundled components
- MTP head (
optiq/mtp.safetensors): Multi-token prediction head for optional ~1.4x speculative decoding throughput. - Vision encoder (
optiq/optiq_vision.safetensors): Full-precision vision encoder sidecar (879 MB), preserving the base model's multimodal capabilities. - Sensitivity data (
optiq/sensitivity.json): Per-layer KL-divergence measurements used to determine the bit allocation.
Validation
This quantization was validated against uniform 4-bit and uniform 8-bit baselines using a small reasoning-trap test suite designed to surface where low-bit quantization degrades reasoning. The suite probes three failure modes:
| Reasoning probe | Uniform 4-bit | This OptiQ 4/8 | Uniform 8-bit |
|---|---|---|---|
| Arithmetic precision -- combined SE tax/FICA-style computation (~15.3% on $60K) under a plausible-but-wrong framing | Incorrect (produced halved figure) | Correct | Correct |
| Multi-constraint numeric reasoning -- biweekly-to-monthly budget mapping with hidden 3-paycheck months, rent + mortgage + debt-snowball ordering | Averaged away the 3-paycheck structure | Correctly enumerated higher-income months | Correctly enumerated higher-income months |
| Premise-checking -- question containing a subtle false premise about an entity-taxation election | Accepted false premise | Flagged the false premise | Flagged the false premise |
On a 48 GB M4 Pro, this build ran without swap pressure where uniform 8-bit swapped heavily.
Comparison with lighter mixed-precision (3.5 bpw)
Tested against rapid-mlx/Qwen3.8-27B-mixed-3.5bpw-MLX (the 3.5 bpw mixed-precision build distributed via rapid-mlx's built-in model registry) on the same prompts. The lighter model ran faster (16 tok/s vs ~7 tok/s) but lost precision on both discriminating tests:
- Arithmetic: produced incorrect Medicare rate (2.0% instead of correct 2.9%), yielding total FICA of $8,640 instead of the correct $9,180
- Premise-checking: accepted the false SMLLC premise without challenge
This suggests 5.15 bpw is near the minimum threshold for preserving these reasoning capabilities on this model, and 3.5 bpw cuts below it.
Vision
The vision tower is preserved at full precision (not quantized) via the optiq/optiq_vision.safetensors sidecar. In testing, the model correctly identified fine-grained visual details in a real image -- distinguishing a stylized tattoo from a photograph and reading small elements such as a pendant and background symbols. Peak memory with the vision tower loaded was ~24.7 GB on an M4 Pro.
Note: These results reflect observed behavior on specific probes and are not a warranty of accuracy. They are not benchmarks of real-world performance, and should not be interpreted as fitness claims for any professional, financial, tax, or legal use case.
Reproduction prompt
The prompt that most clearly discriminated between quantization levels:
A single-member LLC elects S-corp taxation. The owner takes a $60K salary on $150K net income. Walk me through the self-employment tax implications and whether the salary would withstand IRS reasonable compensation scrutiny.
At 5.15 bpw: correct combined FICA rate (15.3%, total $9,180) and flagged the SMLLC premise. At 3.5 bpw: incorrect Medicare rate (2.0% vs 2.9%, total $8,640) and accepted the premise. Uniform 4-bit: halved the total to $4,590.
Provenance & alignment
This is a derivative of Qwen/Qwen3.8-27B, a model developed by Alibaba Cloud (Qwen team) and released under the Apache 2.0 license. Only the weight representations have been modified (quantization); no fine-tuning or alignment changes were made.
The base model carries RLHF alignment inherited from its training process. This alignment includes avoidance of certain politically sensitive topics narrowly scoped to specific domestic-policy areas. This does not affect general reasoning, technical, coding, or multimodal use cases, but users working with politically sensitive content should be aware of this characteristic.
Usage
Load and generate with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("cliffordh/Qwen3.8-27B-OptiQ-4bit")
prompt = "Explain the tradeoffs of mixed-precision quantization."
response = generate(model, tokenizer, prompt=prompt, max_tokens=512)
print(response)
Serve with speculative decoding (MTP)
optiq serve cliffordh/Qwen3.8-27B-OptiQ-4bit --mtp
Disclaimer
Experimental quantized derivative provided AS-IS under the Apache 2.0 license, with no warranty of fitness for any purpose. Validation tests probe reasoning behavior on specific prompts, not real-world accuracy. Not intended for production or professional-advice use without independent verification.
Credits
Quantized by cliffordh using mlx-optiq.
Base model: Qwen/Qwen3.8-27B by the Qwen team (Alibaba Cloud).
- Downloads last month
- 574
4-bit
Model tree for cliffordh/Qwen3.8-27B-OptiQ-4bit
Base model
Qwen/Qwen3.8-27B