Skip to main content
An interactive session keeps a training container available for SSH or a VS Code or Cursor remote tunnel. The session activates according to its trigger mode and expires when its timeout runs out.

Prerequisites

Check session status

To see each replica’s live session, auth URL, and expiry, run:
The command prints one row per replica, with the columns REPLICA, SESSION, AUTH URL, and EXPIRES. EXPIRES stays empty until the tunnel authenticates. If no session is live, it prints No interactive sessions found. To print each replica’s auth code as well, run:
The command lists remote tunnel sessions only. An SSH session doesn’t appear in it, even while you’re connected; to check an SSH session, connect to it.

Session expiry

A session expires timeout_minutes after it starts. The default is 480 minutes, or 8 hours. To choose the length before you push the job, set timeout_minutes on the job’s InteractiveSession; see Configure an interactive session for the CLI and SDK examples. Set it to -1 to extend the expiry to 10 years. baseten train workstation create sets neither, so a workstation’s session uses the default. How the expiry behaves depends on the session type: When the expiry passes, Baseten signals the container to shut down gracefully, and you lose everything in the container’s local filesystem. Where your work survives depends on the job’s configuration: a job with cache_config enabled has $BT_PROJECT_CACHE_DIR, and a job with checkpointing enabled has $BT_CHECKPOINT_DIR, which Baseten syncs to storage. A job with neither has no persistent directory in the container, so copy out the files you want to keep before the expiry.

Change the session trigger

The Baseten CLI has no command that changes a session’s trigger or timeout. The commands on this page with the baseten truss prefix run the Truss CLI with your Baseten CLI login. These commands reach remote tunnel sessions only. For a job with an SSH session, they print No auth codes found for this job. To change the trigger on a running job, for example to activate an on_demand session, run:
The command prints ✓ Successfully updated 1 session(s) when it changes the session. You can’t change the trigger of an on_startup session.

Extend a session

To add minutes to a remote tunnel session’s expiry, run:
The command adds 120 minutes to the expiry and prints ✓ Successfully updated 1 session(s). Baseten sets an SSH session’s expiry when the session starts, so set timeout_minutes before you push the job instead; see Session expiry.

Next steps