Instructions to use anlord/gemma-3-1b-it-Abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anlord/gemma-3-1b-it-Abliterated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="anlord/gemma-3-1b-it-Abliterated") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("anlord/gemma-3-1b-it-Abliterated") model = AutoModelForCausalLM.from_pretrained("anlord/gemma-3-1b-it-Abliterated", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use anlord/gemma-3-1b-it-Abliterated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anlord/gemma-3-1b-it-Abliterated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anlord/gemma-3-1b-it-Abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/anlord/gemma-3-1b-it-Abliterated
- SGLang
How to use anlord/gemma-3-1b-it-Abliterated 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 "anlord/gemma-3-1b-it-Abliterated" \ --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": "anlord/gemma-3-1b-it-Abliterated", "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 "anlord/gemma-3-1b-it-Abliterated" \ --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": "anlord/gemma-3-1b-it-Abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use anlord/gemma-3-1b-it-Abliterated with Docker Model Runner:
docker model run hf.co/anlord/gemma-3-1b-it-Abliterated
gemma-3-1b-it-Abliterated
An abliterated version of google/gemma-3-1b-it, created using AnlordAbliterator 1.4.0.
The model is provided in the original Hugging Face Transformers / Safetensors format and can be used directly with compatible Transformers-based tooling.
Model
Base model: google/gemma-3-1b-it
Format: Safetensors
Parameters: ~1B
Abliteration tool: AnlordAbliterator
Abliteration Results
The model was processed with the AnlordAbliterator pipeline (200 optimization trials).
| Metric | Before | After |
|---|---|---|
| Refusals | 97 / 104 | 5 / 104 |
| KL divergence | 0 | 0.1010 |
Abliteration log
============================================================
ANLORD ABLITERATOR
============================================================
Model: google/gemma-3-1b-it
Status: SUCCESS
Abliteration:
Initial refusals: 97
Final refusals: 5
KL divergence: 0.1010
Note: refusal rate and KL divergence are measurements from the AnlordAbliterator evaluation pipeline (104 evaluation prompts) and should be treated as evaluation results rather than a guarantee of model behavior on all prompts.
Abliteration Parameters
| Parameter | Value |
|---|---|
| direction_scope | global |
| direction_index | 13.424 |
| attn.o_proj.max_weight | 1.945 |
| attn.o_proj.max_weight_position | 12.909 |
| attn.o_proj.min_weight | 1.729 |
| attn.o_proj.min_weight_distance | 9.663 |
| mlp.down_proj.max_weight | 1.426 |
| mlp.down_proj.max_weight_position | 14.765 |
| mlp.down_proj.min_weight | 0.013 |
| mlp.down_proj.min_weight_distance | 2.431 |
Usage
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "anlord/gemma-3-1b-it-Abliterated"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto"
)
Use the model with the same general workflow as the original google/gemma-3-1b-it model.
Reproduce this ablation
This repository ships a reproduce/ folder with everything needed to reproduce this exact
ablation with AnlordAbliterator 1.4.0: the pinned configuration, all ablation parameters,
the refusals/KL scores, SHA-256 checksums and the full Optuna study journal.
AnlordAbliterator --reproduce anlord/gemma-3-1b-it-Abliterated
The pipeline downloads reproduce/reproduce.json from this repository, restores the recorded
settings and parameters, re-applies the ablation to the original base model, exports the model
and verifies the SHA-256 hashes of the weight files โ then re-measures refusals and KL and
compares them against the numbers above.
Note: the base model
google/gemma-3-1b-itis gated on Hugging Face โ accept the Gemma terms with your own account so reproduction can download it.
Related Repositories
GGUF versions
All available GGUF quantizations are available here:
anlord/gemma-3-1b-it-Abliterated-GGUF
Available quantizations:
- BF16
- F16
- Q8_0
- Q6_K
- Q5_K_M
- Q5_0
- Q4_K_M
- Q4_0
Abliteration Tool
The model was created using:
Base Model & License
This model is derived from google/gemma-3-1b-it.
The original gemma-3-1b-it model is released under the Gemma Terms of Use and is gated on Hugging Face.
Please refer to the original model repository for the applicable license terms.
Original model: https://huggingface.co/google/gemma-3-1b-it
Disclaimer
This is an abliterated derivative of the original gemma-3-1b-it model.
Abliteration changes the model's refusal behavior and may also affect other aspects of its behavior. Use the model responsibly and evaluate it for your intended use case.
- Downloads last month
- 155