What do you want to do?
4 use cases
-
Remove refusals from an open model in one run
Run Heretic on a chosen open model to get a version with fewer refusals and low KL divergence.
- REPO
p-e-w/heretic - Research
- Intermediate
View prompt
In a Python 3.10+ environment with PyTorch 2.2+ and a GPU, install the heretic-llm package from the p-e-w/heretic repo with `pip install -U heretic-llm`, then run `heretic <model-id>` on the target model. Report the final refusal count and KL divergence values Heretic prints, and verify that the output model was saved to the location Heretic reports.
- REPO
-
Measure refusals and KL divergence against the original model
Use Heretic's built-in evaluation to compare a decensored model with its original on the same metrics.
- REPO
p-e-w/heretic - Research
- Intermediate
View prompt
Install the heretic-llm package from the p-e-w/heretic repo, then run `heretic --model <original-model-id> --evaluate-model <candidate-model-id>`. Return the refusal count and KL divergence the tool reports, and verify that both model IDs in the output match the ones you passed in.
- REPO
-
Decensor a larger model on a small GPU with 4-bit quantization
Turn on bitsandbytes 4-bit quantization so a model fits into less VRAM during the run.
- REPO
p-e-w/heretic - Research
- Advanced
View prompt
Install heretic-llm from the p-e-w/heretic repo and set the quantization option to bnb_4bit in a copy of config.default.toml. Then run Heretic on <model-id> using that configuration. Report whether the run completed, and verify that the log shows the bnb_4bit setting was applied.
- REPO
-
Trace how refusal directions are ablated across layers
Run Heretic from a source clone to study its per-layer residual directions and ablation kernel settings.
- REPO
p-e-w/heretic - Research
- Advanced
View prompt
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.
- REPO
What people are building with Heretic
-
BenchmarkReddit
Benchmarked a Heretic version of GPT-OSS 120B against the original on Aider Polyglot
Both models ran unquantized through llama.cpp with the same settings, and the author ran the Aider Polyglot coding benchmark three times each. The Heretic version scored higher.
By u/MutantEggroll on Reddit
-
Built withReddit
Built Lekh Unfiltered, a macOS app that abliterates Hugging Face models with Heretic in one click
The app searches and downloads models, runs Heretic with live output and installs Python dependencies in an isolated environment, so no terminal is needed.
By u/Living_Commercial_10 on Reddit
Real builds shared on X, Hacker News, Reddit, DEV and GitHub, summed up by Deduped from each post and its links; each card links to the original post. See what people are building with other repos
Quick start with Heretic
- Check you have what it needs: 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).
- Open p-e-w/heretic on GitHub and read the README and license.
- Prepare a Python 3.10+ environment with PyTorch 2.2+ installed for your hardware.
- Run
pip install -U heretic-llm. - Run
heretic Qwen/Qwen3-4B-Instruct-2507, replacing the model name with the model you want to decensor. - Wait for the run to finish. The README says a 4B model on an RTX 3090 takes about 20 to 30 minutes with the default configuration.
These steps come from our top use case, Remove refusals from an open model in one run, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for p-e-w/heretic
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forWritten for ML practitioners and local-model users who can run a Python command-line tool on a GPU machine.
- Why it is hot+1,314 stars this week, 36k total, picked up by one AI source we track
- LanguagePython
- Sourcegithub.com/p-e-w/heretic ยท Back to Hot repos
Requirements
- 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
Add this badge to your README
Maintain Heretic? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/p-e-w-heretic/?utm_source=github&utm_medium=badge&utm_campaign=p-e-w-heretic)
HTML
<a href="https://dedupedai.com/use-cases/p-e-w-heretic/?utm_source=github&utm_medium=badge&utm_campaign=p-e-w-heretic"><img src="https://dedupedai.com/badge/p-e-w/heretic.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Heretic
What is Heretic?
Heretic is a command-line tool that automatically removes safety alignment (censorship) from transformer language models using directional ablation tuned by Optuna. It is an open-source project on GitHub: https://github.com/p-e-w/heretic.
How do I use Heretic?
Prepare a Python 3.10+ environment with PyTorch 2.2+ installed for your hardware; then run pip install -U heretic-llm; run heretic Qwen/Qwen3-4B-Instruct-2507, replacing the model name with the model you want to decensor. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Heretic for?
Written for ML practitioners and local-model users who can run a Python command-line tool on a GPU machine.
What can I do with Heretic?
4 use cases so far, for example: Remove refusals from an open model in one run; Measure refusals and KL divergence against the original model; Decensor a larger model on a small GPU with 4-bit quantization. Each has steps and a copy-paste agent prompt.
What do I need to run Heretic?
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.
What are alternatives to Heretic?
Other hot AI repos in Research: Deep Tutor, Local Deep Research, Project Nomad, Nanochat, We Knora.
Is Heretic safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.