Repository navigation
Getting Started
claude plugin marketplace add m4bwav/trainwright
claude plugin install trainwright@trainwrightThen ask your agent things like "train a style LoRA on this folder" or "redo that training run exactly", and the skill drives tw.py. You can also run the script yourself, as below. The walk-through was run on Windows with Python 3.14 against a stand-in base file and a two-image dataset; the training itself was not run (no trainer was installed for the test).
Facts about your machine live outside the repository, in the folder named by TRAINWRIGHT_HOME (default ~/.trainwright):
-
hosts.json:disk_floor_gb(default 100) andtrainers.<name>.pythonand.entryfor each trainerrunmay start. -
leak-terms.txt: one private term per line, fortw.py leak.
The walk-through used this hosts.json:
{"disk_floor_gb": 1, "trainers": {"ai-toolkit": {"python": "/opt/ai-toolkit/venv/bin/python", "entry": "/opt/ai-toolkit/run.py"}}}python tw.py new image-lora my-style{
"ok": true,
"recipe": "my-style.recipe.json",
"next": "fill base, dataset, then tw.py check"
}
A fresh skeleton fails check until the base and dataset are filled in:
python tw.py check my-style.recipe.json --shallow{
"ok": false,
"fail": [
"base.name is empty",
"base.path is empty",
"base.licence is empty",
"base.sha256 is empty (tw.py hash <file>)",
"dataset.items is empty (tw.py hash --manifest <folder> fills it)"
],
"warn": []
}
python tw.py hash base.safetensors
python tw.py hash datasets/my-style --manifest --source "own photos"Copy the base hash into base.sha256 and the manifest's items into dataset.items, set dataset.root, base.name, base.path and base.licence, and pick an empty output.dir. The output of both commands is on the Commands page.
python tw.py check my-style.recipe.json --shallow{
"ok": true,
"fail": [],
"warn": []
}
python tw.py config my-style.recipe.json --trainer ai-toolkit{
"ok": true,
"trainer": "ai-toolkit",
"config": "my-style.ai-toolkit.yaml",
"proven_on_real_trainer": true,
"note": null
}
python tw.py run my-style.recipe.json my-style.ai-toolkit.yaml --dryThe dry run prints the command it would start (the trainer's Python, its entry script and the config) along with the gate results, and starts nothing. Its full output is on the Commands page. A real run without --dry refuses when any gate fails, writes the trainer's output to my-style.recipe.log and appends the run to the recipe's runs list.
The skill's advice before a long run: a smoke run of a few steps on a copy of the recipe with a small config.steps, then the real run.
python tw.py record my-style.recipe.json --score style_match=0.82 --score "note=best at 300" --pick step_300 --files output/my-style/step_100.safetensors{
"ok": true,
"recipe": "my-style.recipe.json",
"still_missing": []
}
Next: Commands for rerun, diff and leak.
This wiki describes trainwright 0.1.0 and was last updated on 2026-11-19. The plugin is MIT licensed. Report problems in the issues.
Using it
The releases
Contributing
Elsewhere