p-e-w /heretic

Training-free language model modification: Remove censorship, suppress slop, reduce sycophancy, and more

★ 40,179⑂ 4,599👁 204⑃ 295● 235▤ 7◈ 12
PythonAGPL-3.0Created 2025-09-21heretic-project.org
40,179
stars
+104
4,599
forks
204
watchers
295
prs
235
issues
7
releases
12
discussions

README

Heretic

 Training-free language model modification

Remove censorship, suppress slop, reduce sycophancy, and more.
All in an afternoon, on your gaming PC.

    
   
   




-----

 

    



 Modify any LLM that you can run on your hardware[^1]

[^1]: Heretic supports on-the-fly 4-bit model quantization with bitsandbytes,
which can reduce the amount of VRAM required to process a model to the same amount
that is used to run a typical quantized version of it, at a slight accuracy cost.
Set the quantization option to bnb_4bit to enable this.

Heretic is a unique tool that lets you do what only corporations with access
to massive computing power usually do: Modify, rather than merely run,
language models. It does not perform expensive training; rather, it uses
a collection of mathematical techniques to steer behavior based on contrasting
example prompts and matching scorers.

Heretic can, depending on the configuration:

 Suppress refusals/remove censorship (this is the default action)
 Reduce slop (config.noslop.toml)
 Reduce humor (config.nohumor.toml)
 Reduce sycophancy (config.nosyco.toml)
 Alter emotional alignment (config.emotions.toml)
 Shorten response length (config.terse.toml)

and many, many other things.

 :bangbang: Using Heretic does NOT require understanding how language models work internally :bangbang:

In fact, you can go from zero to removing censorship from your first model
in a matter of seconds. Heretic supports most dense models, including
many multimodal models, several different MoE architectures, and many modern
hybrid models.

The community has created and published
thousands
of models with Heretic.
Heretic models have been independently benchmarked using standard metrics
like MMLU and GSM8K, and have been found to compare favorably against models
produced with competing abliteration tools.[^2][^3]

[^2]: Qwen2.5-7B: Three-Way Abliteration Comparison: "Heretic is the most surgical and most effective."
[^3]: Gemma 4 E4B: 23 Abliteration Variants Compared: "Best overall: heretic."

 



 


 Usage

Prepare a Python 3.10+ environment with PyTorch 2.6+ installed as appropriate
for your hardware. Then run:

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


Replace Qwen/Qwen3-4B-Instruct-2507 with whatever model you want to process.
By default, Heretic performs censorship removal (refusal suppression).
If you want to do something else, choose one of the configuration files linked
above, or write your own. See config.default.toml
for available configuration options. Heretic loads the configuration from
config.toml in the working directory by default, or from the file path in the
HERETIC_CONFIG_FILE environment variable.

 [!IMPORTANT]

 Configuration files made for Heretic 1.x are not compatible with Heretic 2.x!
 See the migration guide for what you need to change
 in order to make your old configurations work.

At the start of

Top issues

Discussions

Latest release

v2.1.0 v2.1.0 2026-11-08
Changes
 chore: bump version to 2.1.0.dev0 by @p-e-w in https://github.com/p-e-w/heretic/pull/558
 feat: allow specifying a custom config file path by @dreamfast in https://github.com/p-e-w/heretic/pull/557
 feat: add response length scorer by @p-e-w in https://github.com/p-e-w/heretic/pull/562
 fix: enforce memory residency for all model tensors by @p-e-w in https://github.com/p-e-w/heretic/pull/564
 fix: prevent errors during model reset from interrupting export by @p-e-w in https://github.com/p-e-w/heretic/pull/565
 perf: disable KV cache when obtaining module I/O by @p-e-w in https:/

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON