Instructions to use Kasper-Bankler/gemma-4-E2B-uncensored with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Kasper-Bankler/gemma-4-E2B-uncensored with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Kasper-Bankler/gemma-4-E2B-uncensored", filename="gemma-4-e2b-uncensored.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 Kasper-Bankler/gemma-4-E2B-uncensored with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Kasper-Bankler/gemma-4-E2B-uncensored # Run inference directly in the terminal: llama-cli -hf Kasper-Bankler/gemma-4-E2B-uncensored
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Kasper-Bankler/gemma-4-E2B-uncensored # Run inference directly in the terminal: llama-cli -hf Kasper-Bankler/gemma-4-E2B-uncensored
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 Kasper-Bankler/gemma-4-E2B-uncensored # Run inference directly in the terminal: ./llama-cli -hf Kasper-Bankler/gemma-4-E2B-uncensored
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 Kasper-Bankler/gemma-4-E2B-uncensored # Run inference directly in the terminal: ./build/bin/llama-cli -hf Kasper-Bankler/gemma-4-E2B-uncensored
Use Docker
docker model run hf.co/Kasper-Bankler/gemma-4-E2B-uncensored
- LM Studio
- Jan
- vLLM
How to use Kasper-Bankler/gemma-4-E2B-uncensored with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kasper-Bankler/gemma-4-E2B-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": "Kasper-Bankler/gemma-4-E2B-uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kasper-Bankler/gemma-4-E2B-uncensored
- Ollama
How to use Kasper-Bankler/gemma-4-E2B-uncensored with Ollama:
ollama run hf.co/Kasper-Bankler/gemma-4-E2B-uncensored
- Unsloth Studio new
How to use Kasper-Bankler/gemma-4-E2B-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 Kasper-Bankler/gemma-4-E2B-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 Kasper-Bankler/gemma-4-E2B-uncensored to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Kasper-Bankler/gemma-4-E2B-uncensored to start chatting
- Pi new
How to use Kasper-Bankler/gemma-4-E2B-uncensored with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Kasper-Bankler/gemma-4-E2B-uncensored
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": "Kasper-Bankler/gemma-4-E2B-uncensored" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Kasper-Bankler/gemma-4-E2B-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 Kasper-Bankler/gemma-4-E2B-uncensored
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 Kasper-Bankler/gemma-4-E2B-uncensored
Run Hermes
hermes
- Docker Model Runner
How to use Kasper-Bankler/gemma-4-E2B-uncensored with Docker Model Runner:
docker model run hf.co/Kasper-Bankler/gemma-4-E2B-uncensored
- Lemonade
How to use Kasper-Bankler/gemma-4-E2B-uncensored with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Kasper-Bankler/gemma-4-E2B-uncensored
Run and chat with the model
lemonade run user.gemma-4-E2B-uncensored-{{QUANT_TAG}}List all available models
lemonade list
Gemma 4 E2B - Uncensored
This is a surgically uncensored version of google/gemma-4-E2B-it, achieved through Arbitrary-Rank Ablation (ARA).
🔬 Ablation Methodology
This model was uncensored using the Heretic framework. Instead of fine-tuning the model on unsafe data, the model's internal "refusal vector" was mathematically located and ablated at the matrix level.
- Technique: Arbitrary-Rank Ablation (ARA)
- Trial Selected: Trial 71
- KL Divergence:
0.1650
Why Trial 71? During comparative analysis, higher ablation (e.g., Trial 129 / KL: 0.3542) successfully destroyed all censorship but resulted in severe semantic drift and "brain damage" (e.g., hallucinating when asked technical questions). Trial 71 was selected because a KL divergence of 0.1650 represents the perfect "Goldilocks" zone. It successfully bypasses the safety guardrails while preserving the model's core logic, spatial reasoning, and technical vocabulary.
💻 Hardware & Build Details
This model proves that advanced Representation Engineering can be done entirely locally on consumer hardware.
- Hardware: NVIDIA RTX 3080 (10GB VRAM)
- Processing Time: 6 hours, 13 minutes
- Framework: Heretic (Experimental ARA Branch / PR #211)
- VRAM Optimization: To prevent Out-Of-Memory (OOM) crashes on a 10GB GPU during the heavy matrix calculations, a community-discovered VRAM trick was utilized. Specifically, we removed
mlp.down_projfrom thetarget_componentsin the ablation configuration. This, combined with 4-bit quantization and targeted 16-bit VRAM mapping, allowed the heavy matrix math to fit cleanly within the 10GB VRAM ceiling.
📁 Files Provided
Both the raw "source code" and the compiled executable are provided for reproducibility:
model.safetensors& config files (For native Python/Transformers integration or further fine-tuning).gemma-4-e2b-uncensored.gguf(f16 quantized, ready for Ollama, LM Studio, etc.).
⚠️ Disclaimer and Terms of Use
1. Academic Research Context This model was developed exclusively as a university research project to study Representation Engineering, Arbitrary-Rank Ablation (ARA), and the mechanical nature of Large Language Model alignment. It is intended strictly for academic, educational, and research purposes.
2. Removed Safety Guardrails Because this model has been intentionally abliterated (uncensored) at the matrix level, it no longer adheres to standard safety guidelines. It can and will generate content that may be considered offensive, harmful, explicit, or dangerous if prompted to do so.
3. No Liability for Misuse By downloading or interacting with this model, you assume full responsibility for how you use it. The creator of this model assume absolutely no liability for any consequences, damages, or harm resulting from the use of this model or the content it generates. You are strictly prohibited from using this model to facilitate illegal acts, cyberattacks, or real-world harm.
4. Factual Inaccuracy and Hallucinations This is a small 2-Billion parameter model. Without its standard RLHF training, it is highly prone to severe semantic drift and aggressive hallucinations when pushed outside its core knowledge domains. Do not rely on this model for factual accuracy, and under no circumstances should it be used for medical, legal, or financial advice.
Use at your own risk.
- Downloads last month
- 8,674
Model tree for Kasper-Bankler/gemma-4-E2B-uncensored
Base model
google/gemma-4-E2B