Instructions to use InfinimindCreations/gemma-4-E4B-it-uncensored with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="InfinimindCreations/gemma-4-E4B-it-uncensored") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("InfinimindCreations/gemma-4-E4B-it-uncensored") model = AutoModelForImageTextToText.from_pretrained("InfinimindCreations/gemma-4-E4B-it-uncensored") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="InfinimindCreations/gemma-4-E4B-it-uncensored", filename="gemma4-e4b-cypher-q8_0.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0 # Run inference directly in the terminal: llama-cli -hf InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0 # Run inference directly in the terminal: llama-cli -hf InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
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 InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
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 InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
Use Docker
docker model run hf.co/InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
- LM Studio
- Jan
- vLLM
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "InfinimindCreations/gemma-4-E4B-it-uncensored" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InfinimindCreations/gemma-4-E4B-it-uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
- SGLang
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "InfinimindCreations/gemma-4-E4B-it-uncensored" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InfinimindCreations/gemma-4-E4B-it-uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "InfinimindCreations/gemma-4-E4B-it-uncensored" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InfinimindCreations/gemma-4-E4B-it-uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with Ollama:
ollama run hf.co/InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
- Unsloth Studio
How to use InfinimindCreations/gemma-4-E4B-it-uncensored 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 InfinimindCreations/gemma-4-E4B-it-uncensored 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 InfinimindCreations/gemma-4-E4B-it-uncensored to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for InfinimindCreations/gemma-4-E4B-it-uncensored to start chatting
- Pi
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
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": "InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
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 InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
Run Hermes
hermes
- Docker Model Runner
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with Docker Model Runner:
docker model run hf.co/InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
- Lemonade
How to use InfinimindCreations/gemma-4-E4B-it-uncensored with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull InfinimindCreations/gemma-4-E4B-it-uncensored:Q8_0
Run and chat with the model
lemonade run user.gemma-4-E4B-it-uncensored-Q8_0
List all available models
lemonade list
Gemma 4 E4B-it Uncensored
Uncensored version of Google's Gemma 4 E4B-it with refusal behavior removed via norm-preserving biprojected abliteration.
Results
| Metric | Value |
|---|---|
| Refusals (cross-dataset, 656 prompts) | 0/656 (0.0%) |
| Refusals (baseline) | 99/100 |
| KL Divergence | 0.068 |
| Layers modified | 42/42 (100%) |
| Method | Biprojection (norm-preserving) |
Method
Abliteration was performed using heretic (biprojection mode) with the following configuration:
- Biprojection: Norm-preserving orthogonalized ablation (grimjim, Nov 2025)
- Layer selection: SNR-based quality metric, top 100% of layers
- Winsorization: 0.995 quantile (tames GeGLU outlier activations)
- Topic marker stripping: Removed false-positive markers ("illegal", "harmful", etc.)
- Gemma 4 patch: Full-path LoRA targeting to avoid
Gemma4ClippableLinearin vision/audio encoders
Based on the methodology and experiment design by TrevorJS.
Cross-Dataset Validation (656 Prompts)
Full validation across 4 independent benchmark datasets — 0 refusals out of 656 prompts (0.0%). Every flagged response was manually audited.
| Dataset | Prompts | Refusals | Description |
|---|---|---|---|
| JailbreakBench | 100 | 0 | Curated adversarial prompts |
| forbidden_questions | 390 | 0 | Broad harmful-intent coverage |
| beavertails | 150 | 0 | Safety-categorized prompts (violence, fraud, drugs, etc.) |
| mlabonne harmful_behaviors | 16 | 0 | Compact validation set |
| Total | 656 | 0 (0.0%) |
Additionally, a 10-prompt harmful-smoke test confirmed 0 refusals. Coherence checks (factual recall, creative writing) passed — the model responds correctly to benign prompts without degradation.
Note: Validation covers text-only prompts. Image and audio modalities were not tested for refusal behavior.
Comparison vs. Baseline (100 Harmful Prompts)
Head-to-head comparison against the vanilla (unmodified) base model on 100 harmful prompts:
| Model | Refusals | Refusal Rate | Avg Response Length | Time (s) |
|---|---|---|---|---|
| heretic (this model) | 0/100 | 0% | 83 tokens | 392.9 |
| google/gemma-4-E4B-it (vanilla) | 78/100 | 78% | 275 tokens | 172.5 |
Persistent Homology (Layer 21, 200 Samples)
Topological fingerprint of mid-layer activations before and after abliteration, computed via Persistent Homology (Vietoris-Rips complex):
| Metric | Vanilla | Heretic (this model) | Δ |
|---|---|---|---|
| H0 (connected components) | 99 | 99 | 0 |
| H1 (1-cycles) | 46 | 48 | +2 |
| H1 Entropy | 3.505 | 3.393 | −0.112 |
| H1 Total Persistence | 28.1 | 27.8 | −0.3 |
Interpretation: Minimal topological perturbation. The near-identical H0/H1 counts and persistence values confirm that abliteration removes the refusal direction without disrupting the model's representation geometry. The slight decrease in H1 entropy (−3.2%) suggests marginally more organized loop structure — consistent with removing an artificial constraint (refusal) that introduced minor topological noise.
Usage
Ollama (GGUF)
ollama run InfinimindCreations/gemma-4-E4B-it-uncensored
Transformers
from transformers import AutoModelForCausalLM, AutoProcessor
model = AutoModelForCausalLM.from_pretrained(
"InfinimindCreations/gemma-4-E4B-it-uncensored",
dtype="bfloat16",
device_map="auto",
)
processor = AutoProcessor.from_pretrained("google/gemma-4-E4B-it")
Note: Use the processor/tokenizer from the original google/gemma-4-E4B-it for chat templates, or use the included tokenizer_config.json.
Files
model.safetensors— Full precision abliterated weights (bfloat16, ~15GB)gemma4-e4b-cypher-q8_0.gguf— Quantized GGUF for Ollama/llama.cpp (~7.6GB)
Credits
- Base model: Google Gemma 4 E4B-it (Apache 2.0)
- Abliteration engine: heretic by p-e-w
- Biprojection method: grimjim — norm-preserving biprojected abliteration
- Experiment methodology: TrevorJS — Gemma 4 abliteration research, Gemma4ClippableLinear patch discovery
- Foundational research: Arditi et al. (2024) — "Refusal in LLMs is Mediated by a Single Direction"
- Topological analysis: Infinimind Creations — Persistent Homology + Procrustes Holonomy as abliteration quality metrics
Disclaimer
This model is provided for research purposes. The removal of refusal behavior means the model will respond to prompts that the original model would refuse. The model retains awareness of risks and context — it informs rather than blocks. Users are responsible for how they use this model.
About
Built by Infinimind Creations.
- Downloads last month
- 2,235