LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

heretic

Modify a language model without training it

TLDR

Process a Hugging Face model
$ heretic [org/model-name]
copy
Load settings from a config file
$ heretic --config [path/to/config.toml] [org/model-name]
copy
Reproduce a published run
$ heretic --reproduce [path/to/reproduce.json]
copy

SYNOPSIS

heretic [options] [model]

DESCRIPTION

heretic steers an already trained language model by optimizing scores on contrasting prompts. It does not run a training job. The default configuration suppresses refusals. Other configs shipped with the project target slop, humor, sycophancy, emotional alignment, or shorter answers.The package name on PyPI is `heretic-llm`. The command it installs is heretic. A bare model id at the end of the command is read as --model. Settings come from the command line, then from `config.toml` in the working directory, then from the file named by the environment variable in Configuration.At the end of a run the program can save the result, upload it, chat with it, or run benchmarks. --quantization bnb_4bit loads the model in 4-bit so it fits in less memory.

PARAMETERS

--model id-or-path

Hugging Face model id, or a path to a model on disk. A final argument that does not start with `-` is treated as this option.
--config file
TOML settings file. The default file is `config.toml` in the current directory.
--quantization method
How to load weights. `bnb_4bit` uses bitsandbytes 4-bit quantization.
--reproduce file
Rebuild a model from a version-4 `reproduce.json` instead of searching for a new modification.
--collect-reproducibles directory
Download public `reproduce.json` files into a directory and exit.
--help
List configuration parameters. The same names are documented in `config.default.toml`.

CONFIGURATION

config.toml

Working-directory settings. Heretic 1.x files do not load in Heretic 2.x.
$ HERETIC_CONFIG_FILE
copy
Path of the TOML file to load. The variable must name a file that exists.
Environment variables with the `HERETIC_` prefix override fields. Boolean options accept an implicit flag, so `--print-debug-information` turns that setting on.

INSTALL

nix profile install nixpkgs#heretic
copy

CAVEATS

The upstream Git repository is archived. Install still comes from the `heretic-llm` package. The process needs a working PyTorch build for the machine's GPU or CPU, and enough memory for the chosen model. A `reproduce.json` from before the plugin format (version 4) is rejected.

SEE ALSO

RESOURCES

Copied to clipboard
Kai