Heretic: Automatic language model censorship removal
Tool that removes safety alignment from transformer language models using directional ablation without post-training.
Learn more about Heretic
Heretic is a tool that removes censorship (safety alignment) from transformer-based language models without requiring expensive post-training procedures. It implements directional ablation (abliteration) combined with a TPE-based parameter optimizer powered by Optuna to automatically find optimal parameters. The system co-minimizes refusal rates and KL divergence from the original model to preserve intelligence while removing safety constraints. It supports most dense models including multimodal architectures and several MoE variants.
Fully Automatic
Requires no manual parameter tuning or understanding of transformer internals. Uses TPE optimization to automatically find optimal abliteration parameters.
Intelligence Preservation
Co-minimizes KL divergence from the original model while removing refusals, maintaining model capabilities better than manual approaches.
Research Features
Includes interpretability tools like residual vector visualization and PaCMAP projections for analyzing model internals and ablation effects.
pip install -U heretic-llm
heretic Qwen/Qwen3-4B-Instruct-2507v1.2.0: @noctrex added a `max_memory` setting to limit memory usage in
- –@noctrex added a `max_memory` setting to limit memory usage in
- –@spikymoth added a mechanism to avoid excessive low-divergence iteration in
- –@accemlcc implemented a new LoRA-based abliteration engine with support for 4-bit quantization in
- –@accemlcc added enumeration of all available GPUs on startup in
- –@Vinayyyy7 added the ability to run more trials after optimization is complete in
v1.1.0: @mbarnson added basic MPS (Apple Silicon) support in
- –@mbarnson added basic MPS (Apple Silicon) support in
- –@red40maxxer reduced memory usage in
- –@Ooooze added IBM Granite MoE support in
- –@kldzj added multi-GPU support in and
- –@ricyoung fixed an error when Hugging Face user profile fields are missing in
See how people are using Heretic
Top in AI & ML
Related Repositories
Discover similar tools and frameworks used by developers
DALL-E
Official PyTorch package implementing the discrete VAE component for image tokenization used in OpenAI's DALL-E system.
Crawl4AI
Async browser automation extracting web content for LLMs.
DeepSeek Coder
Code language models (1B-33B parameters) supporting completion and infilling across 80+ languages.
ControlNet
Dual-branch architecture for conditional diffusion model control.
Rowboat
Open-source AI assistant that builds a knowledge graph from emails and meetings to help with work tasks.
Related Reading
Guides and comparisons from the Greptile content library
What Is Code Review? (And How to Keep It From Becoming the Bottleneck)
What code review is, how traditional, automated, and AI code review differ, and why review is now the bottleneck as AI writes more code. Plus how to pick a code review tool that catches real bugs.
Best AI Code Review Tools for GitLab
Enterprise-grade AI code review tools for GitLab teams. In-depth comparison of accuracy, security, and integration features to accelerate your merge request workflows.
What is Shift Left Testing? Everything Engineering Leaders Need to Know
The five types of shift-left testing, the benefits and limitations of each, and how the approach changes when agents write and review a growing share of your code.
Best SAST Tools for Engineering Teams [2026 Review]
We compare five of the best SAST tools (Semgrep, Checkmarx One, Snyk, Aikido, and GitHub CodeQL) on core functionality, languages, pricing, and fit, plus why static scanning needs runtime testing and full-codebase review alongside it.