Skip to content
m4bwav edited this page Nov 28, 2026 · 3 revisions

trainwright

trainwright is an agent plugin (Claude Code, Copilot, Codex, Cursor, Gemini CLI) for training your own models on a local GPU: image and video LoRAs (ai-toolkit, musubi-tuner, kohya), voice fine-tunes (VoxCPM) and small LLM fine-tunes (Unsloth, TRL QLoRA). Each run is kept as a JSON recipe you can rerun and compare.

The plugin is one skill and one script, skills/trainwright/scripts/tw.py. The script needs Python 3.9 or later and nothing outside the standard library; trainers run as subprocesses. Every verb prints JSON, and exit code 2 means a gate refused.

Where to go

What the README leaves out

  • tw.py new writes <name>.recipe.json, and config names its file after the recipe: my-style.ai-toolkit.yaml, not my-style.yaml (Getting started).
  • hash --manifest hashes caption .txt files as well as images, so a caption edit also counts as a dataset change (Commands).
  • check --shallow skips the dataset hash check, the GPU probe and the disk floor (Gates).
  • In 0.1.0, config --trainer kohya (or any trainer other than ai-toolkit) without --out overwrites the recipe (Known issues).

Clone this wiki locally