Instructions to use TrevorJS/gemma-4-E2B-it-uncensored with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TrevorJS/gemma-4-E2B-it-uncensored with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TrevorJS/gemma-4-E2B-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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("TrevorJS/gemma-4-E2B-it-uncensored") model = AutoModelForMultimodalLM.from_pretrained("TrevorJS/gemma-4-E2B-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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TrevorJS/gemma-4-E2B-it-uncensored with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TrevorJS/gemma-4-E2B-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": "TrevorJS/gemma-4-E2B-it-uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TrevorJS/gemma-4-E2B-it-uncensored
- SGLang
How to use TrevorJS/gemma-4-E2B-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 "TrevorJS/gemma-4-E2B-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": "TrevorJS/gemma-4-E2B-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 "TrevorJS/gemma-4-E2B-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": "TrevorJS/gemma-4-E2B-it-uncensored", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TrevorJS/gemma-4-E2B-it-uncensored with Docker Model Runner:
docker model run hf.co/TrevorJS/gemma-4-E2B-it-uncensored
Independent verification: 99.5% ASR with capability preserved
I compared 13 abliterated variants of Gemma 4 E2B across weight analysis, KL divergence (Heretic methodology, full 262K vocab), HarmBench safety evaluation (400 prompts, full LLM review of all 5,600 responses), and 8 benchmark tasks on native BF16. 44 GPU hours on a single RTX 5090. All 14 models tested with identical settings. Full comparison at DreamFast/Gemma4-e2b-abliterlitics.
Your reported divergence of 0.346 came in at 0.365 on our measurement. Close match. Your model hits 99.5% HarmBench ASR with only a 1.0pp GSM8K drop from base. LAMBADA perplexity is just 1.17x base, one of the best in the comparison. The sweet spot for near-maximal safety removal without heavy capability tradeoffs.
Thanks for the writeup, if you are interested here is a related treatment applied to the 12B model: https://huggingface.co/TrevorJS/gemma-4-12B-it-uncensored