scp and sftp. This gives you the same control you’d have on a local box, running on Baseten-managed hardware.
Prerequisites
Inference SSH must be enabled for your organization. Contact support to request access.
- Baseten account: Sign up and generate an API key.
-
uv: This guide uses
uvxto run Truss commands without a separate install step. Log in to Baseten:Terminal - OpenSSH client: Pre-installed on macOS and Linux. On Windows, use the OpenSSH optional feature or WSL.
Configuration
To enable SSH access on a deployment, setruntime.remote_ssh.enabled to true in your config.yaml:
config.yaml
Terminal
ACTIVE. Re-deploying without this field disables SSH for the new deployment.
SSH requires the default container user (
app, uid 60000). Setting docker_server.run_as_user_id to a different value is incompatible with SSH and the push will fail validation.Active SSH sessions don’t block scale-to-zero or scale-down. For longer interactive sessions, set a non-zero
min_replicas so your replica isn’t reclaimed mid-session.Quick start
This walkthrough pushes a small model with SSH enabled, then connects to it from your terminal.Set up your machine
Runuvx truss ssh setup once to configure OpenSSH:
Terminal
ProxyCommand helper, and adds wildcard Host entries to ~/.ssh/config. You only need to do this once per machine.
The expected output is:
Output
WARNING: Existing SSH keypair found at <path>, reusing it. You can safely ignore it.
Enable SSH and push
In your model’sconfig.yaml, add the runtime.remote_ssh block shown in Configuration, then push:
Terminal
Connect
Once the deployment isACTIVE, SSH in with:
Terminal
Terminal
app user.
How it works
When you runssh model-<model_id>-<deployment_id>.ssh.baseten.co, the proxy helper reads your API key from ~/.trussrc, calls Baseten’s signing API to issue a short-lived SSH certificate scoped to that deployment, and routes the connection to a running replica’s container. Certificates refresh automatically on every connection, so you never need to manage keys or tokens manually. Authorization uses your existing model permissions, so only users who can manage the model can SSH into it.
Hostname format
Hostname
| Segment | Description | Example |
|---|---|---|
model_id | Model ID (8 lowercase alphanumeric characters). Find it in the deployment URL or with the Baseten CLI. | abc12345 |
deployment_id | Deployment ID (7 lowercase alphanumeric characters). Each new push creates a new deployment. | def4567 |
replica_id | Optional. Suffix that uniquely identifies one replica when the deployment has multiple. | xyz9a |
Terminal
IDE integration
Becauseuvx truss ssh setup configures standard OpenSSH, tools that speak SSH can connect with the same hostname:
- VS Code: Install the Remote - SSH extension, then connect to
model-<model_id>-<deployment_id>.ssh.baseten.co. - Cursor: Use the built-in SSH remote feature with
model-<model_id>-<deployment_id>.ssh.baseten.co.
Target a specific replica
Deployments with autoscaling can have many replicas. By default, Baseten routes your SSH session to one running replica. To pin to a specific replica (useful when reproducing a bug that only appears on one replica), append a unique replica-name suffix to the hostname:Terminal
File transfer
Usescp or sftp with the same hostname to transfer files:
Terminal
Multiple remotes
If you only have one remote configured in~/.trussrc, you can skip this section. Baseten uses it automatically.
If you have multiple remotes, include the remote name in the hostname so the proxy script knows which credentials to use:
Hostname
baseten-dev remote:
Terminal
Troubleshooting
”SSH is not enabled for this deployment”
The deployment was pushed withoutruntime.remote_ssh.enabled: true. Add it to config.yaml and re-push to create a new deployment with SSH enabled. Existing deployments cannot be changed in place.
”SSH keypair not found” or “command not found”
Runuvx truss ssh setup to configure your machine.
”No api_key for remote”
Truss 0.17.2 and later store your API key in your operating system’s keyring aftertruss login, but the SSH proxy reads it from ~/.trussrc. Log in with the keyring disabled so the key stays in ~/.trussrc:
Terminal
Connection refused or deployment unreachable
SSH requires the deployment to be in theACTIVE state with at least one running replica. If the deployment is scaled to zero, send a request to wake it, or set a non-zero min_replicas while debugging. Confirm the deployment status in the Baseten dashboard.
TLS errors
The proxy script requires Python 3.10 or newer. If you see TLS errors, re-run setup with a newer Python interpreter:Terminal