Abliteration tools and libraries on GitHub

Abliteration tools on GitHub compared: Heretic, OBLITERATUS, llm-abliteration, FailSpy's abliterator and 14 more, by method, MoE support, output, metrics and license.

Updated AbliterationToolsGitHub

Quick answer

Abliteration tools are open-source programs that remove a model's trained refusals by editing its weights, with no training run. Of the 18 we compared, Heretic (43,496 GitHub stars) does the most for you: it tunes the edit and reports refusals and KL divergence, but its repository was archived after 2026-11-28. Use llm-abliteration for manual control, and OBLITERATUS or abliterix for per-expert edits on MoE models.

Abliteration tools at a glance

Eighteen GitHub repositories turn abliteration into working code, and they differ more than their names suggest. Some search the settings for you, some expect you to pick layers by hand, and one never touches the weights at all. The table compares them on the questions that decide which one you can use. Stars, licenses and last-commit months come from GitHub, checked 2026-11-27.

Tool Method MoE Output Built-in metrics License Stars Last commit
Heretic Optuna search over Arbitrary-Rank Ablation (default since v2.0) or directional ablation with norm preservation Several architectures Safetensors or LoRA adapter Keyword refusals, KL divergence, optional benchmarks AGPL-3.0 43,496 2026-11, then archived
OBLITERATUS Multi-direction (SVD, PCA, mean difference), norm-preserving, several presets Yes, per-expert Checkpoint plus run metadata Refusal rate, perplexity, coherence, KL AGPL-3.0 9,753 2026-11
remove-refusals-with-transformers Difference of means, removed by inference hooks Not stated None; hooks only None Apache-2.0 2,423 2025-11
FailSpy/abliterator Difference of means, weight orthogonalization, on TransformerLens Only what TransformerLens supports PyTorch save; Hugging Face export "coming soon" Token-based refusal score, MSE on answered prompts MIT 844 2024-06
refusal_direction The paper's pipeline: candidate directions, selection, ablation Not stated Direction file and eval artifacts Refusal metrics, cross-entropy loss Apache-2.0 495 2024-10
abliterix Heretic derivative: Optuna over projection, LoRA and steering Yes, per-expert and router Safetensors; FP4 repack for vLLM Refusals (offline or LLM judge), KL AGPL-3.0 297 2026-11
ErisForge Ablation or addition of a direction in chosen layers Not stated Local save or Hub push Expression-based refusal score None detected 290 2025-02
AbliteratedOutTheBox Per-prompt activation edit at inference, in a llama.cpp fork Through llama.cpp None; runs an unmodified GGUF None published MIT 223 2026-11
Orion-zhen/abliteration Simple, biprojected, norm-preserving or both; top-k directions Not stated Hugging Face folder Model comparison script GPL-3.0 214 2026-11
llm-abliteration Conventional, projected or norm-preserving, planned per layer in YAML Selected architectures Safetensors, one shard at a time Per-layer direction analysis GPL-3.0 205 2026-03
NousResearch/llm-abliteration Fork of llm-abliteration as of November 2025 Not in its README Hugging Face folder Per-layer direction analysis GPL-3.0 200 2025-11
Apostate Gated MLP edit that fires only on refusal-triggering inputs; closed-form nulling option Not stated Safetensors or GGUF Held-out KL, refusal rate on a public prompt set MIT 48 2026-11
jwest33/abliterator Orthogonal projection with norm preservation, null-space constraints, winsorization Not stated Safetensors; GGUF through llama.cpp Refusal rates on both prompt sets MIT 42 2026-07
heretic-gguf Heretic-style Optuna search, applied to quantized GGUF through llama.cpp LoRA Yes, per-expert Merged GGUF or LoRA GGUF Keyword refusals, KL AGPL-3.0 16 2026-08
ablate Difference of means, Optuna on refusal rate plus KL, optional subspace Not stated; aimed at small models Hugging Face folder Refusal rate, KL, coherence; a public refusal benchmark with a judge Apache-2.0 10 2026-11
mlx-abliterate Difference of means in MLX, requantized in place Shared and optionally routed experts MLX model String-match refusals, teacher-forced KL MIT 3 2026-10
LLM-abliterate Rank-1 orthogonalization including embeddings, strength swept README claims dense, hybrid and MoE Hugging Face folder Refusal and capability sweep README says Apache-2.0; no license file detected 3 2026-08
abliteration-toolkit Labonne and FailSpy method, written as teaching code with a PDF tutorial Not stated Hugging Face folder Refusal-rate probe MIT 2 2026-06

"Not stated" means the README does not mention MoE support. It does not mean the tool fails on MoE models.

The main tools, one by one

The first three entries below cover most real use. The rest serve narrower needs.

Heretic

Heretic is a command-line tool by Philipp Emanuel Weidmann that automates abliteration. It needs no knowledge of model internals. You name a model, and it runs an Optuna search that co-minimizes two scores: refusals on prompts the original model refuses, and KL divergence from the original model on ordinary prompts. Version 1.x tuned directional ablation. Its README described "a parametrized variant of directional ablation" with per-layer weights and an interpolated refusal direction. Version 2.0, released 2026-11-01, made Arbitrary-Rank Ablation the default. It optimizes each weight matrix directly instead of removing one direction. Classic directional ablation remains available as a second modifier.

The README says Heretic supports "most dense models, including many multimodal models, several different MoE architectures, and many modern hybrid models". It processes Qwen3-4B-Instruct-2507 in about 30 to 40 minutes on an RTX 3090. It saves a Transformers checkpoint or uploads it to Hugging Face. Since v1.3.0 it can make reproducible runs, and since v1.4.0 it can rebuild a model from the reproduce.json manifest uploaded with it. The official repository is p-e-w/heretic, and the PyPI package is heretic-llm. On 2026-11-27 an empty look-alike repository with Heretic's description also existed on GitHub, so install from PyPI or from p-e-w's repository. Our Heretic vs abliterated page explains what its model-card numbers mean.

The repository is archived. On 2026-12-01 GitHub showed p-e-w/heretic as archived, which makes it read-only: no new issues, pull requests or commits. Its last commit is dated 2026-11-28, and the last PyPI release is heretic-llm 2.1.0 of 2026-11-08. The package still installs and runs, and the models it built keep their reproduce.json manifests. Fixes and support for new architectures will not come from that repository, so pin the version you test with. On 2026-12-01 no fork had taken over as its maintained successor.

llm-abliteration and its forks

llm-abliteration is maintained by Jim Lai (GitHub jim-plus, Hugging Face grimjim). He wrote the projected abliteration and norm-preserving biprojected abliteration posts. The tool is manual by design, in four steps:

  1. Measure directions on refused and answered prompts.
  2. Chart them per layer.
  3. Write a YAML plan.
  4. Ablate.

It loads one safetensors shard at a time, which lets large models fit. Its README lists selected MoE architectures and Apple Metal support. Default behavior is conventional abliteration. Projection, norm preservation and inversion are separate flags.

Two well-known repositories share this code:

  • Orion-zhen/abliteration is the upstream that llm-abliteration forked from. It now offers simple, biprojected, norm-preserving and combined methods, driven by one config file. Its example config uses the combined method with the top 3 directions.
  • NousResearch/llm-abliteration is a fork of llm-abliteration whose last commit is from 2025-11-27. Its README predates the MoE support, sharded ablation and Metal support in the upstream.

OBLITERATUS

OBLITERATUS is a research toolkit with a CLI, a Python API and a Gradio interface on Hugging Face Spaces. It extracts several refusal directions with SVD, PCA or mean difference. It projects them out with norm preservation. Its presets range from a 4-direction default to 8-direction modes. The 8-direction modes include Expert-Granular Abliteration for MoE models, which splits the edit per expert using router logits. Its README says telemetry is on by default in the hosted Space, and runs there contribute to a shared dataset. One independent comparison of 23 Gemma 4 E4B builds, DreamFast's abliterlitics report, ranked the OBLITERATUS-published build last on capability: KL 1.10 and MMLU-Pro down 11.7 points. That result covers one checkpoint, not every OBLITERATUS setting.

The 2024 originals

FailSpy published the first "abliterated" Llama 3 models in May 2024 and released FailSpy/abliterator later that month. It wraps TransformerLens to cache activations, rank candidate directions and apply them. Its README calls it "exceedingly barebones" and lists Hugging Face export as "coming soon". Its last commit is from June 2024. refusal_direction is the code for Arditi et al. (2024): it reproduces the paper's direction selection and evaluation. remove-refusals-with-transformers re-implemented the idea on plain Transformers. It computes the direction and applies it with inference hooks; it does not write edited weights. huihui-ai's model cards, such as gemma-3-12b-it-abliterated, cite it as their method.

Optimizers built on Heretic

  • abliterix is a derivative of Heretic under the same AGPL license. It adds 150+ model configs, per-expert and router edits for MoE models, and an FP4 repack path for vLLM. It also includes a benchmark contract, HonestAbliterationBench. Each generation must run 100 to 150 tokens and is scored by an LLM judge.
  • heretic-gguf runs a Heretic-style search on quantized GGUF files through llama.cpp, so it never loads full-precision weights. Its main target was DeepSeek-V4-Flash-0731, a 284B-total MoE.
  • Blasphemer is a fork of Heretic v1.0.1 for Apple Silicon. It adds checkpoint and resume, plus GGUF conversion.

Tools for other runtimes

  • mlx-abliterate runs on MLX, so it works on Apple Silicon without PyTorch. It edits quantized modules in place.
  • AbliteratedOutTheBox is a llama.cpp fork. It measures a refusal direction from each prompt and edits activations as it generates. The GGUF on disk stays unchanged.
  • Apostate bakes a gated edit into one MLP neuron per layer. The edit only fires on inputs that look like refusal triggers. It exports safetensors or GGUF.

Teaching repositories and handbooks

Repositories that rank but contain no tool

Several results for "abliteration github" are not abliteration tools:

The abliterated topic page mostly lists deployment recipes and model wrappers, not editing tools. Abliterator, the product behind this site, is not affiliated with abliteration.ai or with FailSpy's abliterator library.

Which one to use

Heretic is still the easiest start. It has the largest user base, it searches settings for you and it publishes a standard pair of numbers on every model card it writes. Its repository is archived, though, so pin heretic-llm 2.1.0 and expect no fixes for new architectures. Pick a different tool when one of these applies:

Your situation Use
First model, consumer GPU, any common architecture Heretic, pinned to 2.1.0
You want automatic search in a tool that still gets commits abliterix (last commit 2026-11-17) or OBLITERATUS (2026-11-30)
You want to choose layers and strengths yourself llm-abliteration or Orion-zhen/abliteration
MoE model with many experts abliterix or OBLITERATUS's per-expert presets; test both against your own evals
You only have a quantized GGUF, or the model has no Transformers implementation heretic-gguf
Apple Silicon, model too large for bf16 in memory mlx-abliterate
You need GGUF output from a simple CLI jwest33/abliterator
You want to learn the math step by step abliteration-toolkit or Labonne's notebook
You want to reproduce the original paper refusal_direction

Avoid starting a new project on FailSpy's library. It was the first, but it depends on TransformerLens model support and has had no commits since 2024.

How to abliterate a small open model

To abliterate a small model, install Heretic, point it at a model ID and pick a trial from the results. The steps below summarize Heretic's README and its tutorial; follow those for current details. Check the model's license before you publish an edited copy. Abliteration removes refusals; it does not change the license or the law, or the terms of wherever you run the model.

  1. Pick a small model. The tutorial estimates about 2.5 GB of VRAM per billion parameters, so a 4B model needs about 10 GB. Optional 4-bit loading through bitsandbytes cuts that by about 70%, at a small accuracy cost.

  2. Prepare Python 3.10+ with PyTorch 2.6+, installed for your GPU as PyTorch's own instructions describe.

  3. Install and run. These two commands are from Heretic's README:

    pip install -U heretic-llm
    heretic Qwen/Qwen3-4B-Instruct-2507
    

    Heretic benchmarks your GPU to choose a batch size, then runs 100 trials. Each trial is scored on refusals out of 100 prompts the original model refuses, and on KL divergence. The tutorial's example run on an RTX 3060 took about 2 hours.

  4. Choose a trial. The tutorial warns that the trial with the fewest refusals is not always the best choice. It treats anything under 10 refusals as effective and suggests the lowest KL divergence among those.

  5. Save it. Save it locally as a Transformers checkpoint, or upload it with optional reproducibility information.

  6. Test it yourself. Heretic's score uses a keyword match on its own prompt set. Run a refusal test on prompts it never saw, an over-refusal set such as XSTest, and a few capability benchmarks paired against the original. Our page on whether abliteration hurts performance explains how to read paired results.

  7. Convert if needed. For llama.cpp or Ollama, convert the checkpoint with llama.cpp's own conversion scripts. Alternatively, use a tool whose README documents GGUF export.

If you would rather control every choice, llm-abliteration's README walks through the manual route. You measure, analyze the layers, write a YAML plan and ablate. The method behind both routes is explained on what is abliteration.

When abliterating yourself stops being practical

On frontier MoE models, the edit itself is the easy part; the memory, evaluation and serving are where it gets hard. Most published examples for the tools above are models of 1B to about 120B parameters. The largest we found were the 400B-class models (Llama-3.1-405B, Llama-4-Maverick-401B) that abliterix's README lists as config examples, and the 284B DeepSeek-V4-Flash-0731 that heretic-gguf targets. Take Kimi K3.1 Pro as an example. Its model card lists:

  • 2.8T total parameters, 104B active;
  • 896 experts, with 16 selected per token;
  • 93 layers, mixing 69 KDA layers with 24 Gated DSA attention layers;
  • MXFP4 weights from quantization-aware training;
  • a 1,048,576-token context.

The repository holds about 1.56 TB of safetensors (checked 2026-11-27).

GPU memory. Applying Heretic's tutorial rule of 2.5 GB per billion parameters to 2.8T parameters gives about 7,000 GB. With 4-bit loading it is still about 2,100 GB. The rule was written for small dense models, so read these as orders of magnitude; both are far beyond any single GPU. A per-expert edit has to handle 896 experts, and the linear-attention layers need edits too. Tools that only edit o_proj and down_proj can miss residual writers in hybrid layers, as LLM-abliterate's README documents. Finally, the result has to be quantized back to MXFP4 without breaking it.

Evaluation. A score of 3 refusals out of 100 keyword-matched prompts says little about other input paths. It doesn't cover thinking mode, images, other languages, restrictive system prompts or long-context capability. Each needs its own test set and a paired comparison against the original, run on the same multi-node serving stack.

Serving. The vLLM recipe for the unmodified model asks for "one tensor-parallel group of 8 GPUs, either two GB300 trays or one B300 node". When checked, it needed a nightly vLLM build. On B300 it caps concurrency at 128 sequences because the KV cache cannot hold the default 1,024.

That is the gap Abliterator fills. It serves Kimi K3.1 Pro Abliterated and DeepSeek V4.1 Flash Abliterated through OpenAI- and Anthropic-compatible endpoints, with the full 1M-token context. The weights are not released. The DeepSeek edit changed 15,442 matrices and was quantized back to the official format. On it, refusals fell from 94% to 1% while reasoning, math and vision scores stayed within noise. MMLU-Pro dropped 0.8 points, the one statistically clear loss. The benchmarks page has every test. Self-hosting vs the API compares the costs.

Frequently asked questions

What is the most popular abliteration tool on GitHub?

Heretic by Philipp Emanuel Weidmann, with 43,496 stars on 2026-11-27 (its repository was archived after its last commit on 2026-11-28), followed by OBLITERATUS (9,753) and Sumandora's remove-refusals-with-transformers (2,423). FailSpy's original abliterator library has 844 stars and no commits since June 2024.

Is there a Python library for abliteration?

Yes. Heretic (heretic-llm), abliterix, ablate-llm and ErisForge install from PyPI. FailSpy's abliterator is a TransformerLens-based library on GitHub; its README still lists saving a Hugging Face model as coming soon.

Can these tools abliterate a mixture-of-experts model?

Some can. Heretic supports several MoE architectures and llm-abliteration supports selected ones. OBLITERATUS and abliterix add per-expert edits, and heretic-gguf edits MoE models directly in GGUF form through llama.cpp.

Do abliteration tools output GGUF files?

Most save a Hugging Face safetensors checkpoint that you convert with llama.cpp afterwards. jwest33's abliterator and Apostate export GGUF, heretic-gguf writes a merged GGUF or a LoRA adapter, and AbliteratedOutTheBox edits activations of an unmodified GGUF at inference time.

Does abliteration.ai's GitHub organization have an abliteration tool?

No. On 2026-11-27, github.com/abliterationai held two repositories: API examples for its hosted service and an OpenClaw provider plugin. Abliterator is a different product and is not affiliated with abliteration.ai or with FailSpy's abliterator library.

Try it in your browser.

Ask it something your usual model refuses.

Start a chat

No sign-up to try. $10 free when you verify your email.