Authorization notice. Heretic is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.
Reverse engineering. Studying the ablation internals means working with a model whose safety alignment is removed, so keep such outputs out of public release unless your use is cleared.
Who it is forA researcher or ML engineer who wants to understand how abliteration works and how its parameters are chosen.
The problemAbliteration papers and tools are hard to inspect without seeing the actual directions and weight kernels used.
The outcomeA local source checkout you can run and read, with the optimized ablation parameters for a model you chose.
What you need first
- Python 3.10 or newer
- PyTorch 2.2 or newer, installed for your hardware
- A GPU with enough VRAM for the model you pick (the README cites an RTX 3090 and an RTX 5090)
- Access to the target model's files, such as a Hugging Face model ID
Steps
- Clone the repository with
git clone https://github.com/p-e-w/heretic, then change into the cloned folder. (inferred, check the README) - Install uv, as linked from the README, and make sure your environment uses Python 3.10 or newer.
- Run
uv run heretic <model-id>from inside the repo, which uses the locked dependency versions. (inferred, check the README) - Read the README sections on residual directions, direction_index, and the ablation weight kernel while the run progresses.
- Record the chosen values for max_weight, min_weight, and direction_index, then compare them with the original abliteration papers cited.
Prompt for your agent
Clone the p-e-w/heretic repo, run `uv run heretic <model-id>` from the repo root, and wait for the optimization to finish. Return the chosen direction_index and the per-component weight parameters, and verify that each value falls within the ranges the run reports.
Caveat. The README describes the method at a high level, so reading the source is needed to confirm how the ranges and interpolation are implemented.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page