CLI Guide
Trainite exposes a small command-line interface for scaffolding and extending standalone training projects.
For project structure and first-run setup, see Home.
For config.yaml details and training behavior, see Training Guide.
Command summary
trainite [--help] [--version|-V]
trainite init [PROJECT_DIR] [OPTIONS]
trainite add:sky [--force]
Global flags
--help: Show available subcommands and command-specific usage.--version/-V: Print the Trainite version and repository URL.
Examples:
trainite --help
trainite --version
trainite -V
trainite init
Generate a starter training project with local copies of model, dataset, trainer, and config code.
Interactive mode
Run with no additional arguments:
trainite init
You will be prompted for:
- Project directory
- One or more model templates (press Space to select or deselect, Enter to confirm)
- The primary active model (when multiple models are selected)
- Dataset template
- Trainer template
- Output root (
output.rootinconfig.yaml) - Run name (
output.run_nameinconfig.yaml) - Whether to generate
sky.yamlfor SkyPilot
Non-interactive mode
Pass all options directly:
trainite init my-experiment \
--model rope-transformer basic-transformer \
--primary-model basic-transformer \
--dataset string-reverse \
--trainer decoder-trainer \
--output-root outputs \
--run-name rope_vs_basic \
--sky
Options
PROJECT_DIR(positional): Output directory for the generated project (default:my-cool-experiment).--model: One or more model templates. At least one is required.--primary-model: Active model in generatedconfig.yaml. Must be one of the selected models; defaults to the first selected model.--dataset: Dataset template.--trainer: Trainer template.--output-root: Value written tooutput.rootin generatedconfig.yaml(default:outputs).--run-name: Value written tooutput.run_namein generatedconfig.yaml(default:<primary_model>__<dataset>, with-replaced by_).--sky: Also generatesky.yamland include SkyPilot dependency in generatedpyproject.toml.--force: Overwrite starter files in a non-empty existing directory.
Available template choices:
- Models:
rope-transformer,basic-transformer - Datasets:
string-reverse,counting,hugging-face,wikitext,ultrachat-200k,python-edu - Trainers:
decoder-trainer
Multi-model scaffolding
You can pass multiple models in a single --model flag:
trainite init my-experiment \
--model rope-transformer basic-transformer \
--dataset counting \
--trainer decoder-trainer
When multiple models are selected:
- Trainite scaffolds each model template into
models/(for example,models/rope_transformer.pyandmodels/basic_transformer.py). - The first model is the default primary model for generated
config.yaml. Use--primary-modelto choose a different selected model without changing the model list order. - In interactive mode, use Space to select or deselect multiple checkboxes, and press Enter to confirm. Trainite then asks which selected model should be the primary active model in
config.yaml.
trainite add:sky
Enable SkyPilot support in an existing Trainite-generated project.
Run this command from your project directory (the one containing config.yaml and main.py):
cd my-experiment
trainite add:sky
What it does:
- Generates
sky.yamlfrom Trainite's SkyPilot template. - Uses
project_namefromconfig.yaml(or falls back to the folder name) in the generated config. - Adds a
skypilotdependency topyproject.toml(if it is not already present).
Option:
--force: Overwrite an existingsky.yaml.
If config.yaml or main.py is missing, the command exits with an error and asks you to run it from a valid Trainite experiment directory.
Quickstart with SkyPilot
Once sky.yaml is generated (via trainite init --sky or trainite add:sky), launch and manage your cloud training runs using standard SkyPilot commands:
# 1. Verify cloud provider access (AWS, GCP, Azure, Lambda, etc.)
sky check
# 2. Launch the experiment
sky launch sky.yaml
# 3. Monitor active runs and view live training logs
sky queue
sky logs <cluster_name>
# 4. Tear down the cluster when training finishes
sky down <cluster_name>