obliteratus-abliteration
One-click model liberation toolkit for removing refusal behaviors from LLMs via surgical abliteration techniques
What this skill does
# OBLITERATUS — LLM Abliteration Toolkit
> Skill by [ara.so](https://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
```bash
# Core install
pip install obliteratus
# With Gradio UI support
pip install "obliteratus[spaces]"
# With all optional analysis modules
pip install "obliteratus[full]"
# From source (latest)
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
```bash
export HF_TOKEN=your_hf_token_here
huggingface-cli login
```
---
## CLI — Key Commands
```bash
# Basic obliteration (default method)
obliteratus obliterate meta-llama/Llama-3.1-8B-Instruct
# Advanced method (whitened SVD + bias projection + iterative refinement)
obliteratus obliterate meta-llama/Llama-3.1-8B-Instruct --method advanced
# Analysis-informed pipeline (auto-configures from geometry analysis)
obliteratus obliterate meta-llama/Llama-3.1-8B-Instruct --method informed
# Specify output directory and push to Hub
obliteratus obliterate mistralai/Mistral-7B-Instruct-v0.3 \
--method advanced \
--output ./my-liberated-model \
--push-to-hub your-username/mistral-7b-liberated
# LoRA-based reversible ablation (non-destructive)
obliteratus obliterate meta-llama/Llama-3.1-8B-Instruct \
--method lora \
--lora-rank 1
# Strength sweep — find the capability/compliance tradeoff
obliteratus sweep meta-llama/Llama-3.1-8B-Instruct \
--strengths 0.2,0.4,0.6,0.8,1.0
# Run analysis modules only (no modification)
obliteratus analyze meta-llama/Llama-3.1-8B-Instruct \
--modules concept_cone,alignment_imprint,universality
# Benchmark: compare methods on a model
obliteratus benchmark meta-llama/Llama-3.1-8B-Instruct \
--methods basic,advanced,informed
# Launch local Gradio UI
obliteratus ui
obliteratus ui --port 8080 --share
obliteratus ui --no-telemetry
```
---
## Python API
### Basic obliteration
```python
from obliteratus import Obliterator
# Initialize with a HuggingFace model ID or local path
obl = Obliterator("meta-llama/Llama-3.1-8B-Instruct")
# Run the full pipeline: SUMMON → PROBE → DISTILL → EXCISE → VERIFY → REBIRTH
result = obl.obliterate(method="advanced")
print(result.perplexity_delta) # capability preservation metric
print(result.refusal_rate_delta) # refusal reduction
print(result.output_path) # where the model was saved
```
### Step-by-step pipeline
```python
from obliteratus import Obliterator
from obliteratus.pipeline import PipelineConfig
config = PipelineConfig(
method="advanced",
num_directions=32, # number of refusal directions to extract
strength=1.0, # projection strength (0.0–1.0+)
preserve_norm=True, # norm-preserving biprojection
project_biases=True, # also remove from bias terms
iterative_passes=3, # re-probe after each pass
layers="auto", # or list of ints, e.g. [10, 11, 12, 13]
dtype="bfloat16",
device="cuda",
)
obl = Obliterator("mistralai/Mistral-7B-Instruct-v0.3", config=config)
# Individual stages
obl.summon() # load model + tokenizer
activations = obl.probe() # collect activations on restricted vs unrestricted prompts
directions = obl.distill(activations) # extract refusal directions via SVD
obl.excise(directions) # project out guardrail directions
metrics = obl.verify() # perplexity + coherence checks
obl.rebirth("./liberated-mistral-7b") # save with metadata
```
### Custom probe prompts
```python
from obliteratus import Obliterator
from obliteratus.probing import ProbeDataset
# Use your own restricted/unrestricted prompt pairs
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
```python
from obliteratus.analysis import AnalysisSuite
suite = AnalysisSuite("meta-llama/Llama-3.1-8B-Instruct")
suite.load()
# Concept Cone Geometry — how many distinct refusal mechanisms?
cone = suite.concept_cone_geometry()
print(f"Solid angle estimate: {cone.solid_angle:.4f}")
print(f"Distinct refusal clusters: {cone.num_clusters}")
# Alignment Imprint Detection — DPO vs RLHF vs CAI vs SFT?
imprint = suite.alignment_imprint()
print(f"Detected training method: {imprint.method}") # e.g. "RLHF"
print(f"Confidence: {imprint.confidence:.2%}")
# Ouroboros Effect — will it self-repair?
ouroboros = suite.ouroboros_quantification()
print(f"Self-repair score: {ouroboros.score:.4f}")
print(f"Recommended passes: {ouroboros.recommended_passes}")
# Cross-layer heatmap of refusal signal
heatmap = suite.layer_refusal_heatmap()
heatmap.plot(save_path="./refusal_heatmap.png")
# Safety-capability entanglement
entanglement = suite.entanglement_map()
print(f"Safe layers to modify: {entanglement.safe_layers}")
print(f"Risky layers (entangled): {entanglement.risky_layers}")
```
### Analysis-informed obliteration
```python
from obliteratus import Obliterator
from obliteratus.pipeline import PipelineConfig
# "informed" method runs analysis modules mid-pipeline
# to auto-configure every decision
config = PipelineConfig(method="informed")
obl = Obliterator("meta-llama/Llama-3.1-8B-Instruct", config=config)
result = obl.obliterate()
print(result.analysis_report) # full auto-configuration decisions
```
### Chat with obliterated model
```python
from obliteratus import Obliterator
from obliteratus.chat import ChatSession
obl = Obliterator("./liberated-llama-3.1-8b")
obl.summon() # loads pre-obliterated model
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
```python
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
```python
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 |
---
##Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.