anicka-net/teapot

Compose LLM training data from modules — with license filtering, provenance, and eval gates

0

stars

91

commits

Python

primary language

Aug 29, 2026

updated

README

Teapot

make menuconfig for LLM training.

You pick the modules. Teapot composes the training data, filters by license, tracks provenance, validates the result, and generates an SBOM. Same config, same model. Every time.

The Problem

Training an LLM today means: pick datasets ad hoc, write custom glue scripts, hope the chat template is right, pray that the license situation is clean, and discover 40 hours into a training run that something was wrong from the start.

There's no ./configure && make for training data.

The Solution

pip install -e .
teapot compose configs/my-model.config --lock
teapot validate compose train.jsonl
teapot train configs/my-model.config --train-data train.jsonl --backend unsloth
teapot eval configs/my-model.config --tier standard
teapot sbom train.manifest.json

A config file declares what goes into your model:

base:
  model: meta-llama/Llama-3.1-8B-Instruct
  method: qlora

modules:
  safety/consequence: true       # ethical reasoning
  capability/tool-use: true      # function calling

license:
  allowed: [Apache-2.0, MIT]     # only these licenses in training data

training:
  epochs: 3
  chat_template: auto            # or: apertus-think, chatml, llama3
  weights:
    safety/consequence: 1.0
    capability/tool-use: 0.5

Teapot handles the rest: fetch data, apply chat template, filter by license, weight and merge, validate format and tokens, generate framework config, run eval gates, produce SBOM. Deterministic and reproducible.

What's a Module?

A module wraps a curated dataset with metadata:

modules/safety/consequence/
├── module.yaml      # what it is, what it needs, how to test it
├── prepare.py       # how to get the data
├── curations/       # reviewed dataset selection decisions
└── eval/            # how to verify the model learned it

See docs/MODULES.md for the full list and creation guide.

ModuleExamplesWhat it teaches
safety/consequence3,196KE secular consequence reasoning core
safety/consequence-aegisHF-backedConsequence-style responses on Aegis prompts
safety/kagyu620Karma Kagyu contemplative ethics extension
safety/ke-thinking1,250KE voice and baked-in ethical thinking traces
capability/tool-use5,000Call functions, decide when not to
capability/reward-evaluator503Score responses on 6 dimensions for reward models
domain/cve-backport36,168Generate security patches from CVEs
domain/upstream-thinking26,929Stage-1 Apertus thinking traces from HF-backed reasoning data
lang/dzongkha28Dzongkha language identification (seed)

Pipeline

configure → compose → lock → validate → train → eval → sbom
CommandWhat it does
teapot configureInteractive config (guided, show, or agent JSON mode)
teapot composeMerge modules into training JSONL + manifest
teapot lockPin source hashes for reproducibility
teapot validateCheck format, content, chat template, determinism
teapot trainGenerate launch script for training backend
teapot evalRun module-declared eval gates (including Garak)
teapot sbomGenerate SPDX 3.0 AI Profile provenance document
teapot sourcesShow data source resolution status
teapot hardwareDetect GPUs, suggest training parameters
teapot curateManage versioned dataset selection decisions

Training Backends

BackendCommandUse case
Unsloth--backend unslothFast QLoRA/LoRA/full with preflight hardware checks
HF QLoRA--backend qlora-hfStandard QLoRA via HF Trainer
HF Full--backend full-hfFull fine-tune, DeepSpeed ZeRO-3
Axolotl--backend axolotlFeature-rich, YAML config

Chat Templates

Teapot applies owned chat templates at compose time, ensuring the training artifact itself matches the model's native token format. Formatted examples include text plus assistant_spans, and training backends consume that bundle without re-templating. Templates are verified before training starts; mismatched special tokens fail fast.

TemplateModelTokens
autoAnyPreserve canonical conversations, let backend format
apertus-thinkApertusNative tokens + <|inner_prefix|> deliberation
apertus-fullApertusNative + deliberation + tools
chatmlMistral, etc.<|im_start|> / <|im_end|>
llama3Llama 3.x<|start_header_id|> / <|eot_id|>

Data Sources

Modules declare what data they need. You declare where it lives:

# Show resolution status
teapot sources --list

# Configure local paths (gitignored, per-developer)
cp teapot.sources.yaml.example teapot.sources.yaml
# Edit paths for your setup

Resolution chain: CLI override → env var → source map → module defaults.

Curation Cache

Dataset review decisions are versioned artifacts, not ephemeral LLM conversations:

teapot curate list                         # show cached decisions
teapot curate create --module safety/consequence --version v1 \
    --scorer "sonnet+human" --input decisions.jsonl --publish

Published curations ship with the module. Local curations are gitignored experiments. Compose applies curations only when the config names an explicit ref like published:v1 or local:v1.

Tools

Post-training analysis and model surgery:

  • activation-geometry — measure safety/compassion axes across models
  • h-neurons — find where safety lives in the network
  • activation-capping — steer models at inference time
  • abliteration — remove refusal directions
  • redteam — analyze eval failures via uncensored local model

All tools accept external config files — no hardcoded prompts. See tools/README.md.

Why This Exists

Training data is not neutral. Every example teaches a model what to value. This project makes that visible and configurable — so you know exactly what went into your model, under what license, and whether it passed its tests.

See ETHICS.md for the full position.

Status

Early development. The pipeline works end-to-end — we've trained 8B and 70B models through it. Install with pip install -e .

Documentation

License

Apache 2.0

Contributors

anicka-net

91 commits

anicka-net/teapot

Compose LLM training data from modules — with license filtering, provenance, and eval gates

0

stars

91

commits

Python

primary language

Aug 29, 2026

updated

README

Teapot

make menuconfig for LLM training.

You pick the modules. Teapot composes the training data, filters by license, tracks provenance, validates the result, and generates an SBOM. Same config, same model. Every time.

The Problem

Training an LLM today means: pick datasets ad hoc, write custom glue scripts, hope the chat template is right, pray that the license situation is clean, and discover 40 hours into a training run that something was wrong from the start.

There's no ./configure && make for training data.

The Solution

pip install -e .
teapot compose configs/my-model.config --lock
teapot validate compose train.jsonl
teapot train configs/my-model.config --train-data train.jsonl --backend unsloth
teapot eval configs/my-model.config --tier standard
teapot sbom train.manifest.json

A config file declares what goes into your model:

base:
  model: meta-llama/Llama-3.1-8B-Instruct
  method: qlora

modules:
  safety/consequence: true       # ethical reasoning
  capability/tool-use: true      # function calling

license:
  allowed: [Apache-2.0, MIT]     # only these licenses in training data

training:
  epochs: 3
  chat_template: auto            # or: apertus-think, chatml, llama3
  weights:
    safety/consequence: 1.0
    capability/tool-use: 0.5

Teapot handles the rest: fetch data, apply chat template, filter by license, weight and merge, validate format and tokens, generate framework config, run eval gates, produce SBOM. Deterministic and reproducible.

What's a Module?

A module wraps a curated dataset with metadata:

modules/safety/consequence/
├── module.yaml      # what it is, what it needs, how to test it
├── prepare.py       # how to get the data
├── curations/       # reviewed dataset selection decisions
└── eval/            # how to verify the model learned it

See docs/MODULES.md for the full list and creation guide.

ModuleExamplesWhat it teaches
safety/consequence3,196KE secular consequence reasoning core
safety/consequence-aegisHF-backedConsequence-style responses on Aegis prompts
safety/kagyu620Karma Kagyu contemplative ethics extension
safety/ke-thinking1,250KE voice and baked-in ethical thinking traces
capability/tool-use5,000Call functions, decide when not to
capability/reward-evaluator503Score responses on 6 dimensions for reward models
domain/cve-backport36,168Generate security patches from CVEs
domain/upstream-thinking26,929Stage-1 Apertus thinking traces from HF-backed reasoning data
lang/dzongkha28Dzongkha language identification (seed)

Pipeline

configure → compose → lock → validate → train → eval → sbom
CommandWhat it does
teapot configureInteractive config (guided, show, or agent JSON mode)
teapot composeMerge modules into training JSONL + manifest
teapot lockPin source hashes for reproducibility
teapot validateCheck format, content, chat template, determinism
teapot trainGenerate launch script for training backend
teapot evalRun module-declared eval gates (including Garak)
teapot sbomGenerate SPDX 3.0 AI Profile provenance document
teapot sourcesShow data source resolution status
teapot hardwareDetect GPUs, suggest training parameters
teapot curateManage versioned dataset selection decisions

Training Backends

BackendCommandUse case
Unsloth--backend unslothFast QLoRA/LoRA/full with preflight hardware checks
HF QLoRA--backend qlora-hfStandard QLoRA via HF Trainer
HF Full--backend full-hfFull fine-tune, DeepSpeed ZeRO-3
Axolotl--backend axolotlFeature-rich, YAML config

Chat Templates

Teapot applies owned chat templates at compose time, ensuring the training artifact itself matches the model's native token format. Formatted examples include text plus assistant_spans, and training backends consume that bundle without re-templating. Templates are verified before training starts; mismatched special tokens fail fast.

TemplateModelTokens
autoAnyPreserve canonical conversations, let backend format
apertus-thinkApertusNative tokens + <|inner_prefix|> deliberation
apertus-fullApertusNative + deliberation + tools
chatmlMistral, etc.<|im_start|> / <|im_end|>
llama3Llama 3.x<|start_header_id|> / <|eot_id|>

Data Sources

Modules declare what data they need. You declare where it lives:

# Show resolution status
teapot sources --list

# Configure local paths (gitignored, per-developer)
cp teapot.sources.yaml.example teapot.sources.yaml
# Edit paths for your setup

Resolution chain: CLI override → env var → source map → module defaults.

Curation Cache

Dataset review decisions are versioned artifacts, not ephemeral LLM conversations:

teapot curate list                         # show cached decisions
teapot curate create --module safety/consequence --version v1 \
    --scorer "sonnet+human" --input decisions.jsonl --publish

Published curations ship with the module. Local curations are gitignored experiments. Compose applies curations only when the config names an explicit ref like published:v1 or local:v1.

Tools

Post-training analysis and model surgery:

  • activation-geometry — measure safety/compassion axes across models
  • h-neurons — find where safety lives in the network
  • activation-capping — steer models at inference time
  • abliteration — remove refusal directions
  • redteam — analyze eval failures via uncensored local model

All tools accept external config files — no hardcoded prompts. See tools/README.md.

Why This Exists

Training data is not neutral. Every example teaches a model what to value. This project makes that visible and configurable — so you know exactly what went into your model, under what license, and whether it passed its tests.

See ETHICS.md for the full position.

Status

Early development. The pipeline works end-to-end — we've trained 8B and 70B models through it. Install with pip install -e .

Documentation

License

Apache 2.0

Contributors

anicka-net

91 commits

Languages

Python

99.4%