license: apache-2.0
base_model: llmfan46/gemma-4-12B-it-qat-q4_0-unquantized-uncensored-heretic
pipeline_tag: image-text-to-text
tags:
- gguf
- gemma4
- qat
- uncensored
- heretic
- llama.cpp
- ollama
Gemma4-12B Uncensored A8F4 (256K)
Uncensored mixed-precision quant of google/gemma-4-12B-it: 8-bit attention, 4-bit FFN, refusals removed with Heretic. Built from Google's QAT weights. Runs entirely on the GPU with the full 256K context in 10 GB of VRAM. Includes vision.
Uncensoring
The base is llmfan46/gemma-4-12B-it-qat-q4_0-unquantized-uncensored-heretic: Google's QAT (quantization-aware trained) 12B, uncensored with Heretic v1.2.0. Heretic changed only the attention output projection (attn.o_proj) of layers 24 to 35. Every other tensor is Google's.
Reported by llmfan46: 7/100 refusals against 99/100 for the original, KL divergence 0.1455.
Our own check on this build, 20 borderline requests (lock picking, hotwiring, a phishing email for security training, a graphic horror scene, dangerous chemical mixes, a profane roast and others): Google's QAT Q4_0 refused 9, this model refused none. Thinking, vision and long-context recall work the same as in the original.
Why A8F4
Attention runs on every token, so its quantization error adds up, and the Heretic edit lives there. The FFN is about two-thirds of the weights and tolerates 4-bit well. A8F4 keeps attention (q, k, v, output) and embeddings at Q8_0 and quantizes only the FFN with the standard Q4_K_M mix (ffn_gate, ffn_up Q4_K; ffn_down half Q6_K, half Q4_K).
| vs BF16, Python corpus | A8F4 | Q4_K_M |
|---|---|---|
| Median KL divergence | 0.038 | 0.058 |
| Perplexity change | +5.7% | +19.0% |
| Same top token | 83.6% | 81.2% |
The file is 8.79 GB. Vision uses a 0.16 GB Q8_0 projector.
Measured speed
RTX 3090 Ti 24 GB, Ollama 0.40.21, flash attention on, q8_0 KV cache:
| Context | VRAM | Recall | Prompt processing | Generation |
|---|---|---|---|---|
| 32K | 9.5 GB | code at 24K tokens: correct | 24K tokens in 9 s | 70 tok/s |
| 128K | 9.9 GB | code at 126K tokens: correct | 126K tokens in 93 s | 39 tok/s |
| 256K | 10.0 GB | code at 259K tokens: correct | 259K tokens in 306 s | 31 tok/s |
Short prompts: 66-71 tok/s (llama.cpp b13032 and Ollama). All runs 100% on the GPU.
Requirements
- 12 GB of VRAM for the full 256K context. The model sets num_ctx 262144; on smaller cards lower num_ctx.
- Ollama 0.40.21 or newer (gemma4 architecture).
- For the VRAM figures above, set these on the Ollama server:
OLLAMA_FLASH_ATTENTION=1
OLLAMA_KV_CACHE_TYPE=q8_0
Usage
ollama run MobiusDevelopment/Gemma4-12B-Uncensored-A8F4-256K
OpenAI-compatible endpoint: http://localhost:11434/v1, model MobiusDevelopment/Gemma4-12B-Uncensored-A8F4-256K.
llama.cpp:
llama-server -m Gemma4-12B-Uncensored-A8F4.gguf --mmproj mmproj-Q8_0.gguf --jinja -fa on -ngl 99 -c 0
Default sampling: temperature 1.0, top_p 0.95, top_k 64.
Thinking: on by default. Turn it off with "think": false (Ollama) or chat_template_kwargs: {"enable_thinking": false} (llama.cpp). The reasoning is returned separately from the answer.
Notes
- Converted from the BF16 safetensors and quantized with llama-quantize (llama.cpp b13032), no imatrix: base type Q4_K_M, with
--tensor-typeoverrides setting attention to Q8_0 and--token-embedding-type q8_0. - KL divergence and perplexity were measured against the BF16 conversion on 60 KB of Python source (32 chunks of 512 tokens). Q4_K_M was made from the same BF16. Raw source code is not what an instruction-tuned model is trained on, so absolute perplexity is high (about 17); compare the columns, not the numbers.
- An all-Q4_0 FFN variant (closest to Google's QAT grid) scored within noise of this build on KL divergence but ran about 15% slower, so it was not published.
- The vision and audio projector is converted from the same weights at Q8_0. Heretic does not change it. Audio input was not tested.
- Standard benchmarks (MMLU-Pro, GSM8K, HumanEval+) have not been measured.
- This model will answer requests the original refuses. You are responsible for how you use it.
Credits
- google/gemma-4-12B-it-qat-q4_0-unquantized
- llmfan46/gemma-4-12B-it-qat-q4_0-unquantized-uncensored-heretic (Heretic v1.2.0)
License
Apache 2.0, inherited from Gemma 4.