Configuration Methods
Heretic supports multiple ways to configure its behavior, providing flexibility for different workflows:- CLI flags - Pass options directly on the command line
- Configuration files - Use TOML files for persistent settings
- Environment variables - Set options via
HERETIC_prefixed variables
- CLI flags (highest priority)
- Environment variables with
HERETIC_prefix - TOML configuration file
CLI flags will override any settings in your config file or environment variables.
Using Configuration Files
File Location and Naming
Heretic looks for a configuration file namedconfig.toml in the directory where you run the command. The configuration file uses the TOML format, which is human-readable and easy to edit.
Creating Your First Config File
Heretic includes a default configuration file that you can use as a starting point. Copy theconfig.default.toml from the repository and rename it to config.toml:
config.toml to customize the settings for your needs.
CLI Flags vs Config Files
When to Use CLI Flags
CLI flags are ideal for:- One-time adjustments - Testing different settings without modifying your config file
- Scripting - Automating heretic runs with different parameters
- Quick experiments - Trying out a single option change
When to Use Config Files
Configuration files are ideal for:- Consistent workflows - Maintaining standard settings across multiple runs
- Complex configurations - Managing many options at once
- Documentation - Keeping a record of settings that worked well
- Custom datasets - Configuring dataset specifications with all their options
Basic Configuration Example
Here’s a basic configuration that enables 4-bit quantization, uses a moderate batch size, and extends the response length:Configuration Sections
Heretic’s configuration is organized into logical sections:Model Loading
Configure dtypes, quantization, device mapping, and memory limits
Optimization
Control the optimization process, batch sizes, and abliteration parameters
Evaluation
Set up datasets, refusal markers, and evaluation prompts
Viewing All Options
To see all available configuration options and their descriptions:Option names in CLI flags use kebab-case (e.g.,
--max-response-length), while the same options in TOML files use snake_case (e.g., max_response_length).Environment Variables
You can also set configuration options using environment variables with theHERETIC_ prefix:
Environment variables use uppercase with underscores (e.g.,
HERETIC_MAX_RESPONSE_LENGTH).Example: Alternative Use Case
Heretic can also be configured to remove “slop” (purple prose and clichés) from creative writing models. Here’s an example based onconfig.noslop.toml:
Next Steps
Model Loading
Configure how models are loaded into memory
Optimization
Fine-tune the abliteration optimization process
Evaluation
Set up datasets and refusal detection
