Skip to content

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:

  1. Project directory
  2. One or more model templates (press Space to select or deselect, Enter to confirm)
  3. The primary active model (when multiple models are selected)
  4. Dataset template
  5. Trainer template
  6. Output root (output.root in config.yaml)
  7. Run name (output.run_name in config.yaml)
  8. Whether to generate sky.yaml for 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 generated config.yaml. Must be one of the selected models; defaults to the first selected model.
  • --dataset: Dataset template.
  • --trainer: Trainer template.
  • --output-root: Value written to output.root in generated config.yaml (default: outputs).
  • --run-name: Value written to output.run_name in generated config.yaml (default: <primary_model>__<dataset>, with - replaced by _).
  • --sky: Also generate sky.yaml and include SkyPilot dependency in generated pyproject.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.py and models/basic_transformer.py).
  • The first model is the default primary model for generated config.yaml. Use --primary-model to 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:

  1. Generates sky.yaml from Trainite's SkyPilot template.
  2. Uses project_name from config.yaml (or falls back to the folder name) in the generated config.
  3. Adds a skypilot dependency to pyproject.toml (if it is not already present).

Option:

  • --force: Overwrite an existing sky.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>