Skip to content

Advanced

Command-line tool

Installing pytrio provides the trio command for login configuration and for querying or managing models, checkpoints, files, and batch inference jobs. For full options and subcommand specifications, see the CLI reference in the API tab.

bash
trio --help
trio --version

-h is an alias for --help, and -V is an alias for --version. Running bare trio prints the current SDK version followed by root-command help.

Login and profiles ​

bash
trio login
trio status
trio logout

trio profile list
trio profile show
trio profile use dev --base-url https://pytrio.com
trio profile remove dev
  • login verifies credentials and saves them to the current profile after confirmation. Automation can use --api-key and --yes.
  • status only verifies current credentials and displays the user, workspace, and profile. It does not create a ServiceSession or print the API key.
  • logout removes credentials saved in the current profile.
  • profile use switches to an existing profile or creates/updates a named profile. default and (default) select the default profile.
  • profile list and profile show only inspect local configuration. Use status to verify that credentials remain valid.

trio auth login|logout|status|profile are the full forms of the corresponding top-level commands. v0.2.11 removes the old trio env command; use trio profile instead. Existing configuration, pytrio.configure(env=...), and PYTRIO_ENV continue to work.

For non-interactive login:

bash
PYTRIO_API_KEY="$TRIO_KEY" trio login --yes

If input or confirmation is required without an interactive terminal, the command exits with status 2. Authentication, network, and server-operation failures exit with status 1.

Output formats ​

Query commands use tables by default. Select JSON or CSV before the subcommand (see trio for details):

bash
trio --format json status
trio --format csv model list
trio --format json checkpoint list

Machine-readable results go to stdout; diagnostics, notices, and pagination hints go to stderr. Action commands such as login, download, and delete use text output only.

Models ​

bash
trio model list
trio model ls --name qwen
trio --format json models

The command lists models available in the current environment, their maximum context length, and training and sampling capabilities. model ls and models alias model list. --name performs a case-insensitive substring match on model IDs. The query verifies credentials and SDK compatibility without creating a ServiceSession. See trio model for full details.

Checkpoints ​

bash
trio checkpoint list --limit 20
trio checkpoint list --run-id RUN_ID
trio checkpoint info CHECKPOINT_ID
trio checkpoint download CHECKPOINT_ID -o ./downloads/state.tar
trio checkpoint delete CHECKPOINT_ID --yes

checkpoint can be shortened to ckpt, list to ls, and delete to rm.

  • list displays checkpoints grouped by training run for the current workspace. --limit accepts 1–100 and --offset defaults to 0.
  • info returns checkpoint details and a summary of the source training run.
  • download defaults to <CHECKPOINT_ID>.tar. If the destination exists, it appends an incrementing number and prints the actual path only after the full download is published.
  • delete removes one checkpoint at a time. Non-interactive calls must pass --yes explicitly.

See trio checkpoint for the full subcommand reference.

Files ​

bash
trio file upload requests.jsonl
trio file list --limit 20
trio file list --all
trio file info FILE_ID
trio file download FILE_ID -o ./downloads/requests.jsonl
trio file delete FILE_ID --yes

The file_id returned after upload can be used for batch inference. Lists show up to 20 items by default; --all retrieves every page. Downloads append an incrementing number on name collisions and print the actual path. A file still used by a job cannot be deleted. See trio file for the full subcommand reference.

Batch inference ​

bash
trio batch create FILE_ID
trio batch create --file requests.jsonl --completion-window 24h --description "nightly evaluation"
trio batch list --limit 20
trio batch list --all
trio batch info BATCH_ID
trio batch download BATCH_ID -o ./results
trio batch cancel BATCH_ID --yes

batch create FILE_ID uses a published file; --file uploads a local file before submitting the job. Use --completion-window to set the completion window and --description to add a description. batch download saves published output and error JSONL files to the selected directory. If one result download fails, files already saved remain in place. Cancellation asks for confirmation on an interactive terminal; non-interactive calls must pass --yes. See trio batch for the full subcommand reference.

For the corresponding Python file, batch, and checkpoint operations, see RestClient.