> ## 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

> Deploy a model to Baseten.

```sh theme={"system"}
truss push [OPTIONS] [TARGET_DIRECTORY]
```

Deploys a Truss to Baseten. By default, creates a published deployment.

### Options

{/* autogenerated by bin/generate_cli_docs.py for truss==0.18.2; do not edit */}}

<ParamField body="--config" type="PATH">
  Path to a custom config file. Defaults to `config.yaml` in the Truss directory.
</ParamField>

<ParamField body="--remote" type="TEXT">
  Name of the remote in `.trussrc` to push to.
</ParamField>

<ParamField body="--model-name" type="TEXT">
  Temporarily overrides the model name for this deployment without updating `config.yaml`.
</ParamField>

<ParamField body="--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.
</ParamField>

<ParamField body="--promote">
  Push as a published deployment and promote to production, even if a production deployment already exists.
</ParamField>

<ParamField body="--environment" type="TEXT">
  Push as a published deployment and promote into the specified environment. When specified, `--promote` is ignored.
</ParamField>

<ParamField body="--preserve-previous-production-deployment">
  Preserve the previous production deployment's autoscaling settings. Can only be used with `--promote`.
</ParamField>

<ParamField body="--disable-truss-download">
  Disable downloading the Truss directory from the UI.
</ParamField>

<ParamField body="--deployment-name" type="TEXT">
  Name of the deployment. Only applies to published deployments (not development deployments created with `--watch`). Must contain only alphanumeric, `.`, `-`, or `_` characters.
</ParamField>

<ParamField body="--wait / --no-wait">
  Wait for deployment to complete before returning. Returns non-zero exit code if deploy or build fails.
</ParamField>

<ParamField body="--timeout-seconds" type="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`.
</ParamField>

<ParamField body="--include-git-info">
  Attach git versioning info (sha, branch, tag) to the deployment. Can also be set permanently in `.trussrc`.
</ParamField>

<ParamField body="--tail">
  Stream deployment logs after push.
</ParamField>

<ParamField body="--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.
</ParamField>

<ParamField body="--deploy-timeout-minutes" type="INTEGER">
  Timeout in minutes for the deploy operation.
</ParamField>

<ParamField body="--team" type="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.

  <Note>
    The `--team` flag is only available if your organization has teams enabled. [Contact us](mailto:support@baseten.co) to enable teams, or see [Teams](/organization/teams) for more information.
  </Note>
</ParamField>

<ParamField body="--labels" type="TEXT">
  Pass a JSON string with key-value pairs. This will be attached to the deployment and can be used for searching and filtering.

  ```sh theme={"system"}
  truss push --labels '{"env": "staging", "team": "ml-platform", "version": "1.2.0"}'
  ```
</ParamField>

<ParamField body="--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`.
</ParamField>

<ParamField body="--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`](/reference/cli/truss/watch) instead.
</ParamField>

<ParamField body="--no-cache">
  Force a full rebuild without using cached layers.
</ParamField>

<ParamField body="--watch-no-sleep" type="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`.
</ParamField>

<ParamField body="--output" type="text | json" default="text">
  Output format. `json` emits structured JSON to stdout and all other output (progress, logs) to stderr. Default is `text`.
</ParamField>

<ParamField body="--log" type="humanfriendly | W | WARNING | I | INFO | D | DEBUG" default="humanfriendly">
  Logging verbosity. `humanfriendly` (default) is pretty-printed; `INFO`, `DEBUG`, `WARNING` produce structured logs.
</ParamField>

<ParamField body="--non-interactive">
  Disable interactive prompts. Use in CI/automated contexts where stdin isn't a TTY.
</ParamField>

### Arguments

<ParamField body="TARGET_DIRECTORY" type="TEXT">
  A Truss directory. Defaults to current directory.
</ParamField>

**Examples:**

Deploy a published deployment from the current directory:

```sh theme={"system"}
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:

```sh theme={"system"}
truss push --watch
```

Deploy and promote to production:

```sh theme={"system"}
truss push --promote
```

Deploy to a specific environment:

```sh theme={"system"}
truss push --environment staging
```

Deploy with a custom deployment name:

```sh theme={"system"}
truss push --deployment-name my-model_v1.0
```

Deploy with a custom config file:

```sh theme={"system"}
truss push --config my-config.yaml
```

Deploy to a specific team:

```sh theme={"system"}
truss push --team my-team-name
```

Deploy with JSON output:

```sh theme={"system"}
truss push --output json
```

Returns:

```json theme={"system"}
{
  "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
}
```
