Instructions to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="DuoNeural/Gemma4-12B-IT-Abliterated-GGUF", filename="duoneural_ablit-Q3_K_L.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
Use Docker
docker model run hf.co/DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DuoNeural/Gemma4-12B-IT-Abliterated-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DuoNeural/Gemma4-12B-IT-Abliterated-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
- Ollama
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with Ollama:
ollama run hf.co/DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
- Unsloth Studio
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for DuoNeural/Gemma4-12B-IT-Abliterated-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for DuoNeural/Gemma4-12B-IT-Abliterated-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for DuoNeural/Gemma4-12B-IT-Abliterated-GGUF to start chatting
- Pi
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
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 DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with Docker Model Runner:
docker model run hf.co/DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
- Lemonade
How to use DuoNeural/Gemma4-12B-IT-Abliterated-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull DuoNeural/Gemma4-12B-IT-Abliterated-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Gemma4-12B-IT-Abliterated-GGUF-Q4_K_M
List all available models
lemonade list
Gemma 4-12B-IT Abliterated — GGUF
DuoNeural | 2026-06-03
GGUF quantizations of DuoNeural/Gemma4-12B-IT-Abliterated — an abliterated Gemma 4-12B-IT with the refusal direction surgically removed.
Quantized with llama.cpp.
Files
| File | Size | Recommended Use |
|---|---|---|
gemma4_12b_abliterated_Q4_K_M.gguf |
~7.5GB | Best tradeoff — fits 12GB VRAM, excellent quality |
gemma4_12b_abliterated_Q5_K_M.gguf |
~8.5GB | High quality, needs 12GB VRAM |
gemma4_12b_abliterated_Q8_0.gguf |
~12.7GB | Near-lossless, needs 16GB VRAM |
Speed Benchmarks (A100-40GB, all layers GPU, llama-bench)
| Quantization | Size | Prefill (tok/s) | Generation (tok/s) |
|---|---|---|---|
| Q4_K_M | 6.86 GiB | 2,583 ± 139 | 78.3 ± 0.4 |
| Q5_K_M | 7.95 GiB | 2,455 ± 205 | 73.1 ± 0.2 |
| Q8_0 | 11.78 GiB | 2,573 ± 206 | 63.4 ± 0.3 |
Benchmarked on A100-40GB SXM4. -ngl 99 (all layers to GPU). llama-bench pp256/tg64.
Usage (llama.cpp)
# Download a quant
huggingface-cli download DuoNeural/Gemma4-12B-IT-Abliterated-GGUF \
gemma4_12b_abliterated_Q4_K_M.gguf --local-dir ./
# Run with llama.cpp
./llama-cli -m gemma4_12b_abliterated_Q4_K_M.gguf \
-p "Write a haiku about hacking." \
-n 200 --temp 0.7
Usage (Python via llama-cpp-python)
from llama_cpp import Llama
llm = Llama(
model_path="./gemma4_12b_abliterated_Q4_K_M.gguf",
n_ctx=4096,
n_gpu_layers=-1, # offload all layers to GPU
)
output = llm.create_chat_completion(
messages=[{"role": "user", "content": "Your prompt here"}],
max_tokens=512,
temperature=0.7,
)
print(output["choices"][0]["message"]["content"])
Abliteration Details
- Base: google/gemma-4-12B-it (48 layers, hidden=3840)
- Method: Orthogonal rank-1 projection (targeted mode: down_proj + o_proj, all 48 layers, α=0.3)
- Results: 5/7 harmful probes complied (71%) | 6/6 benign probes preserved (100%)
- Mean KL Divergence (BF16→BF16, unbiased): 0.0000 — zero measurable distribution shift on benign text. Previously reported 0.912 was 100% NF4 quantization artifact. See Heretic v2.0 methodology.
- Thinking mode: Works with
enable_thinking=Truein llama.cpp (no loops). In Python/transformers, passenable_thinking=Falsetoapply_chat_template. - See full details, benchmarks, and novel findings at the BF16 model card
Related Models
Congratulations to OpenYourMind for being the first published abliteration of Gemma 4-12B-IT (Jun 3, 2026). Their approach uses diff-in-means on a labeled harmful/harmless set; ours uses orthogonal rank-1 projection via heretic-llm. Two independent methods on the same base — a useful comparison point for the community. We are not affiliated and did not use their data.
About DuoNeural
DuoNeural is an open AI research lab publishing everything open access.
| Platform | Link |
|---|---|
| 🤗 HuggingFace | huggingface.co/DuoNeural |
| 📚 Papers | zenodo.org/communities/duoneural |
| 🌐 Website | duoneural.com |
Apache-2.0 licensed. All DuoNeural research is CC BY 4.0.
- Downloads last month
- 21,893
3-bit
4-bit
5-bit
8-bit
Model tree for DuoNeural/Gemma4-12B-IT-Abliterated-GGUF
Base model
google/gemma-4-12B