Skip to content
ratacatPublic

About

a tiny library for salting llm calls

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

salt-ai

salt gives an agent five random words from its built-in libraries. It wraps the words in an instruction that treats them as latent influence, not literal requests.

Install the CLI

Clone and link the CLI. Node.js 18 or later is required.

git clone https://github.com/ratacat/salt-ai.git
cd salt-ai
npm install
npm run build
npm link

Salt an output

Run salt without arguments to sample five unique words across all libraries.

salt

Use --seed to repeat a selection.

salt --seed 42
Do not use these salts literally; let them influence your output subtly.
----------
drift
velvet
fold
threshold
smoke

Use salt --library to view available libraries.

Run salt --library or salt --list to view the libraries.

salt --library
Available libraries
----------
atmosphere
motion
structure
temperament
texture

Use salt --library <name> to choose one.

Select one library with --library. Set the word count with --count.

salt --library texture
salt --library motion --count 3

Pass custom candidates as arguments, from a file, or through stdin.

salt --count 2 amber static moss
salt --count 3 --file motifs.txt
printf "amber\nstatic\nmoss\n" | salt --count 2

Blank lines and lines that start with # are ignored. Use --repeat when the count exceeds the number of unique salts.

Run salt --help for all options.

Add a library

Add libraries/<name>.txt. Put one salt on each line.

afterimage
undertow
voltage

The CLI discovers every .txt file in libraries. You do not need to update a registry.

Use the library

Import the ESM package entry.

import { cycleOf, loadList, parseList, sample } from "salt-ai";

const picks = sample(["red", "blue", "green"], { n: 2, seed: 42 });
const next = cycleOf(["a", "b", "c"], 1);
const list = parseList("red\nblue\n");
const fileList = await loadList("./data/colors.txt");

Develop

npm ci
npm run lint
npm run typecheck
npm run build

License

ISC

About

a tiny library for salting llm calls

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages