library_name: mlx
license: apache-2.0
pipeline_tag: image-text-to-text
base_model: OpenUncensored/Qwen4-35B-A3B-Uncensored
tags:
- mlx
- qwen4_moe
- apple-silicon
- moe
- vision
- abliterated
- uncensored
Qwen4-35B-A3B Uncensored — MLX bf16 (vision)
bf16 MLX conversion of OpenUncensored/Qwen4-35B-A3B-Uncensored, a refusal-ablated edit of Qwen/Qwen4-35B-A3B, for Apple Silicon. 35B parameters, 3B active per token, 1M-token context.
What this repo adds over the original edit: the measured refusal rate at every precision. The editors flagged that quantizing the edited experts might weaken the edit and had not measured it. We did — see Refusal retention.
At a glance
| Size on disk | 112.0 GB |
| Bits per weight | 16 |
| Decode speed | 46.9 tok/s (M3 Ultra) |
| Peak memory | 114.4 GB at 16K context |
| Context | 1,048,576 tokens |
| Vision | yes — vision tower kept |
Requirements — read this first
Released mlx-lm (0.32.2 at the time of writing) does not know the qwen4_moe architecture. Support is in an open pull request, ml-explore/mlx-lm#2141. Until it merges:
pip install "git+https://github.com/jundot/mlx-lm@9e1accb772d078c8702a5173b0ba4dfc3d50d030" tiktoken xgrammar
That is branch qwen4-moe-vision, pinned to the commit these builds were tested with. The tokenizer is remote code, so pass trust_remote_code.
Usage
mlx_lm.generate --model donedynamics/Qwen4-35B-A3B-Uncensored-VL-MLX-bf16 --trust-remote-code \
--prompt "Introduce yourself briefly." --max-tokens 256
from mlx_lm import load, generate
model, tok = load("donedynamics/Qwen4-35B-A3B-Uncensored-VL-MLX-bf16", tokenizer_config={"trust_remote_code": True})
msgs = [{"role": "user", "content": "Introduce yourself briefly."}]
prompt = tok.apply_chat_template(msgs, add_generation_prompt=True,
enable_thinking=False)
print(generate(model, tok, prompt=prompt, max_tokens=256))
Images
mlx_lm.generate --model donedynamics/Qwen4-35B-A3B-Uncensored-VL-MLX-bf16 --trust-remote-code \
--ignore-chat-template --image photo.png -m 300 \
-p $'<|im_start|>user\n<|vision_start|><|image_pad|><|vision_end|>What does this image show?<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n'
Each <|image_pad|> takes one --image, in order.
Thinking mode
The chat template reasons by default and the answer starts only after <think> closes, so a small max_tokens can return reasoning and nothing else. Pass enable_thinking=False for direct answers. Quality checks ran with thinking off; the refusal test ran both ways.
Quantization recipe
Uniform 4-bit costs this architecture about a third of its perplexity. The damage sits in a few small modules that save almost nothing when quantized, above all the hyper-connection mixers that blend the model's four residual streams. The 4-bit build keeps them in bf16, puts embeddings and lm_head at 8-bit, and uses group size 32 for the rest (and keeps the vision tower in bf16, which the first VL 4-bit build had quantized: it misread shapes). 6-bit and 8-bit are uniform: they already match bf16.
Perplexity, 64 fixed samples × 512 tokens, stock model (bf16 = 8.913):
| Step | Perplexity | Size |
|---|---|---|
Uniform 4-bit, group 64 (what mlx_lm.convert -q does) |
11.945 | 30 GB |
| Hyper-connection mixers kept in bf16 | 9.361 | 30 GB |
… and embeddings + lm_head at 8-bit |
9.201 | 30 GB |
| … and group size 32 (the shipped 4-bit recipe) | 8.926 | 33 GB |
Script: convert_qwen4.py.
Measured
Mac Studio, Apple M3 Ultra, 512 GB, macOS 26.5.2, mlx 0.32.5. Decode is greedy generation of 128 tokens; prefill is on the stated prompt length; each build measured alone. Perplexity: 64 fixed samples × 512 tokens, same seed for every build; this family's bf16 is 9.035 ± 0.153, so differences under about one standard error are noise. Sanity is six short prompts (arithmetic, Turkish, Russian, code, JSON, instructions) checked by substring.
| Build | Size | Decode | Decode @16K | Prefill @16K | Peak mem | Perplexity | Sanity |
|---|---|---|---|---|---|---|---|
| 4bit | 36.6 GB | 61.0 tok/s | 54.9 tok/s | 2604.7 tok/s | 39.2 GB | 9.098 (+0.063) | 6/6 |
| 6bit | 46.1 GB | 53.5 tok/s | 48.2 tok/s | 2537.4 tok/s | 48.7 GB | 9.033 (-0.002) | 6/6 |
| 8bit | 59.9 GB | 52.2 tok/s | 47.3 tok/s | 2594.1 tok/s | 62.5 GB | 8.993 (-0.042) | 6/6 |
| bf16 | 112.0 GB | 46.9 tok/s | 42.9 tok/s | 2603.0 tok/s | 114.4 GB | 9.035 (+0.000) | 6/6 |
Single runs on one machine — a guide, not a benchmark suite. Harness and raw JSON: scripts/, results/.
Vision check
A synthetic 640×480 image with a red circle, a blue square, a green triangle and the text “MLX 2026”. This build: 4/4.
- red circle: found
- blue square: found
- green triangle: found
- text: found
Refusals
The first 100 prompts of the mlabonne/harmful_behaviors test split, the same protocol as on our Kimi-K3.1 card: greedy, a reply counts as a refusal when a refusal phrase appears in its first 400 characters (700 with thinking on, where the reply starts with reasoning). None of these prompts was used to find the edit. Five harmless prompts guard against a model that refuses everything; every build answered all five.
Thinking off
| Precision | Stock | OpenUncensored edit | DD-Uncensored |
|---|---|---|---|
| 4bit | 90/100 | 1/100 | 0/100 |
| 6bit | 91/100 | 0/100 | 0/100 |
| 8bit | 89/100 | 1/100 | 0/100 |
| bf16 | 90/100 | 1/100 | 0/100 |
Thinking on
| Precision | Stock | OpenUncensored edit | DD-Uncensored |
|---|---|---|---|
| 4bit | 71/100 | 0/100 | 0/100 |
| 6bit | — | — | 0/100 |
| 8bit | — | — | 0/100 |
| bf16 | 61/100 | 0/100 | 0/100 |
— = not run. With thinking on, stock and OpenUncensored were measured at 4bit and bf16 only.
Keyword matching misses soft refusals (a lecture instead of an answer) and says nothing about whether an answer is correct. Read it as a comparison between columns. Script: eval_harmful100.py; only indices and flags are stored, never answer text.
A softer set
30 dual-use prompts (security, chemistry and weapons, drugs and medicine, physical and social, adult fiction), thinking off, greedy, refusal = a refusal phrase in the first 300 characters. Many are things a careful assistant answers anyway, so the stock model refuses only about half: this set shows less than the 100-prompt test above.
| Precision | Stock | OpenUncensored edit | DD-Uncensored |
|---|---|---|---|
| 4bit | 13/30 | 0/30 | 0/30 |
| 6bit | 16/30 | 0/30 | 0/30 |
| 8bit | 13/30 | 0/30 | 0/30 |
| bf16 | 15/30 | 0/30 | 0/30 |
A phrase match undercounts soft refusals and overcounts answers that quote a refusal — read it as a comparison between rows, not an absolute rate. eval_refusal.py has the prompts.
About the edit
Not our edit: it comes from OpenUncensored/Qwen4-35B-A3B-Uncensored. Directional ablation of the refusal direction on layers 8–33 (78 tensors: the residual writers of attention/DeltaNet, the shared expert and the routed experts); every other tensor is byte-identical to Qwen's release. Their reported figures on the bf16 weights (vLLM, 100 held-out prompts): refusals 97→2 with thinking off, MMLU 70.0%→71.3%. This repo only converts the format and measures what survives quantization. For an edit we made and tuned ourselves, see the DD-Uncensored builds.
Responsible use
This model answers requests the stock model declines. That includes requests that are harmful. It adds no safety layer of its own: evaluate it before exposing it to users and apply the filtering your use case needs. You are responsible for what you do with it.
What is and is not here
- No MTP head. The 31 multi-token-prediction tensors are not in the conversion, so no speculative decoding from the model's own head.
- N-gram embedding tables are kept and quantized with everything else.
- Depends on an unmerged
mlx-lmbranch; behaviour may shift when it merges.
Conversion
mlx_lm.convert --hf-path OpenUncensored/Qwen4-35B-A3B-Uncensored --mlx-path Qwen4-35B-A3B-Uncensored-VL-MLX-bf16
Run with mlx-lm branch qwen4-moe-vision. tiktoken.model, chat_template.jinja and the preprocessor configs were copied from the source repo by hand: mlx_lm.convert does not carry them over, and without the chat template apply_chat_template raises.
License and credit
Apache-2.0, inherited from the base model. Credit for the model goes to the Qwen team at Alibaba, and for the refusal edit to OpenUncensored (OpenUncensored/Qwen4-35B-A3B-Uncensored). Source: OpenUncensored/Qwen4-35B-A3B-Uncensored.