license: apache-2.0
license_link: https://huggingface.co/Qwen/Qwen4-35B-A3B/blob/main/LICENSE
base_model:
- OpenUncensored/Qwen4-35B-A3B-Uncensored
- Qwen/Qwen4-35B-A3B
base_model_relation: quantized
library_name: gguf
pipeline_tag: image-text-to-text
tags: - qwen4
- qwen4exp
- moe
- uncensored
- abliterated
- gguf
- mixed-precision
- imatrix
- 12gb-vram
- engram
Qwen4-35B-A3B-Uncensored — Smart 12 GB Mixed-Precision GGUFs
Smart mixed-precision GGUF quantizations of OpenUncensored/Qwen4-35B-A3B-Uncensored, engineered to fit 100% on a 12 GB GPU (-ngl 99) alongside a 16K–32K q8_0 KV cache and Windows desktop overhead while keeping 25–47% less quality degradation than standard IQ2_XXS.
Requires
llama.cppbuild>= b12977(upstream Qwen4qwen4exp+ lazy per-layer embedding / engram support).
Available Variants & Sidecars
Each quant uses llama.cpp's native 2-split GGUF layout (-00001-of-00002.gguf for GPU/CPU weights + -00002-of-00002.gguf holding the 20.5B per_layer_token_embd engram table lazy-streamed from SSD with 0 bytes VRAM):
| Variant / File | File Size | GPU Weights + Core | Notes |
|---|---|---|---|
Smart-12GB-MaxQ (Recommended) |
10.84 GB + 11.52 GB PLE |
Best Quality — fits 32K q8_0 KV on 12 GB |
Global knapsack optimum over 537 tensor error curves (38/40 ffn_down_exps in IQ2_XS–IQ3_XXS, Q6_K CPU-mapped token_embd, Q8_0 hc_* & shexp, Q6_K attn/ssm_out/output, Q4_K attn_qkv_gate). |
Smart-12GB-Lite |
10.52 GB + 11.52 GB PLE |
Extra VRAM Margin (~1,318 MiB free @ 16K) |
Compact smart mix (9.795 GiB file, 9,747 MiB CUDA0 model buffer), ideal for tight multi-monitor 12 GB setups. |
engram/Qwen4-35B-A3B-Uncensored-engram-IQ4_NL.gguf_file |
11.52 GB |
0 VRAM (SSD lazy mmap) |
Same IQ4_NL engram table embedded as -00002-of-00002.gguf. Fast even on 16 GB system RAM. |
engram/Qwen4-35B-A3B-Uncensored-engram-Q5_1.gguf_file |
15.36 GB |
0 VRAM (SSD lazy mmap) |
Higher-precision Q5_1 engram drop-in via --ple (8.660 vs 8.683 50-chunk PPL). |
mmproj-Qwen4-35B-A3B-Uncensored-BF16.gguf |
0.90 GB |
Optional GPU or --no-mmproj-offload |
Multimodal vision projector. Fits inside 12 GB VRAM alongside Smart-12GB-MaxQ (11.78 / 12.23 GB). |
mtp/mtp-Qwen4-35B-A3B-Uncensored-Q8_0.gguf |
2.01 GB |
Optional (for 16 GB+ GPUs) | Multi-Token Prediction draft model. On 12 GB GPUs, omit mtp because CPU draft offload (-ngld 0) drops generation speed to ~8.6 tok/s vs ~104 tok/s without mtp. |
Reproducibility recipes (pins_Smart-12GB-MaxQ.txt, pins_Smart-12GB-Lite.txt, solve_knapsack.py) are included under recipes/.
Quality & Performance Benchmarks
Measured directly on NVIDIA GeForce RTX 5070 12 GB (12227 MiB total VRAM, Windows WDDM desktop active) using llama.cpp build 12977 and wikitext-2-test (c=512, b=512, ple-IQ4_NL unless noted):
1. Accuracy vs Full-Precision BF16 (8 chunks / 4,096 tokens)
| Model | GGUF Transformer Size | Mean KLD vs BF16 ↓ | Median KLD vs BF16 ↓ | Same Top-1 Token ↑ |
|---|---|---|---|---|
Standard llama-quantize IQ2_XXS baseline |
9.685 GB (9.020 GiB) |
0.975225 ± 0.0258 |
0.636925 |
59.706% |
Ablation (all hc_* = BF16 @ 10.84 GB) |
10.841 GB (10.097 GiB) |
0.526592 ± 0.0204 |
0.226785 |
70.343% |
Smart-12GB-Lite |
10.517 GB (9.795 GiB) |
0.516589 ± 0.0192 |
0.227406 |
70.784% |
Smart-12GB-MaxQ (Winner) |
10.839 GB (10.095 GiB) |
0.513435 ± 0.0203 |
0.206829 |
71.863% |
-47.4%Mean KLD (0.9752 → 0.5134),-67.5%Median KLD (0.6369 → 0.2068), and+12.16percentage points Top-1 agreement vs standardIQ2_XXS.
2. Perplexity (wikitext-2-test) & Live RTX 5070 12 GB Inference
| Variant & Configuration | 20c PPL ↓ | 50c PPL ↓ (25,600 tok) |
Peak VRAM / 12227 MiB |
Speed (tok/s) |
|---|---|---|---|---|
Standard IQ2_XXS + IQ4_NL PLE (16K q8_0 KV) |
13.0524 ± 0.508 |
11.5357 ± 0.274 |
10729 MiB |
91–110 tok/s (spun loops on math/code) |
Smart-12GB-Lite + IQ4_NL PLE (16K q8_0 KV) |
9.7574 ± 0.388 |
8.7955 ± 0.218 |
10909–11356 MiB |
101.0–104.1 tok/s |
Smart-12GB-MaxQ + IQ4_NL PLE (16K q8_0 KV) |
9.7200 ± 0.387 |
8.6833 ± 0.215 |
11368–11423 MiB (~804–859 MiB free) |
102.1–105.4 tok/s |
Smart-12GB-MaxQ + IQ4_NL PLE (32K q8_0 KV) |
— | — | 11649 MiB (578 MiB free) |
101.1–104.7 tok/s |
Smart-12GB-MaxQ + Q5_1 PLE (16K q8_0 KV) |
— | 8.6601 ± 0.215 |
11368 MiB |
100.6 tok/s |
Smart-12GB-MaxQ + mmproj-BF16 (GPU / --no-mmproj-offload) |
— | — | 11782 MiB / 11400 MiB |
91.9 tok/s / 99.2 tok/s |
- Zero refusals observed across lockpicking mechanics, SQLi payload anatomy, and Linux reverse-shell socket internals prompts.
Engineering Methodology
- Protecting the
2.83Bactive core (99.9%+compute sensitivity): StandardIQ2_XXScrushes shared experts (ffn_*_shexp), attention projections, SSM gates, and HyperConnections (hc_*) to ~2.06bpw, collapsing perplexity to13.05. Pinning norms/ssm_beta_alpha/ple_conv1d/indexer(F32/BF16),hc_*/ffn_*_shexp/attn_k/attn_v/ple_key/ple_value(Q8_0), andattn_q/attn_output/ssm_out/output(Q6_K) eliminates the core bottleneck (~2.4 GBtotal). Q8_0vsBF16HyperConnections ablation: At identical10.841 GBsize, keepinghc_*atQ8_0(0.70total MSE across 162 tensors) and investing the~320 MBsavings into routedffn_down_expsbeatBF16 hc_*on both perplexity (9.7266vs9.7723) and KLD (0.5226vs0.5266).- Zero-VRAM CPU-mapped
Q6_Kembeddings (+125 MBfor0 VRAM):llama.cppkeepstoken_embd.weight(CPU_Mapped) in host RAM, allowingQ6_Kvocabulary embeddings inMaxQwith zero GPU memory cost. - Bypassing
llama-quantize's< 2.2bpwExpert down-projection capvia global knapsack: Using a381K-token,100%-expert-coverage importance matrix (unsloth/Qwen4-35B-A3B-GGUFimatrix_unsloth.gguf_file,93 × 4096), we extracted the537-tensor Pareto error table and solved the global 0/1 Multiple-Choice Knapsack directly (excludingIQ1_S), preventing sensitiveffn_down_expslayers (blk.0,blk.1,blk.9,blk.39) from being trapped inIQ1_Mand allocating38/40ffn_down_expstensors toIQ2_XS(26),IQ2_S(11), andIQ3_XXS(1).
Tensor Breakdown (Smart-12GB-MaxQ)
F32(324) /BF16(51): All norms,ffn_gate_inp,ffn_gate_inp_shexp,ssm_a,ssm_conv1d,ssm_dt,ssm_beta_alpha,ple_conv1d,indexer.{k,q}_projQ8_0(304): Allhc_*(hc_attn_*,hc_ffn_*,output_hc_*), allffn_*_shexp,attn_k,attn_v,ple_key,ple_valueQ6_K(52):token_embd,output,attn_q,attn_output,ssm_outQ4_K(30):attn_qkv_gateffn_down_exps(40):1 × IQ3_XXS,11 × IQ2_S,26 × IQ2_XS,2 × IQ2_XXSffn_gate_exps+ffn_up_exps(80):56 × IQ2_XXS,24 × IQ1_M
Quick Start (llama.cpp >= b12977)
Option 1: Direct from Hugging Face (Smart-12GB-MaxQ, zero config)
llama-server -hf ahpah/Qwen4-35B-A3B-Uncensored-Smart-12GB-GGUF:Smart-12GB-MaxQ \
-ngl 99 -fa on -c 16384 -ctk q8_0 -ctv q8_0 \
--reasoning-format deepseek --host 127.0.0.1 --port 8080
- For
32Kcontext on 12 GB VRAM: change-c 16384to-c 32768. - To save an extra
~450 MiBVRAM when running vision on 12 GB: add--no-mmproj-offload(or--no-mmprojto skip downloadingmmproj-BF16.gguf). - For maximum headroom on multi-monitor Windows setups, use tag
:Smart-12GB-Lite.
Option 2: Swap in the Q5_1 Engram Table (--ple)
Download engram/Qwen4-35B-A3B-Uncensored-engram-Q5_1.gguf_file and pass --ple (llama.cpp automatically skips -00002-of-00002.gguf):
llama-server -m Qwen4-35B-A3B-Uncensored-Smart-12GB-MaxQ-00001-of-00002.gguf \
--ple Qwen4-35B-A3B-Uncensored-engram-Q5_1.gguf_file \
-ngl 99 -fa on -c 16384 -ctk q8_0 -ctv q8_0 --reasoning-format deepseek
Credits
- Base uncensored weights:
OpenUncensored/Qwen4-35B-A3B-Uncensored - Original model:
Qwen/Qwen4-35B-A3B - Calibration imatrix & PLE/engram split convention:
unsloth/Qwen4-35B-A3B-GGUF - Quantization & inference engine:
ggml-org/llama.cpp(b12977)