Skip to main content
For Truss Loops commands, see the Truss CLI reference or run baseten truss loops --help with your Baseten CLI credentials.

exec

Package the directory selected by --dir and run a Loops client as a managed training job. Pass the command to run after --. Everything after the delimiter is preserved verbatim. Baseten credentials are forwarded to Truss from the selected CLI profile. By default, Truss makes BASETEN_API_KEY available to the job from a per-team workspace secret, creating the credential and secret on first use when necessary. Pass --no-api-key to disable this behavior, or set BASETEN_API_KEY explicitly with --env or --secret. Pass --no-ssh to submit a job without an interactive SSH session. Otherwise, Training SSH must be enabled for the workspace. The command returns once the job is created. Pass --tail to stream logs to stderr; the job result stays on stdout. With --tail, the command exits nonzero if the job fails to deploy or execute. Ctrl+C stops watching without stopping the job. Resume with baseten train job logs --job-id <job-id> --tail.

Options

TEXT
GPU accelerator type. Omit for a CPU-only job. Supported hardware is documented at https://docs.baseten.co/training/concepts/basics.
INTEGER
default:"16"
Number of CPUs to request.
TEXT
required
Directory to upload and run the command from. Required; use ’.’ to select the current directory.
TEXT (repeatable)
Environment variable for the job as KEY=VALUE. Repeatable.
TEXT (repeatable)
Top-level directory of the workspace root to leave out of the upload. Repeatable.
TEXT (repeatable)
Directory outside —dir to include in the upload. Relative paths resolve from the caller’s current directory. Repeatable.
INTEGER
Number of GPUs, from 1 to 8. Requires —accelerator.
TEXT
Custom Docker base image.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"64Gi"
Memory to request, for example 8Gi.
BOOL
Do not provision BASETEN_API_KEY in the job from a per-team workspace secret.
BOOL
Do not create an interactive SSH session. The job can run without Training SSH enabled for the workspace.
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
Training project name. Defaults to the selected directory’s name.
TEXT (repeatable)
Environment variable sourced from a Baseten workspace secret as KEY=SECRET_NAME. Repeatable.
BOOL
Stream job logs to stderr until the job stops or you press Ctrl-C. Cannot be combined with —truss-no-forward-auth.
TEXT
Team name that owns the training project.
BOOL
Make uv available in the job image. The start command must invoke uv itself.
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 Python Loops client with uv
Run a client and follow its logs
Run a client on one H100 using a CUDA image with Python

Filter output with --jq

Print the created job ID

Output

Text mode (--output text): The created job’s ID, SSH hostname when enabled, and a command to follow its logs. JSON mode (--output json): payload type cmd.LoopsExecResult. The job ID, project, SSH hostname, start command, environment variable names, compute configuration, and job response.

usage

Report Loops GPU capacity, one row per trainer deployment plus a row for each standalone sampler. A summary above the table totals the GPUs in use and scaled to zero. Rows holding no live GPUs (scaled to zero, or in a terminal state) are counted in the summary but hidden unless you pass —all.

Options

BOOL
Include allocations holding no live GPUs (scaled to zero, or in a terminal state).
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
BOOL
Report usage across the organization, with each allocation’s owner, instead of only your own.
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
Only report allocations owned by this email. Implies —org.
BOOL
Enable verbose logging

Examples

Report your own Loops GPU usage
Report GPU usage across the organization, including idle allocations
Report GPU usage for one owner

Filter output with --jq

Print the total trainer GPUs in use

Output

Text mode (--output text): A summary line of trainer and sampler GPU totals, then a table with columns: RUN, OWNER (with —org), BASE MODEL, TRAINER GPU, TRAINER STATUS, SAMPLER GPU, SAMPLER STATUS, CREATED. JSON mode (--output json): payload type cmd.LoopsUsageResult. An object with the GPU summary and one entry per row, each carrying the trainer and sampler allocation and status.