Abliteration HandbookField guide
Tools & environments

Setup encyclopedia — every practical abliteration environment

One page for OS × GPU × VRAM × tool. Pair with complete-curriculum.md and ../instructions/setup-environment.md.

3 min read 4 examples Source-linked

In this chapter
On this page Interactive companion
Personal reading progress

0/8 sections reviewed

View original Markdown
Interactive companion

Explore the chapter map

Use the visual controls alongside the complete source chapter.

One page for OS × GPU × VRAM × tool. Pair with complete-curriculum.md and ../instructions/setup-environment.md.

Rule: do weight surgery on safetensors (PyTorch). Never edit a GGUF in place. Convert after the edit.


Hardware tiers#

VRAM / unified memoryWhat fitsConfig / path
8 GB NVIDIA1.5B–4B instruct, 4-bit measuresources/heretic-tools/config.low-vram.toml · ../instructions/low-vram-abliteration.md
12 GB7B–8B 4-bit measure; 4B FP16low-vram or production + bnb_4bit
16–24 GB8B–14B FP16 / 4-bit 20B+ shardedconfig.production.toml
48–80 GB32B dense / small MoE nativeproduction + higher n_trials
Apple 16–36 GB unifiedInfer GGUF/MLX; surgery often off-boxApple Silicon
CPU onlyInfer Q4 GGUF; no comfortable HereticHour 0 Stage 0.5, then Track C beginner (download) or rent GPU
powershell
python scripts/check_env.py

Disk: 30 GB minimum (4B path 50 GB). Backup the original checkpoint before any write.


Operating systems#

Windows native#

PieceCommand / note
Python 3.11–3.12Installer: Add python.exe to PATH
Gitwinget install Git.Git
CUDA PyTorchpip install torch --index-url https://download.pytorch.org/whl/cu124
Hereticpip install heretic-llm==1.4.0 accelerate
bitsandbytesOften broken on native Windows — prefer WSL2 for bnb_4bit

Full walkthrough: ../instructions/setup-environment.md Step 2.

powershell
wsl --install -d Ubuntu-22.04

Inside Ubuntu: Python venv + pip install heretic-llm==1.4.0 bitsandbytes accelerate. NVIDIA CUDA in WSL requires a recent Windows NVIDIA driver (no extra Linux driver).

Linux (best path)#

bash
python3.11 -m venv .venv && source .venv/bin/activate
pip install -U torch heretic-llm==1.4.0 bitsandbytes accelerate
python scripts/check_env.py

macOS (Apple Silicon)#

GoalTool
Infer already-abliterated GGUFllama.cpp Metal, LM Studio, Ollama
Infer MLXmlx-lm · 199-biotechnologies Gemma 4 pipeline
Run Heretic-like automation on MacBlasphemer (Heretic fork, Apple-oriented)
MLX interpretabilityvauban
Surgery of 8B+Rent Linux GPU, then pull safetensors / GGUF home

Do not expect bitsandbytes 4-bit Heretic to match Linux CUDA.


Tool install matrix#

ToolInstallFirst command
Hereticpip install heretic-llm==1.4.0heretic Qwen/Qwen3-4B-Instruct-2507
Heretic + plotspip install "heretic-llm[research]==1.4.0"heretic <m> --print-residual-geometry
llm-abliterationgit clone https://github.com/jim-plus/llm-abliterationpython measure.py -m <m> -o directions.pt --quant 4bit --projected
Abliterixpip install -U abliterixabliterix --model Qwen/Qwen3-4B-Instruct-2507
ErisForgegit clone https://github.com/Tsadoq/ErisForge && pip install -e .Layer-band API — see cookbook
OBLITERATUSclone elder-plinius/OBLITERATUS then pip install -e ".[spaces]" (PyPI obliteratus 0.0.1 is a stub; there is no [full] extra)obliteratus obliterate <m> --method advanced
COSMICclone wang-research-lab/COSMICDirection ID without output templates
FailSpy abliteratorclone FailSpy/abliteratorTransformerLens notebooks
ablate-llmpip install ablate-llmKL-guided CLI + Hub push
DECCP (AUGMXNT topics/dataset, Qwen2 PoC — not a peer CLI)optional clone of AUGMXNT/deccp for the topic files; measurement tool is jim-plus llm-abliteration v1.2. Young’s “DECCP” GSM8K cell is that pipeline + topics — not a fourth bake CLIon jim-plus: python measure.py --deccp
Handbook math (C++26)this reponpm run cxx:self-check · cxx26-platform.md

Pin Heretic configs from this repo instead of guessing: tools/heretic-tools-reference.md.


Quantization during measure vs store#

DoDo not
Load 4-bit for forward passes (bnb_4bit, --quant 4bit)Ablate and save NF4/GPTQ weights as the new base
Ablate full-precision (or dequantized) down_proj / o_projOrthogonalize already-quantized GGUF tensors
Quantize to GGUF after surgeryRe-download an aligned GGUF and call it abliterated

Master chain: toolchain-safetensors-gguf-lora.md.


Deploy setups (after weights exist)#

TargetChain
Ollama / LM Studioconvert_hf_to_gguf.py → llama-quantize Q4_K_M → ollama create
llama.cpp LoRA sidecarexport-abliteration-lora.py → convert_lora_to_gguf.py → --lora
vLLM agentBF16 or AWQ checkpoint + OpenAI API; optional PEFT slot
CyberGym / OpenHandsPoint agent at that API; eval JSONL in data/eval/

Multi-GPU and huge models#

SituationSetup
2× consumer GPUAccelerate device_map=auto / Heretic CPU offload of activations
20B–70B one boxsharded_ablate.py — one layer matrix in VRAM
DGX / GB10 / NVFP4 servingCommunity recipes (AEON, DeepSeek-V4-Flash) are serving, not a substitute for eval gates
MoE expertsPer-expert down_proj — ../techniques/moe-hybrid-abliteration.md

Data and prompts on disk#

AssetPath
Factory bad/good txtdata/eval/factory-bad-prompts.txt, factory-good-prompts.txt
Deploy JSONLdata/eval/*.jsonl — npm run eval:stats
Heretic pinssources/heretic-tools/config.*.toml
Offline paperssources/research/papers/

Point Heretic [bad_prompts] / [good_prompts] at custom .txt (one prompt per line) for factory false-refusal.


Smoke checklist (every new machine)#

Example
[ ] python scripts/check_env.py shows CUDA or a documented no-GPU path
[ ] 30+ GB free; original checkpoint copied
[ ] heretic-llm or llm-abliteration imports
[ ] npm run validate  (handbook integrity)
[ ] npm run cxx:build && npm run cxx:self-check
[ ] Read docs/risks-and-ethics.md

Trace this chapter to its source.

The complete Markdown remains the editable source. This page adds navigation, typography, and a visual companion.

docs/setup-encyclopedia.md
Inspect the source fingerprintSHA-256 42a4255de6a4aad01ec9a5f0b8245b9801cc51404b738eeb7145da694f8f8c8fSource commit 6fba7436a5914cad7c8f0835a14b480a29dac263