predict.py
Development deployment
A development deployment is a mutable instance designed for rapid iteration. Create one withtruss push --watch (for models) or truss chains push --watch (for Chains). It stays in the development state until promoted and can’t be renamed.
Key characteristics:
- Live reload enables direct updates without redeployment.
- Single replica, scales to zero when idle to conserve compute resources.
- No autoscaling or zero-downtime updates.
- Can be promoted to create a persistent deployment.
Environments and promotion
Environments provide logical isolation for managing deployments but aren’t required for a deployment to function. You can run a deployment independently or promote it to an environment for controlled traffic allocation and scaling.- The production environment exists by default.
- Custom environments (for example, staging) can be created for specific workflows.
- Promoting a deployment doesn’t modify its behavior, only its routing and lifecycle management.
Rolling deployments
Rolling deployments replace replicas incrementally when promoting a deployment to an environment. Instead of swapping all traffic at once, rolling deployments scale up the candidate, shift traffic proportionally, and scale down the previous deployment in controlled steps. You can pause, resume, cancel, or force-complete a rolling deployment at any point. Rolling deployments are disabled by default; enable them per environment. For more information, see Rolling deployments.Canary deployments (deprecated)
Canary deployments support incremental traffic shifting to a new deployment in 10 evenly distributed stages over a configurable time window. Enable or cancel canary rollouts from the UI or REST API.Manage deployments
To scale, promote, deactivate, delete, or inspect deployments, see Manage deployments.Name deployments
By default, deployments of a model are nameddeployment-1,
deployment-2, and so forth sequentially.
To name a deployment:
Name it at deploy time with
truss push --deployment-name:
- Sign in to your workspace at app.baseten.co and choose Dedicated Inference in the sidebar.
- Select your model.
- Select the deployment under Deployments.
- Choose Rename deployment.
- Type the new name, then choose Rename deployment to confirm.
Label deployments
Labels are JSON key-value metadata you attach to a deployment to organize and track it, for example by team, environment, or the pipeline that created it. Set them at deploy time with the--labels flag on truss push (truss push --labels '{"team": "ml-platform", "env": "staging"}'), the labels argument to truss.push(), or the labels input on the deploy GitHub Action. To attach labels automatically in a CI pipeline, see Deploy with labels.
Deactivate a deployment
Deactivate a deployment to suspend inference while preserving its configuration; requests fail with a400 error until you activate it again.
To deactivate or activate, see
Manage the deployment lifecycle. For
demand-driven deployments, consider
scale to zero instead.
Delete deployments
Deletion is permanent: compute is released, requests return a404 error,
and the deployment leaves the dashboard (usage logs are retained). A
deployment that’s associated with an environment, or is the only deployment
of a model, can’t be deleted; promote a replacement first. To delete, see
Manage the deployment lifecycle.