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.
--model-name
TEXT
Temporarily overrides the model name for this deployment without updating config.yaml.
--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.
--disable-truss-download
Disable downloading the Truss directory from the UI.
--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.
--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.
--tail
Stream deployment logs after push.
--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.
--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.In non-interactive contexts (CI runners, scripts, or any invocation with --non-interactive), Truss can’t prompt. If you belong to multiple teams and inference doesn’t resolve to a single team, truss push exits with Team selection required but running in a non-interactive context. Pass --team <name> to avoid the error. Requires Truss 0.18.3 or later.
The --team flag is only available if your organization has teams enabled. Contact us to enable teams, or see Teams for more information.
--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"}'
--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.
--no-cache
Force a full rebuild without using cached layers.
--watch-no-sleep
BOOLEAN
default:"true"
Keep the development model warm by preventing scale-to-zero while watching. Default is true. Requires --watch. To disable, pass --watch-no-sleep=false.
--output
text | json
default:"text"
Output format. json emits structured JSON to stdout and all other output (progress, logs) to stderr. Default is text.
--log
humanfriendly | W | WARNING | I | INFO | D | DEBUG
default:"humanfriendly"
Logging verbosity. humanfriendly (default) is pretty-printed; INFO, DEBUG, WARNING produce structured logs.
--non-interactive
Disable interactive prompts. Use in CI/automated contexts where stdin isn’t a TTY.
In non-interactive contexts like CI/CD, pass --team when your account has multiple teams. Without it, truss push exits with a UsageError that lists the available team names.
Each truss push --wait invocation polls GET /v1/models/{model_id}/deployments/{deployment_id} once per second until the deployment becomes active. Fanning out --wait from CI or a cron job multiplies that poll rate by the number of concurrent invocations.Past roughly 8 concurrent invocations, the combined poll rate trips per-organization rate limits or upstream WAF protections. The symptom is repeated Network error, unable to reach Baseten. Retrying... log lines or hung HTTP calls.For higher fan-out, drop --wait and poll deployment status yourself on a longer interval, or stagger the pushes.

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
}