truss loops command provides subcommands for the Loops deployment lifecycle. Use it to run a Loops client on Baseten, push a run for a base model, inspect runs, report GPU usage, and deploy checkpoints.
exec
Run a Loops client from your current directory in a Baseten training job. Truss uploads the directory and runs the command that follows --. The job has 16 CPUs and 64 GiB of memory by default, and --accelerator selects the accelerator type.
Truss provides BASETEN_API_KEY from a per-team secret unless you set the variable with --env or --secret. Pass --no-api-key to run without a Baseten credential. The command returns after launching the job by default; pass --tail to stream its status and logs.
Arguments
Command to run in the training job. Place it after
--. Truss passes the command through unchanged and runs it after the job’s setup steps.Options
T4 | L4 | A10G | V100 | A100 | A100_40GB | H100 | H200 | H100_40GB | B200 | L40S | RTX_PRO_6000 | B300 | GB300 | TPU_V6E | TPU_V7
GPU accelerator type. Omit for a CPU-only job (the default).
Directory to upload instead of just the current directory. Must be a parent of the current directory.
Environment variable sourced from a Baseten workspace secret, as KEY=SECRET_NAME. Create secrets at https://app.baseten.co/settings/secrets. Repeatable.
Output format.
json emits structured JSON to stdout and sends progress and logs to stderr. Default is text.Set BASETEN_API_KEY in the job from a per-team secret, creating the key on first use. Pass —no-api-key for a job that should carry no credential.
Make uv available in the job image. Your command should invoke uv itself, e.g.
truss loops exec --with-uv -- uv run python my_client.py.Name of the team that owns the training project. If not specified, Truss uses the team configured for the remote in
.trussrc.Stream status + logs after push instead of returning immediately. With —tail, exec exits non-zero if the job fails.
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.push
Provision a Loops session, run, and paired sampler for a base model. If the project already has an active Loops deployment for the base model, the command fails with a validation error.
SDK scripts create their own runs. To check access without provisioning GPUs, see Check model access.
Arguments
Options
Number of data-parallel trainer replicas to provision. The trainer deployment runs this many copies of the base model’s preset node group (for example,
--replicas 4 on a 4-node preset provisions 16 nodes across 4 data-parallel workers). Must be a positive integer; defaults to 1.Number of replicas for the run’s paired sampler, applied as both its minimum and maximum. Must be at least 1. If omitted, the sampler uses the platform default. See Samplers.
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.deactivate
Deactivate a Loops run, tearing down both of its halves: the trainer and its paired sampler. Saved checkpoints remain accessible after deactivation. Identify the run with --run-id, using the run ID from truss loops view.
Arguments
Passing a Loops deployment ID as a positional argument is deprecated; use
--run-id instead.Options
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.view
List Loops runs. Each row is a single run, keyed by its run ID, with a run-level status. Lists your own runs by default; pass --org to list every run in your organization, which adds an Owner column to the output. The command hides inactive runs unless you pass --all.
Options
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.--reverse to show the most recent run first.
logs
Fetch logs for a Loops run. Identify the run with --run-id; by default this fetches the run’s trainer logs, and --sampler fetches the paired sampler’s logs instead. The two halves have separate log streams. Get run IDs from truss loops view.
Options
With —run-id, tail the paired sampler’s logs instead of the run’s trainer logs. The two halves have separate log streams.
Use —run-id to fetch the run’s trainer logs; this will be removed in a future release.
Use —run-id —sampler instead; this will be removed in a future release. Fetch logs from the sampler’s inference deployment by ID.
--loops-deployment-id and --sampler-deployment-id flags fetch logs by deployment ID instead; prefer --run-id.
usage
Report Loops GPU capacity, one row per deployment (keyed by its run). Org-wide by default; pass --mine for just your own deployments (which drops the Owner column) or --user to filter to a single owner. Each row shows the trainer and sampler GPU allocations and statuses, and a summary line above the table aggregates GPUs in use vs. scaled to zero. Standalone samplers (no trainer) appear as sampler-only rows.
The report shows what each deployment is running on (instance types and statuses), not your organization’s GPU quota.
By default the table lists only allocations holding live GPUs; the summary counts idle (scaled-to-zero) and terminal allocations, but the table hides them unless you pass --all.
Options
Example:runs view
List Loops runs visible to the caller. Both filters are optional and can be combined; omit both to list every run.
Options
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.samplers view
List Loops samplers visible to the caller.
Options
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.checkpoints view
List checkpoints for a Loops run. Identify the run with --run-id, or pass --base-model to pick the most recent run for that base model. The two filters are mutually exclusive.
Options
Base model name. Resolves to the most recent Loops run for that model. Mutually exclusive with
--run-id.Sort checkpoints by checkpoint ID, creation time, size, or type.
Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.checkpoints deploy
Deploy checkpoints from a Loops run as a vLLM-backed inference deployment. Identify checkpoints by name with --checkpoints (requires --run-id, since names are scoped per run) or by globally unique ID with --checkpoint-ids, or pass just --run-id to pick interactively.
Options
Loops run ID. Opens an interactive picker so you can choose checkpoints from the run. Cannot be combined with
--checkpoint-ids.Comma-separated Loops checkpoint names (e.g. step-50,step-100). Requires —run-id, since names are scoped per run. Bypasses the interactive picker. Use
truss loops checkpoints view to find names.Comma-separated Loops checkpoint IDs (for example,
vL3pQrS8,wK4tUvW9). Bypasses the interactive picker. Use truss loops checkpoints view to find IDs. Cannot be combined with --run-id or --config.Path to a Python file that defines a
DeployCheckpointsConfig. The config must populate checkpoint_details.loops_checkpoint_ids. Cannot be combined with --checkpoint-ids.Logging verbosity.
humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.Related
- Loops concepts: How sessions, runs, samplers, and checkpoints fit together.
- Loops supported models: Base models you can pass to
truss loops push. - Training SDK reference:
CheckpointListandDeployCheckpointsConfigPython types used with--config.