Skip to main content

init

Create a training project directory, either empty from the built-in template or from one of the published training examples. This command needs no credentials: it only writes files, and the examples are downloaded from a public repository.

Options

TEXT
Directory to create. Defaults to ./truss-train-init for an empty project, or the current directory when examples are named.
TEXT (repeatable)
Name of a published training example to download instead of the empty template. Repeatable.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
BOOL
List the available example names and exit.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Run this truss executable instead of fetching one with uv, e.g. a virtualenv’s bin/truss. A value with no path separator is looked up on PATH, so ‘—truss-executable truss’ runs the truss you installed. Defaults to BASETEN_TRUSS_EXECUTABLE.
TEXT
Version of truss to fetch and run with ‘uv tool run’, e.g. 0.18.26. Defaults to BASETEN_TRUSS_VERSION, or the latest release. Mutually exclusive with —truss-executable.
BOOL
Enable verbose logging

Examples

Scaffold an empty training project
List the available examples
Download two examples into the current directory

Output

Text mode (--output text): A line per directory created, naming where it was written. With —list-examples, the available example names, one per line. JSON mode (--output json): payload type cmd.TrussDelegatedResult. Under —output json the text output goes to stderr and stdout is an empty object: this command reports nothing structured yet.

push

Create and start a training job, uploading the config file’s directory as the job’s code. The config is a Python file that defines the training project and its job, so it is executed rather than read. The flags below override what it declares. Returns once the job is created. Follow it with ‘baseten train job logs —job-id id —tail’.

Options

TEXT
Accelerator type and count, for example ‘H200:8’. Overrides the config.
TEXT
required
Python file defining the training project and its job.
TEXT
Command the job runs. Overrides the config.
TEXT
Start an interactive session on this trigger.One of: on-startup, on-failure, on-demand
TEXT
How long an interactive session stays up, as a duration (e.g. ‘90m’, ‘2h’). Rounded down to whole minutes; must be at least 1m.
TEXT
Name for the training job. Defaults to a generated name.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
INTEGER
Number of compute nodes. Overrides the config.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
INTEGER
Queue priority. Higher values are dequeued first.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Run on interruptible spot capacity, overriding the config. Checkpointing your own progress is up to you.
TEXT
Team name or ID that owns the training project.
TEXT
Run this truss executable instead of fetching one with uv, e.g. a virtualenv’s bin/truss. A value with no path separator is looked up on PATH, so ‘—truss-executable truss’ runs the truss you installed. Defaults to BASETEN_TRUSS_EXECUTABLE.
BOOL
Do not forward this CLI’s credentials to truss, leaving it to resolve a remote from your trussrc. Old truss versions ignore forwarded credentials and use the trussrc regardless.
TEXT
Version of truss to fetch and run with ‘uv tool run’, e.g. 0.18.26. Defaults to BASETEN_TRUSS_VERSION, or the latest release. Mutually exclusive with —truss-executable.
BOOL
Enable verbose logging

Examples

Run a training job from a config file
Run a named job on eight H200s over spot capacity
Run a job that opens an interactive session if it fails

Output

Text mode (--output text): A confirmation that the job was created, with its ID, the commands to follow it, and a link to it in the Baseten UI. JSON mode (--output json): payload type cmd.TrussDelegatedResult. Under —output json the text output goes to stderr and stdout is an empty object: this command reports nothing structured yet.