SSH (Secure Shell) is a protocol for encrypted, authenticated access to a remote machine. With model deployments on Baseten, you can SSH into any running deployment and get a full terminal inside the model container to debug, inspect files, run commands, edit code, or transfer data withDocumentation Index
Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
Use this file to discover all available pages before exploring further.
scp and sftp. This gives you the same control you’d have on a local box, just running on Baseten-managed hardware.
Prerequisites
- 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: - 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
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.1. Set up your machine
Runuvx truss ssh setup once to configure OpenSSH:
ProxyCommand helper, and adds wildcard Host entries to ~/.ssh/config. You only need to do this once per machine.
The expected output is:
WARNING: Existing SSH keypair found at <path>, reusing it. You can safely ignore it.
2. Enable SSH and push
In your model’sconfig.yaml, add the runtime.remote_ssh block shown in Configuration, then push:
3. Connect
Once the deployment isACTIVE, SSH in with:
app user.
How it works
When you runssh model-<model_id>-<deployment_id>.ssh.baseten.co, Baseten authenticates you using the API key stored by uvx truss ssh setup, issues 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
| 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 |
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.
Targeting 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 pod — append a unique replica-name suffix to the hostname:File transfer
Usescp or sftp with the same hostname to transfer files:
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:
baseten-dev remote:
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.
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.