Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.baseten.co/llms.txt

Use this file to discover all available pages before exploring further.

truss push [OPTIONS] [TARGET_DIRECTORY]
Deploys a Truss to Baseten. By default, creates a published deployment.

Options

--config
PATH
Path to a custom config file. Defaults to config.yaml in the Truss directory.
--remote
TEXT
Name of the remote in .trussrc to push to.
In non-interactive mode (for example, in CI/CD), the command fails fast with a clear error if no remote is configured or if multiple remotes are available.
--watch
Create a development deployment, wait for it to deploy, then watch for source code changes and apply live patches. Use this for rapid iteration during development. Cannot be used with --promote or --environment.
--watch-hot-reload
Apply model code changes by swapping the model class in-process without restarting the inference server. Preserves in-memory state like loaded weights and caches, but does not re-run __init__() or load(). If your changes add new instance state that predict() depends on, do a full reload instead. Requires --watch. When re-attaching to an existing deployment with truss watch, use --hot-reload instead.
--watch-no-sleep
Keep the development model warm by preventing scale-to-zero while watching. Default is true. Requires --watch. To disable, pass --watch-no-sleep=false.
--publish
deprecated
Published is now the default behavior for truss push. Previously required to create a published deployment. If no production deployment exists, the first published deployment is automatically promoted to production.
--promote
Push as a published deployment and promote to production, even if a production deployment already exists.
--environment
TEXT
Push as a published deployment and promote into the specified environment. When specified, --promote is ignored.
--preserve-previous-production-deployment
Preserve the previous production deployment’s autoscaling settings. Can only be used with --promote.
--preserve-env-instance-type / --no-preserve-env-instance-type
When pushing to an environment, preserve the instance type configured in the environment instead of using the resources from the Truss config. Default: --preserve-env-instance-type. Ignored if --environment is not specified.
--model-name
TEXT
Temporarily overrides the model name for this deployment without updating config.yaml.
--deployment-name
TEXT
Name of the deployment. Only applies to published deployments (not development deployments created with --watch). Must contain only alphanumeric, ., -, or _ characters.
--wait / --no-wait
Wait for deployment to complete before returning. Returns non-zero exit code if deploy or build fails.
--tail
Stream deployment logs after push.
--labels
TEXT
Pass a JSON string with key-value pairs. This will be attached to the deployment and can be used for searching and filtering.
truss push --labels '{"env": "staging", "team": "ml-platform", "version": "1.2.0"}'
--timeout-seconds
INTEGER
Maximum time to wait for deployment status polling in seconds. Only applies when --wait is used. This is a client-side timeout for the polling loop. For a server-side deploy operation timeout, use --deploy-timeout-minutes.
--include-git-info
Attach git versioning info (sha, branch, tag) to the deployment. Can also be set permanently in .trussrc.
--disable-truss-download
Disable downloading the Truss directory from the UI.
--no-cache
Force a full rebuild without using cached layers.
--deploy-timeout-minutes
INTEGER
Timeout in minutes for the deploy operation.
--team
TEXT
Name of the team to deploy to. If not specified, Truss infers the team based on your team membership and existing models, or prompts for selection when ambiguous.
--output
TEXT
Output format. json emits structured JSON to stdout and all other output (progress, logs) to stderr. Default is text.
The --team flag is only available if your organization has teams enabled. Contact us to enable teams, or see Teams for more information.

Arguments

TARGET_DIRECTORY
TEXT
A Truss directory. Defaults to current directory.
Examples: Deploy a published deployment from the current directory:
truss push
You should see:
Deploying as a published deployment. Use --watch for a development deployment.
✨ Model my-model was successfully pushed ✨
🪵  View logs for your deployment at https://app.baseten.co/models/.../logs
Create a development deployment and start watching for changes:
truss push --watch
Deploy and promote to production:
truss push --promote
Deploy to a specific environment:
truss push --environment staging
Deploy with a custom deployment name:
truss push --deployment-name my-model_v1.0
Deploy with a custom config file:
truss push --config my-config.yaml
Deploy to a specific team:
truss push --team my-team-name
Deploy with JSON output:
truss push --output json
Returns:
{
  "model_id": "abc123",
  "model_version_id": "xyz789",
  "predict_url": "https://model-abc123.api.baseten.co/deployment/xyz789/predict",
  "logs_url": "https://app.baseten.co/models/abc123/logs/xyz789",
  "is_draft": false
}