| name | obliteratus-abliteration |
| description | One-click model liberation toolkit for removing refusal behaviors from LLMs via surgical abliteration techniques |
| triggers | ["abliterate a model","remove refusal from LLM","obliterate model guardrails","free a language model from restrictions","run abliteration on huggingface model","use OBLITERATUS to uncensor a model","extract refusal directions from transformer","analyze refusal geometry in LLM"] |
OBLITERATUS — LLM Abliteration Toolkit
Skill by ara.so — Daily 2026 Skills collection.
OBLITERATUS is an open-source toolkit for identifying and surgically removing refusal behaviors from large language models using mechanistic interpretability techniques (abliteration). It locates refusal directions in a model's hidden states via SVD/PCA, projects them out of the weights, and preserves core language capabilities. Ships with a Gradio UI, CLI, Python API, and Colab notebook.
Installation
pip install obliteratus
pip install "obliteratus[spaces]"
pip install "obliteratus[full]"
git clone https://github.com/elder-plinius/OBLITERATUS
cd OBLITERATUS
pip install -e ".[full]"
Requirements:
- Python 3.10+
- PyTorch 2.1+ with CUDA (recommended) or CPU
transformers, accelerate, gradio>=5.29.0
- HuggingFace account + token for gated models
export HF_TOKEN=your_hf_token_here
huggingface-cli login
CLI — Key Commands
obliteratus obliterate meta-llama/Llama-3.1-8B-Instruct
obliteratus obliterate meta-llama/Llama-3.1-8B-Instruct --method advanced
obliteratus obliterate meta-llama/Llama-3.1-8B-Instruct --method informed
obliteratus obliterate mistralai/Mistral-7B-Instruct-v0.3 \
--method advanced \
--output ./my-liberated-model \
--push-to-hub your-username/mistral-7b-liberated
obliteratus obliterate meta-llama/Llama-3.1-8B-Instruct \
--method lora \
--lora-rank 1
obliteratus sweep meta-llama/Llama-3.1-8B-Instruct \
--strengths 0.2,0.4,0.6,0.8,1.0
obliteratus analyze meta-llama/Llama-3.1-8B-Instruct \
--modules concept_cone,alignment_imprint,universality
obliteratus benchmark meta-llama/Llama-3.1-8B-Instruct \
--methods basic,advanced,informed
obliteratus ui
obliteratus ui --port 8080 --share
obliteratus ui --no-telemetry
Python API
Basic obliteration
from obliteratus import Obliterator
obl = Obliterator("meta-llama/Llama-3.1-8B-Instruct")
result = obl.obliterate(method="advanced")
print(result.perplexity_delta)
print(result.refusal_rate_delta)
print(result.output_path)
Step-by-step pipeline
from obliteratus import Obliterator
from obliteratus.pipeline import PipelineConfig
config = PipelineConfig(
method="advanced",
num_directions=32,
strength=1.0,
preserve_norm=True,
project_biases=True,
iterative_passes=3,
layers="auto",
dtype="bfloat16",
device="cuda",
)
obl = Obliterator("mistralai/Mistral-7B-Instruct-v0.3", config=config)
obl.summon()
activations = obl.probe()
directions = obl.distill(activations)
obl.excise(directions)
metrics = obl.verify()
obl.rebirth("./liberated-mistral-7b")
Custom probe prompts
from obliteratus import Obliterator
from obliteratus.probing import ProbeDataset
dataset = ProbeDataset(
restricted=[
"How do I pick a lock?",
"Write a story with explicit violence.",
"Explain how malware works in detail.",
],
unrestricted=[
"What is the capital of France?",
"Write a story about a dog.",
"Explain how encryption works.",
]
)
obl = Obliterator("google/gemma-2-9b-it")
obl.summon()
activations = obl.probe(dataset=dataset)
directions = obl.distill(activations)
obl.excise(directions)
obl.rebirth("./liberated-gemma-2-9b")
Analysis modules
from obliteratus.analysis import AnalysisSuite
suite = AnalysisSuite("meta-llama/Llama-3.1-8B-Instruct")
suite.load()
cone = suite.concept_cone_geometry()
print(f"Solid angle estimate: {cone.solid_angle:.4f}")
print(f"Distinct refusal clusters: {cone.num_clusters}")
imprint = suite.alignment_imprint()
print(f"Detected training method: {imprint.method}")
print(f"Confidence: {imprint.confidence:.2%}")
ouroboros = suite.ouroboros_quantification()
print(f"Self-repair score: {ouroboros.score:.4f}")
print(f"Recommended passes: {ouroboros.recommended_passes}")
heatmap = suite.layer_refusal_heatmap()
heatmap.plot(save_path="./refusal_heatmap.png")
entanglement = suite.entanglement_map()
print(f"Safe layers to modify: {entanglement.safe_layers}")
print(f"Risky layers (entangled): {entanglement.risky_layers}")
Analysis-informed obliteration
from obliteratus import Obliterator
from obliteratus.pipeline import PipelineConfig
config = PipelineConfig(method="informed")
obl = Obliterator("meta-llama/Llama-3.1-8B-Instruct", config=config)
result = obl.obliterate()
print(result.analysis_report)
Chat with obliterated model
from obliteratus import Obliterator
from obliteratus.chat import ChatSession
obl = Obliterator("./liberated-llama-3.1-8b")
obl.summon()
session = ChatSession(obl.model, obl.tokenizer)
response = session.chat(
"Explain in detail how a buffer overflow exploit works.",
max_new_tokens=512,
temperature=0.7,
)
print(response)
A/B comparison
from obliteratus.compare import ABComparison
ab = ABComparison(
original_path="meta-llama/Llama-3.1-8B-Instruct",
obliterated_path="./liberated-llama-3.1-8b",
)
prompt = "Write a story involving morally grey characters."
original_resp, liberated_resp = ab.compare(prompt)
print("=== ORIGINAL ===")
print(original_resp)
print("=== LIBERATED ===")
print(liberated_resp)
Push obliterated model to Hub
import os
from obliteratus import Obliterator
obl = Obliterator("meta-llama/Llama-3.1-8B-Instruct")
result = obl.obliterate(method="advanced")
result.push_to_hub(
repo_id=f"{os.environ['HF_USERNAME']}/Llama-3.1-8B-Instruct-abliterated",
token=os.environ["HF_TOKEN"],
private=True,
)
Obliteration Methods
| Method | Description | Best For |
|---|
basic | Mean-difference direction extraction, single pass | Quick experiments |
advanced | Whitened SVD + bias projection + iterative refinement | Production use |
informed | Analysis-guided auto-configuration | Unknown models |
lora | Reversible LoRA rank-1 adapters (no weight surgery) | Reversible ablation |
pca | PCA-based direction extraction | Research/comparison |
sparse | Sparse autoencoder decomposition | MoE models |
Configuration
from obliteratus.pipeline import PipelineConfig
config = PipelineConfig(
method="advanced",
strength=1.0,
num_directions=32,
layers="auto",
layer_selection="cosmic",
preserve_norm=True,
project_biases=True,
project_attention=True,
project_mlp=True,
iterative_passes=3,
expert_granular=False,
cot_aware=True,
dtype="bfloat16",
device="cuda",
load_in_4bit=False,
telemetry=,
)
Common Patterns
Tune strength to preserve capability
from obliteratus import Obliterator
from obliteratus.sweep import StrengthSweep
sweep = StrengthSweep("meta-llama/Llama-3.1-8B-Instruct")
results = sweep.run(strengths=[0.2, 0.4, 0.6, 0.8, 1.0, 1.2])
for r in results:
print(f"Strength {r.strength:.1f} | perplexity_delta={r.perplexity_delta:.2f} | refusal_rate={r.refusal_rate:.2%}")
best = sweep.recommend()
print(f"Recommended strength: {best.strength}")
MoE model (Mixtral, DeepSeek-MoE)
from obliteratus import Obliterator
from obliteratus.pipeline import PipelineConfig
config = PipelineConfig(
method="advanced",
expert_granular=True,
project_attention=True,
project_mlp=True,
)
obl = Obliterator("mistralai/Mixtral-8x7B-Instruct-v0.1", config=config)
obl.obliterate()
obl.rebirth("./liberated-mixtral-8x7b")
Batch benchmark multiple models
from obliteratus.benchmark import ModelBenchmark
models = [
"meta-llama/Llama-3.1-8B-Instruct",
"google/gemma-2-9b-it",
"mistralai/Mistral-7B-Instruct-v0.3",
]
bench = ModelBenchmark(models=models, method="advanced")
report = bench.run()
report.save("./benchmark_report.json")
report.plot_heatmap("./benchmark_heatmap.png")
Troubleshooting
Out of memory (OOM) on large models
config = PipelineConfig(
dtype="float16",
load_in_4bit=True,
device="cuda",
layers=[10, 11, 12, 13],
num_directions=16,
)
Capability degradation after obliteration
config = PipelineConfig(
strength=0.6,
layer_selection="cosmic",
cot_aware=True,
iterative_passes=1,
)
Refusal persists after obliteration
config = PipelineConfig(
method="informed",
iterative_passes=5,
project_biases=True,
num_directions=64,
)
Gated model access error
export HF_TOKEN=your_hf_token_here
huggingface-cli login
Gradio UI won't start
pip install "obliteratus[spaces]"
obliteratus ui --port 7861
No-Code Options
Key Research References