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

# baseten model

> Manage Baseten models

Create, list, and push Baseten models.

Authentication is through `baseten auth login` or the `BASETEN_API_KEY` environment variable.

## push

```sh theme={"system"}
baseten model push [OPTIONS] [--dir DIR]
```

Build a model archive, upload it to Baseten, and create either a new model or a new deployment of an existing model.

By default, the command pushes the current directory. Pass `--dir` to push a model directory at another path. If your model only needs a configuration file, pass `--file` to push that file directly without creating a model directory. The CLI uploads the file as `config.yaml`. You can't combine `--file` and `--dir`.

Baseten identifies the model by the `model_name` field in `config.yaml`. Use `--override-name` to change the name for this push without editing the file.

A push can set the new deployment's instance type (`--instance-type`), autoscaling (`--min-replica`, `--max-replica`, and the other autoscaling flags), and request backpressure (`--request-backpressure-policy`) without editing `config.yaml`. With `--environment`, the environment keeps those settings after the promotion. The promotion-only flags `--autoscaling-schedule-update-json` and `--override-*` apply only with `--environment`. `--instance-type` can't be combined with `--preserve-env-instance-type`.

### Options

**--autoscaling-schedule-update-json** `TEXT`

Autoscaling schedule changes for the environment, applied when the promotion completes, as a JSON object with schedules, delete\_schedules, and timezone. Same shape and values as autoscaling\_schedule\_settings on the environment update API, for example cadence DAILY. Requires `--environment`.

**--autoscaling-window** `INTEGER`

Timeframe of traffic considered for autoscaling decisions, in seconds.

**--concurrency-target** `INTEGER`

Number of requests per replica before scaling up.

**--create-environment-if-missing** `BOOL`

Create the environment named by `--environment` when the model does not have it yet. Without this, pushing to an environment that does not exist fails. Only meaningful for an environment other than production, which every model has.

**--deploy-timeout** `TEXT`

Deployment timeout as a duration (e.g. 30m, 1h); allowed range 10m to 24h.

**--deployment-name** `TEXT`

Human-readable name for the new deployment.

**--develop** `BOOL`

Push as a development deployment: the model's single mutable dev slot, created if absent and overwritten in place otherwise. Incompatible with `--environment` and `--deployment-name`.

**--dir** `TEXT`

Model directory to push. Defaults to the current directory when `--file` is not set.

**--disable-archive-download** `BOOL`

Disable archive download for the new model. Only valid for new models.

**--dry-run** `BOOL`

Validate the push and request upload credentials without uploading or creating anything.

**--environment** `TEXT`

Stable environment to push to. Run 'baseten model environment list' to see a model's environments.

**--file** `TEXT`

Config file to push on its own, for models defined entirely by their config. Use - for stdin. Only this file is uploaded, as the model's config.yaml. Mutually exclusive with `--dir`.

**--include-git-info** `BOOL`

Attach the git commit, latest tag, commits since that tag, and whether there are uncommitted changes, when the model directory is in a git repository.

**--instance-type** `TEXT`

Instance type for the new deployment, for example A10Gx4x16, instead of the one in config.yaml. With `--environment`, the environment keeps it once the promotion completes. See [https://docs.baseten.co/deployment/resources](https://docs.baseten.co/deployment/resources.md) for the available types. Cannot be combined with `--preserve-env-instance-type`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--labels** `TEXT`

User-provided labels for the deployment as a JSON object, e.g. '\{"team":"ml","priority":1}'.

**--max-replica** `INTEGER`

Maximum number of replicas.

**--max-scale-down-rate** `INTEGER`

Maximum percentage of replicas that can be removed per autoscaling window (1-50). For example, 20 means at most 20% of replicas are removed per window.

**--no-build-cache** `BOOL`

Force a full rebuild without using cached layers.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--override-max-surge-percent** `INTEGER`

For this promotion only, the maximum surge percentage for rolling deploys.

**--override-max-unavailable-percent** `INTEGER`

For this promotion only, the maximum unavailable percentage for rolling deploys.

**--override-name** `TEXT`

Override the model\_name from config.yaml for this push only. The on-disk config.yaml is not modified.

**--override-promotion-cleanup-strategy** `TEXT`

For this promotion only, the cleanup strategy to use after it completes.

One of: `keep`, `scale-to-zero`, `deactivate`

**--override-replica-overhead-percent** `INTEGER`

For this promotion only, the replica overhead percentage for rolling deploys.

**--override-rolling-deploy** `BOOL`

For this promotion only, whether to use rolling deploy orchestration.

**--override-rolling-deploy-strategy** `TEXT`

For this promotion only, the rolling deploy strategy.

One of: `replica`

**--override-stabilization-time-seconds** `INTEGER`

For this promotion only, the stabilization time for rolling deploys, in seconds.

**--preserve-env-instance-type** `BOOL`

Keep the target environment's current instance type instead of applying the one from config.yaml. Only meaningful when an environment is targeted.

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--region** `TEXT`

Slug of the region to deploy the model in. Defaults to a region Baseten selects. Run 'baseten org regions' to see the slugs available.

**--request-backpressure-policy** `TEXT | null`

Backpressure policy for the new deployment. With `--environment`, the environment keeps it once the promotion completes. Pass null to clear the policy.

One of: `queue-on-full`, `reject-on-full`, `null`

**--scale-down-delay** `INTEGER`

Waiting period before scaling down any active replica, in seconds.

**--tail** `BOOL`

Stream build and runtime logs to stderr after pushing. Logs are always text-formatted; use 'baseten model deployment logs `--tail`' for structured log streaming.

**--target-in-flight-tokens** `INTEGER`

Target number of in-flight tokens for autoscaling decisions. Early access only.

**--target-utilization-percentage** `INTEGER`

Target utilization percentage for scaling up and down.

**--team** `TEXT`

Team the model belongs to. Only valid for new models.

**--wait** `BOOL`

Block until the deployment is active. Exits non-zero on a terminal-failure status.

**--watch** `BOOL`

After pushing, watch the model directory and live-patch the development deployment on change. Implies `--develop`.

**--watch-hot-reload** `BOOL`

With `--watch`, hot-reload the running container when every change is to model code; mixed changes fall back to a cold patch.

**--watch-no-keepalive** `BOOL`

With `--watch`, let the development deployment scale to zero while watching. By default it is kept warm by periodic pings.

**--min-replica** `INTEGER`

Minimum number of replicas.

**--override-redeploy-on-promotion** `BOOL`

For this promotion only, whether to create a new deployment with a copy of the image.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Push the current directory as a new deployment

```sh theme={"system"}
baseten model push
```

Push and stream build/runtime logs until the deployment is active

```sh theme={"system"}
baseten model push --tail --wait
```

Push a single configuration file directly:

```sh theme={"system"}
baseten model push --file config.yaml --wait
```

Read the configuration from standard input:

```sh theme={"system"}
cat config.yaml | baseten model push --file - --wait
```

Push with an instance type and autoscaling settings for the new deployment

```sh theme={"system"}
baseten model push --instance-type <instance-type> --min-replica 1 --max-replica 4 --concurrency-target 8
```

### Filter output with `--jq`

Print the new deployment's predict URL

```sh theme={"system"}
baseten model push --jq '.predict_url'
```

### Output

**Text mode (`--output text`):** Narrative summary on stdout: success banner, deployment facts, then grouped next-step hints for viewing logs, invoking the model, and (when the pushed config enables it) SSH access; hints scoped to an environment are tagged "(once deployed)". Under `--output json` the narrative is redirected to stderr so stdout stays a clean JSON document. With `--wait`, if the deployment doesn't become active and Baseten reports why, the command prints the status and reason and exits with an error that includes them.

**JSON mode (`--output json`):** payload type `cmd.ModelPushResult`.

Under `--dry-run` no upload or deployment happens; the push is validated, upload credentials are requested, and stdout is the empty JSON object `\{\}`. Otherwise stdout is the full model+deployment result.

## watch

```sh theme={"system"}
baseten model watch [OPTIONS] [--dir DIR]
```

Watch a model directory and patch the model's development deployment in place on every change, skipping a full rebuild.

The current directory is used by default; pass `--dir` to watch a model directory at another path. The model is identified by the `model_name` field in that directory's config.yaml, like `baseten model push`.

The model must already have a development deployment; if it does not, run `baseten model push --develop` (or `baseten model push --watch`) first.

Runs until interrupted. Some changes cannot be expressed as a patch (removing config.yaml, or any change under the data directory); the watcher reports these and you must re-push.

### Options

**--dir** `TEXT` (default: .)

Model directory to watch. Defaults to the current directory.

**--hot-reload** `BOOL`

Hot-reload the running container when every change is to model code; mixed changes fall back to a cold patch.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--no-keepalive** `BOOL`

Let the development deployment scale to zero while watching. By default it is kept warm by periodic pings.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team the model belongs to. Use to disambiguate when the same model\_name exists in multiple teams.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Watch the current directory against its model's development deployment

```sh theme={"system"}
baseten model watch
```

Watch another directory and hot-reload on model-code changes

```sh theme={"system"}
baseten model watch --dir ./my-model --hot-reload
```

### Output

**Text mode (`--output text`):** Streams patch and sync status to stderr as changes are applied. Runs until interrupted and produces no stdout output.

**JSON mode (`--output json`):** payload type `cmd.JSONUndefined`.

## list

```sh theme={"system"}
baseten model list [OPTIONS]
```

List Baseten models.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID to scope the listing to. Defaults to all teams the caller can see.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

List all models accessible to the caller

```sh theme={"system"}
baseten model list
```

List only models in a specific team

```sh theme={"system"}
baseten model list --team my-team
```

### Filter output with `--jq`

Print just the model IDs

```sh theme={"system"}
baseten model list --jq '.models[].id'
```

### Output

**Text mode (`--output text`):** Table with columns: ID, NAME, TEAM, DEPLOYMENTS, CREATED. When no models exist, prints "No models found." to stderr.

**JSON mode (`--output json`):** payload type `managementapi.Models`.

## describe

```sh theme={"system"}
baseten model describe [OPTIONS]
```

Describe a Baseten model.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Describe a model by ID

```sh theme={"system"}
baseten model describe --model-id <model-id>
```

Describe a model by name

```sh theme={"system"}
baseten model describe --model-name <name>
```

### Filter output with `--jq`

Print the production deployment ID

```sh theme={"system"}
baseten model describe --model-id <model-id> --jq '.production_deployment_id'
```

### Output

**Text mode (`--output text`):** Field-per-line summary: ID, Name, Team, Deployments, Instance, Production, Development, Created. Optional fields are omitted when unset.

**JSON mode (`--output json`):** payload type `managementapi.Model`.

## predict

```sh theme={"system"}
baseten model predict [OPTIONS]
```

POST a JSON request to a model and write the response to stdout.

Targets the production environment by default. Use `--environment`, `--deployment-id`, `--deployment-name`, or `--regional` to target something else.

Streaming responses (Transfer-Encoding: chunked) are passed through as they arrive. For machine-readable streaming JSON from OpenAI-compatible models, use `--output jsonl`.

Pass `--verbose` to log the request URL, the response status, and the response headers to stderr.

### Options

**--data** `TEXT`

Inline JSON request body. The shape is the deployed model's own input schema; see [https://docs.baseten.co/inference/calling-your-model](https://docs.baseten.co/inference/calling-your-model.md).

Mutually exclusive with other flags in group `predict-input`.

**--deployment-id** `TEXT`

Specific deployment to target. Mutually exclusive with `--environment`, `--deployment-name`, and `--regional`.

**--deployment-name** `TEXT`

Name of the deployment to target. Mutually exclusive with `--environment`, `--deployment-id`, and `--regional`.

**--environment** `TEXT`

Environment to target (e.g. production, development). Defaults to production. Mutually exclusive with `--deployment-id`, `--deployment-name`, and `--regional`. Run 'baseten model environment list' to see a model's environments.

**--file** `TEXT`

Path to a JSON file containing the request body. Use '-' for stdin.

Mutually exclusive with other flags in group `predict-input`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--regional** `TEXT`

Regional environment name; routes through the regional hostname. Mutually exclusive with --environment, --deployment-id, and --deployment-name.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--websocket** `BOOL`

Use the WebSocket predict endpoint. Sends the body as one frame, reads one frame back, then closes. Not for multi-message or back-and-forth sessions.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Send an inline JSON body

```sh theme={"system"}
baseten model predict --model-id <model-id> --data '{"prompt":"hello"}'
```

Send a request body from a file

```sh theme={"system"}
baseten model predict --model-id <model-id> --file request.json
```

### Filter output with `--jq`

Extract a field when the model returns JSON

```sh theme={"system"}
baseten model predict --model-id <model-id> --data '{"x":1}' --jq '.result'
```

### Output

**Text mode (`--output text`):** The model's response body, passed through verbatim. May be JSON, plain text, or binary, and may stream when the model uses chunked transfer encoding or SSE.

**JSON mode (`--output json`):** payload type `cmd.JSONUndefined`.

Under `--output json`, binary frames are base64-encoded under a 'body' key. Under `--output jsonl`, each SSE or binary chunk is emitted as its own record, one per line.

## delete

```sh theme={"system"}
baseten model delete [OPTIONS]
```

Delete a Baseten model and all of its deployments.

Prompts for the model name to confirm the deletion. Pass `--yes` to skip the prompt. When stdin is not a terminal, `--yes` is required.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--yes** `BOOL`

Skip the interactive confirmation prompt. Required when stdin is not a terminal.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Delete by ID without confirmation

```sh theme={"system"}
baseten model delete --model-id <model-id> --yes
```

Delete by name with interactive confirmation

```sh theme={"system"}
baseten model delete --model-name <name>
```

### Filter output with `--jq`

Print the deleted model's ID

```sh theme={"system"}
baseten model delete --model-id <model-id> --yes --jq '.id'
```

### Output

**Text mode (`--output text`):** On success, prints "Deleted model `name` (`id`)" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.ModelTombstone`.

## rename

```sh theme={"system"}
baseten model rename [OPTIONS]
```

Change a model's name. The new name must be unique within the model's team.

Renaming does not change the model ID, endpoints, or deployments. Pushes that still use the old `model_name` create another model or target a model that now uses that name, so update `config.yaml` after renaming.

Run `baseten model describe` to see the current values.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**--new-name** `TEXT` *required*

New name for the model, unique within its team.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Rename by ID

```sh theme={"system"}
baseten model rename --model-id <model-id> --new-name my-model-v2
```

Rename by name, scoped to a team

```sh theme={"system"}
baseten model rename --model-name <name> --team <team> --new-name my-model-v2
```

### Filter output with `--jq`

Print the model's new name

```sh theme={"system"}
baseten model rename --model-id <model-id> --new-name my-model-v2 --jq '.name'
```

### Output

**Text mode (`--output text`):** On success, prints "Renamed model `id` to `name`" and a reminder to update `model_name` in `config.yaml` to stderr (also under `--output json`); no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.Model`.

## audit-logs

```sh theme={"system"}
baseten model audit-logs [OPTIONS]
```

List audit-log entries scoped to a single model, newest first.

Returns up to `--limit` entries (default 20) across the full history by default. Use `--start`/`--end` or `--since` to scope the time window, and the filter flags (`--event-type-group`, `--source`, `--user-id`, `--deployment-id`, `--environment`, `--search`) to narrow results within the model.

For machine-readable streaming, prefer `--output jsonl` over `--output json`.

### Options

**--deployment-id** `TEXT (repeatable)`

Only return entries referencing one of these model deployment IDs. May be repeated.

**--direction** `TEXT` (default: desc)

Sort order by the time the action occurred: 'desc' (newest first) or 'asc' (oldest first).

One of: `asc`, `desc`

**--end** `TEXT`

End of the time window. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. Defaults to now.

**--environment** `TEXT (repeatable)`

Only return entries for one of these environments. May be repeated.

**--event-type-group** `TEXT (repeatable)`

Only return entries whose event type falls in one of these groups. May be repeated. One of: activated-deactivated, api-keys, autoscaling-settings, deleted, deployed, directory-group-management, environment-settings, gateway, instance-type-changed, promoted, replica-terminated, secrets, ssh, user-management, webhook-signing-secrets.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--limit** `INTEGER` (default: 20)

Maximum number of entries to return, paging as needed. Use 0 for no limit (every entry in the window).

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--search** `TEXT`

Case-insensitive substring matched against resource names and IDs in the entry.

**--since** `TEXT`

Shortcut for a window from a relative time ago until now. Accepts a duration (e.g. '30m', '1h30m') or '`N`d' (e.g. '3d'). Mutually exclusive with `--start` and `--end`.

**--source** `TEXT (repeatable)`

Only return entries issued from one of these surfaces. May be repeated. One of: ui, api, mcp, other.

**--start** `TEXT`

Start of the time window. Accepts ISO 8601 (e.g. '2026-05-14', '2026-05-14T12:00:00', '2026-05-14T12:00:00Z'). Values without a timezone designator are interpreted in the local timezone. Defaults to the beginning of the audit-log history.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--user-id** `TEXT (repeatable)`

Only return entries whose acting user is one of these IDs. May be repeated.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

List the 20 most recent audit-log entries for a model

```sh theme={"system"}
baseten model audit-logs --model-id <model-id>
```

List promote events for a model over the last 30 days

```sh theme={"system"}
baseten model audit-logs --model-name <name> --since 30d --event-type-group promoted
```

### Filter output with `--jq`

Stream each entry's event type as a JSONL stream

```sh theme={"system"}
baseten model audit-logs --model-id <model-id> --output jsonl --jq '.event_type'
```

### Output

**Text mode (`--output text`):** Table with columns: TIME, ACTOR, EVENT, SOURCE. When no entries match, prints "No audit-log entries found." to stderr.

**JSON mode (`--output json`):** payload type `managementapi.AuditLogEntry`.

## deployment

Deployments are the instances of a model that serve traffic. Activate and deactivate them, read their config, logs, and metrics, and change their autoscaling and request backpressure settings.

### activate

```sh theme={"system"}
baseten model deployment activate [OPTIONS]
```

Activate a model deployment.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Activate a deployment

```sh theme={"system"}
baseten model deployment activate --model-id <model-id> --deployment-id <deployment-id>
```

#### Filter output with `--jq`

Print just the success flag

```sh theme={"system"}
baseten model deployment activate --model-id <model-id> --deployment-id <deployment-id> --jq '.success'
```

#### Output

**Text mode (`--output text`):** On success, prints "Activated deployment `id`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.ActivateResponse`.

### config

```sh theme={"system"}
baseten model deployment config [OPTIONS]
```

Fetch the config of a deployed model.

By default prints the original config.yaml. Use `--output json` to emit the full response \{config, raw\_config} as JSON.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Print the deployment's config.yaml

```sh theme={"system"}
baseten model deployment config --model-id <model-id> --deployment-id <deployment-id>
```

#### Filter output with `--jq`

Extract the parsed model\_name field

```sh theme={"system"}
baseten model deployment config --model-id <model-id> --deployment-id <deployment-id> --jq '.config.model_name'
```

#### Output

**Text mode (`--output text`):** The original config.yaml text (preserving comments and ordering) when available, otherwise the parsed config marshaled as YAML.

**JSON mode (`--output json`):** payload type `managementapi.DeploymentConfigResponse`.

The full \{config, raw\_config} envelope. raw\_config is the original config.yaml text; config is the parsed shape.

### deactivate

```sh theme={"system"}
baseten model deployment deactivate [OPTIONS]
```

Deactivate a model deployment.

Prompts for yes/no confirmation. Pass `--yes` to skip the prompt. When stdin is not a terminal, `--yes` is required.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--yes** `BOOL`

Skip the interactive confirmation prompt. Required when stdin is not a terminal.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Deactivate a deployment without the confirmation prompt

```sh theme={"system"}
baseten model deployment deactivate --model-id <model-id> --deployment-id <deployment-id> --yes
```

#### Filter output with `--jq`

Print just the success flag

```sh theme={"system"}
baseten model deployment deactivate --model-id <model-id> --deployment-id <deployment-id> --yes --jq '.success'
```

#### Output

**Text mode (`--output text`):** On success, prints "Deactivated deployment `id`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.DeactivateResponse`.

### download

```sh theme={"system"}
baseten model deployment download [OPTIONS]
```

Download the model source for a model deployment as an uncompressed tar.

Exactly one of `--out-file` or `--out-dir` is required. `--out-file` writes the raw tar bytes; `--out-dir` extracts the tar into the directory. Use `--overwrite` to replace an existing file or write into a non-empty directory.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**--out-dir** `TEXT`

Extract the model source tar into this directory.

Mutually exclusive with other flags in group `download-out`.

**--out-file** `TEXT`

Save the model source as an uncompressed tar file at this path.

Mutually exclusive with other flags in group `download-out`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--overwrite** `BOOL`

Allow overwriting an existing file or non-empty directory.

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Save the model source as a tar file

```sh theme={"system"}
baseten model deployment download --model-id <model-id> --deployment-id <deployment-id> --out-file model.tar
```

Extract the model source into a directory

```sh theme={"system"}
baseten model deployment download --model-id <model-id> --deployment-id <deployment-id> --out-dir ./model
```

#### Filter output with `--jq`

Print just the destination path

```sh theme={"system"}
baseten model deployment download --model-id <model-id> --deployment-id <deployment-id> --out-file truss.tar --jq '.out_file'
```

#### Output

**Text mode (`--output text`):** Writes the model source to disk; prints progress and the final destination path to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `cmd.ModelDeploymentDownloadResult`.

On success, stdout is a JSON object with either out\_file or out\_dir set to the path written.

### promote

```sh theme={"system"}
baseten model deployment promote [OPTIONS]
```

Promote a model deployment to an environment.

Defaults to the production environment. Cleanup of the previous deployment is controlled by the target environment's promotion cleanup strategy.

Promotions use the target environment's [rolling deployment settings](https://docs.baseten.co/deployment/rolling-deployments.md#configuration-reference), including mixed mode. Configure those settings with [`model environment update-promotion`](https://docs.baseten.co/reference/cli/baseten/model#update-promotion) before promoting the deployment.

A promotion can also change the target environment's settings: `--region`, `--instance-type`, `--request-backpressure-policy`, the autoscaling flags, and `--autoscaling-schedule-update-json` for autoscaling schedules as raw API JSON. The `--override-*` flags change the promotion's settings for this promotion only. The confirmation prompt names the settings the promotion changes.

Prompts for yes/no confirmation. Pass `--yes` to skip the prompt. When stdin is not a terminal, `--yes` is required.

#### Options

**--autoscaling-schedule-update-json** `TEXT`

Autoscaling schedule changes for the environment, applied when the promotion completes, as a JSON object with schedules, delete\_schedules, and timezone. Same shape and values as autoscaling\_schedule\_settings on the environment update API, for example cadence DAILY.

**--autoscaling-window** `INTEGER`

Timeframe of traffic considered for autoscaling decisions, in seconds.

**--concurrency-target** `INTEGER`

Number of requests per replica before scaling up.

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--environment** `TEXT` (default: production)

Target environment name. Defaults to production.

**--instance-type** `TEXT`

Instance type to set on the environment, for example A10Gx4x16. See [https://docs.baseten.co/deployment/resources](https://docs.baseten.co/deployment/resources.md) for the available types. Cannot be combined with `--preserve-env-instance-type`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--max-replica** `INTEGER`

Maximum number of replicas.

**--max-scale-down-rate** `INTEGER`

Maximum percentage of replicas that can be removed per autoscaling window (1-50). For example, 20 means at most 20% of replicas are removed per window.

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--override-max-surge-percent** `INTEGER`

For this promotion only, the maximum surge percentage for rolling deploys.

**--override-max-unavailable-percent** `INTEGER`

For this promotion only, the maximum unavailable percentage for rolling deploys.

**--override-promotion-cleanup-strategy** `TEXT`

For this promotion only, the cleanup strategy to use after it completes.

One of: `keep`, `scale-to-zero`, `deactivate`

**--override-replica-overhead-percent** `INTEGER`

For this promotion only, the replica overhead percentage for rolling deploys.

**--override-rolling-deploy** `BOOL`

For this promotion only, whether to use rolling deploy orchestration.

**--override-rolling-deploy-strategy** `TEXT`

For this promotion only, the rolling deploy strategy.

One of: `replica`

**--override-stabilization-time-seconds** `INTEGER`

For this promotion only, the stabilization time for rolling deploys, in seconds.

**--preserve-env-instance-type** `BOOL`

Keep the target environment's current instance type instead of applying the promoted deployment's.

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--region** `TEXT`

Region slug to set on the environment. Pass an empty string for Global. Run 'baseten org regions' to see the slugs available.

**--request-backpressure-policy** `TEXT | null`

Backpressure policy to set on the environment. Pass null to clear the environment's policy.

One of: `queue-on-full`, `reject-on-full`, `null`

**--scale-down-delay** `INTEGER`

Waiting period before scaling down any active replica, in seconds.

**--target-in-flight-tokens** `INTEGER`

Target number of in-flight tokens for autoscaling decisions. Early access only.

**--target-utilization-percentage** `INTEGER`

Target utilization percentage for scaling up and down.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--yes** `BOOL`

Skip the interactive confirmation prompt. Required when stdin is not a terminal.

**--min-replica** `INTEGER`

Minimum number of replicas.

**--override-redeploy-on-promotion** `BOOL`

For this promotion only, whether to create a new deployment with a copy of the image.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Promote a deployment to production without the confirmation prompt

```sh theme={"system"}
baseten model deployment promote --model-id <model-id> --deployment-id <deployment-id> --yes
```

Promote to a non-production environment using the deployment's own instance type

```sh theme={"system"}
baseten model deployment promote --model-id <model-id> --deployment-id <deployment-id> --environment staging --preserve-env-instance-type --yes
```

Promote to production and switch the environment to a different instance type

```sh theme={"system"}
baseten model deployment promote --model-id <model-id> --deployment-id <deployment-id> --environment production --instance-type <instance-type> --yes
```

#### Filter output with `--jq`

Print the promoted deployment's status

```sh theme={"system"}
baseten model deployment promote --model-id <model-id> --deployment-id <deployment-id> --yes --jq '.status'
```

#### Output

**Text mode (`--output text`):** On success, prints "Promoted deployment `id` to environment `env`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.Deployment`.

Under `--output json`, the promoted deployment object.

### delete

```sh theme={"system"}
baseten model deployment delete [OPTIONS]
```

Delete a single model deployment.

Deployments associated with an environment (e.g. production, development) and the only deployment of a model cannot be deleted server-side.

Prompts for yes/no confirmation. Pass `--yes` to skip the prompt. When stdin is not a terminal, `--yes` is required.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--yes** `BOOL`

Skip the interactive confirmation prompt. Required when stdin is not a terminal.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Delete a deployment without the confirmation prompt

```sh theme={"system"}
baseten model deployment delete --model-id <model-id> --deployment-id <deployment-id> --yes
```

#### Filter output with `--jq`

Print the deleted deployment's ID

```sh theme={"system"}
baseten model deployment delete --model-id <model-id> --deployment-id <deployment-id> --yes --jq '.id'
```

#### Output

**Text mode (`--output text`):** On success, prints "Deleted deployment `id`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.DeploymentTombstone`.

### describe

```sh theme={"system"}
baseten model deployment describe [OPTIONS]
```

Describe a model deployment by ID.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Describe a deployment by ID

```sh theme={"system"}
baseten model deployment describe --model-id <model-id> --deployment-id <deployment-id>
```

#### Filter output with `--jq`

Print just the deployment status

```sh theme={"system"}
baseten model deployment describe --model-id <model-id> --deployment-id <deployment-id> --jq '.status'
```

#### Output

**Text mode (`--output text`):** Field-per-line summary: ID, Name, Model, Environment (optional), Status, Failure (when Baseten reports why the deployment failed), Instance (optional), Replicas, Created.

**JSON mode (`--output json`):** payload type `managementapi.Deployment`.

### list

```sh theme={"system"}
baseten model deployment list [OPTIONS]
```

List all deployments of a model.

#### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

List all deployments of a model

```sh theme={"system"}
baseten model deployment list --model-id <model-id>
```

#### Filter output with `--jq`

Print just the deployment IDs

```sh theme={"system"}
baseten model deployment list --model-id <model-id> --jq '.deployments[].id'
```

#### Output

**Text mode (`--output text`):** Table with columns: ID, NAME, ENVIRONMENT, STATUS, INSTANCE, REPLICAS, CREATED. When no deployments exist, prints "No deployments found." to stderr.

**JSON mode (`--output json`):** payload type `managementapi.Deployments`.

### logs

```sh theme={"system"}
baseten model deployment logs [OPTIONS]
```

Fetch logs for a model deployment.

By default returns up to `--limit` lines from the last 30 minutes, newest first, and prints a note to stderr when `--limit` trims older lines. Use `--start`/`--end` or `--since` to scope the window (max 7 days). Use `--tail` to stream live logs until the deployment leaves a runnable state or you interrupt with Ctrl-C.

For machine-readable streaming, prefer `--output jsonl` over `--output json`.

For request-ID tracing, scope, and log export, see [Logs](https://docs.baseten.co/observability/logs.md).

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--end** `TEXT`

End of the log time range. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. Default is now. Window must be at most 7 days.

**--excludes** `TEXT (repeatable)`

Case-sensitive substring; lines containing it are dropped. May be repeated.

**--includes** `TEXT (repeatable)`

Case-sensitive substring that must appear in the log message. May be repeated; all must match.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--limit** `INTEGER` (default: 5000)

Maximum number of log lines to return, paging backward from the end of the window. Use 0 for no limit (every log line in the window). Not applicable with `--tail`.

**--min-level** `TEXT`

Only return logs at or above this severity level.

One of: `debug`, `info`, `warning`, `error`

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--replica** `TEXT`

Only return logs emitted by this replica (5-char short ID).

**--request-id** `TEXT`

Only return logs tagged with this inference request ID.

**--search-pattern** `TEXT`

RE2 regular expression matched against the log message. Prefer `--includes` and `--excludes` for plain substring matches.

**--since** `TEXT`

Shortcut for fetching logs from a relative time ago until now. Accepts a duration (e.g. '30m', '1h30m') or '`N`d' (e.g. '3d'). Maximum '7d'. Mutually exclusive with `--start` and `--end`.

**--start** `TEXT`

Start of the log time range. Accepts ISO 8601 (e.g. '2026-05-14', '2026-05-14T12:00:00', '2026-05-14T12:00:00Z'). Values without a timezone designator are interpreted in the local timezone. Default is 30 minutes before the end. Window must be at most 7 days.

**--tail** `BOOL`

Stream new logs as they arrive until the deployment leaves a runnable state or you interrupt with Ctrl-C. Cannot be combined with the time-range or filter flags. For machine-readable streaming, prefer `--output` jsonl over `--output` json.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Print logs for a deployment over the last hour

```sh theme={"system"}
baseten model deployment logs --model-id <model-id> --deployment-id <deployment-id> --since 1h
```

Print logs for a fixed time range

```sh theme={"system"}
baseten model deployment logs --model-id <model-id> --deployment-id <deployment-id> --start 2026-05-14T00:00:00Z --end 2026-05-15T00:00:00Z
```

Tail live logs until the deployment leaves a runnable state

```sh theme={"system"}
baseten model deployment logs --model-id <model-id> --deployment-id <deployment-id> --tail
```

Filter to warnings and above that contain a term

```sh theme={"system"}
baseten model deployment logs --model-id <model-id> --deployment-id <deployment-id> --min-level warning --includes timeout
```

#### Filter output with `--jq`

Stream just the log messages as a JSONL stream

```sh theme={"system"}
baseten model deployment logs --model-id <model-id> --deployment-id <deployment-id> --output jsonl --jq '.message'
```

#### Output

**Text mode (`--output text`):** One line per log record: "\[YYYY-MM-DD HH:MM:SS]: (replica) message".

**JSON mode (`--output json`):** payload type `managementapi.Log`.

### metrics

```sh theme={"system"}
baseten model deployment metrics [OPTIONS]
```

Fetch metrics for a model deployment. Use `--mode current` for a snapshot, `--mode summary` to aggregate a window, or `--mode series` to plot values over time. Scope the window with `--since` or `--start`/`--end` (max 7 days; only applies to summary and series), and select metrics with one or more `--metric` flags.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--end** `TEXT`

End of the metrics time range. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. If omitted, the server defaults the end to now. Window must be at most 7 days.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--metric** `TEXT (repeatable)`

Name of a metric to return; see [https://docs.baseten.co/observability/export-metrics/supported-metrics](https://docs.baseten.co/observability/export-metrics/supported-metrics.md) for the available names. May be repeated. When omitted, a default set is returned.

**--mode** `TEXT` (default: current)

Aggregation mode. 'current' returns an instantaneous snapshot at now; 'summary' aggregates the whole window into one value per metric; 'series' returns evenly-spaced points across the window. `--start`/`--end`/`--since` are only meaningful for summary and series.

One of: `current`, `summary`, `series`

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**--no-chart** `BOOL`

For `--mode` series, emit a per-step table instead of sparklines.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--since** `TEXT`

Shortcut for a window from a relative time ago until now. Accepts a duration (e.g. '30m', '1h30m') or '`N`d' (e.g. '3d'). Maximum '7d'. Mutually exclusive with `--start` and `--end`.

**--start** `TEXT`

Start of the metrics time range. Accepts ISO 8601 (e.g. '2026-05-14', '2026-05-14T12:00:00', '2026-05-14T12:00:00Z'). Values without a timezone designator are interpreted in the local timezone. If omitted, the server defaults the start to one hour before the end. Window must be at most 7 days.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Show a current snapshot of the default metrics

```sh theme={"system"}
baseten model deployment metrics --model-name <model-name> --deployment-id <deployment-id>
```

Summarize request volume and latency over the last hour

```sh theme={"system"}
baseten model deployment metrics --model-id <model-id> --deployment-id <deployment-id> --mode summary --since 1h --metric baseten_inference_requests_total --metric baseten_end_to_end_response_time_seconds
```

Plot a series over the last 6 hours

```sh theme={"system"}
baseten model deployment metrics --model-id <model-id> --deployment-id <deployment-id> --mode series --since 6h
```

#### Filter output with `--jq`

Print the metric names returned

```sh theme={"system"}
baseten model deployment metrics --model-id <model-id> --deployment-id <deployment-id> --jq '.metric_descriptors[].name'
```

#### Output

**Text mode (`--output text`):** For `current` and `summary`, a table with columns METRIC, one column per label dimension (for example QUANTILE, STAT), and VALUE; summary counter values show "total (rate/s)". For `series`, a sparkline per metric label set with its min-max range and end value, or a per-step table under `--no-chart`.

**JSON mode (`--output json`):** payload type `managementapi.GetModelMetricsResponse`.

The metrics response: metric\_descriptors, index-mapped metric\_values, the resolved mode, and the returned window.

### rename

```sh theme={"system"}
baseten model deployment rename [OPTIONS]
```

Change a deployment's name. The new name must be unique among the model's deployments and may contain only alphanumeric characters, hyphens, underscores, and periods.

Run `baseten model deployment describe` to see the current values.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**--new-name** `TEXT` *required*

New name for the deployment, unique among the model's deployments. Only alphanumeric characters, hyphens, underscores, and periods are allowed.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Rename a deployment

```sh theme={"system"}
baseten model deployment rename --model-id <model-id> --deployment-id <deployment-id> --new-name canary
```

#### Filter output with `--jq`

Print the deployment's new name

```sh theme={"system"}
baseten model deployment rename --model-id <model-id> --deployment-id <deployment-id> --new-name canary --jq '.name'
```

#### Output

**Text mode (`--output text`):** On success, prints "Renamed deployment `id` to `name`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.Deployment`.

### update-autoscaling

```sh theme={"system"}
baseten model deployment update-autoscaling [OPTIONS]
```

Update a deployment's autoscaling settings.

Only the flags you pass are changed; every other setting is left alone. Changes are applied asynchronously, so the response reports whether the request was accepted rather than the settled state.

Run `baseten model deployment describe` to see the current values.

#### Options

**--autoscaling-window** `INTEGER`

Timeframe of traffic considered for autoscaling decisions, in seconds.

**--concurrency-target** `INTEGER`

Number of requests per replica before scaling up.

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--max-replica** `INTEGER`

Maximum number of replicas.

**--max-scale-down-rate** `INTEGER`

Maximum percentage of replicas that can be removed per autoscaling window (1-50). For example, 20 means at most 20% of replicas are removed per window.

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--scale-down-delay** `INTEGER`

Waiting period before scaling down any active replica, in seconds.

**--target-in-flight-tokens** `INTEGER`

Target number of in-flight tokens for autoscaling decisions. Early access only.

**--target-utilization-percentage** `INTEGER`

Target utilization percentage for scaling up and down.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--min-replica** `INTEGER`

Minimum number of replicas.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Raise a deployment's replica bounds

```sh theme={"system"}
baseten model deployment update-autoscaling --model-id <model-id> --deployment-id <deployment-id> --min-replica 2 --max-replica 10
```

Shorten the scale-down delay, leaving every other setting unchanged

```sh theme={"system"}
baseten model deployment update-autoscaling --model-id <model-id> --deployment-id <deployment-id> --scale-down-delay 60
```

#### Filter output with `--jq`

Print just the status

```sh theme={"system"}
baseten model deployment update-autoscaling --model-id <model-id> --deployment-id <deployment-id> --min-replica 2 --jq '.status'
```

#### Output

**Text mode (`--output text`):** The status of the request followed by the server's message.

**JSON mode (`--output json`):** payload type `managementapi.UpdateAutoscalingSettingsResponse`.

### update-request-backpressure

```sh theme={"system"}
baseten model deployment update-request-backpressure [OPTIONS]
```

Set the policy applied when a deployment's request queue is full. Pass `--policy null` to clear an existing policy and fall back to the default.

Run `baseten model deployment describe` to see the current values.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--policy** `TEXT | null` *required*

Backpressure policy to apply. Pass null to clear an existing policy.

One of: `queue-on-full`, `reject-on-full`, `null`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Reject requests once the queue is full

```sh theme={"system"}
baseten model deployment update-request-backpressure --model-id <model-id> --deployment-id <deployment-id> --policy reject-on-full
```

Clear the policy

```sh theme={"system"}
baseten model deployment update-request-backpressure --model-id <model-id> --deployment-id <deployment-id> --policy null
```

#### Filter output with `--jq`

Print the resulting policy

```sh theme={"system"}
baseten model deployment update-request-backpressure --model-id <model-id> --deployment-id <deployment-id> --policy reject-on-full --jq '.policy'
```

#### Output

**Text mode (`--output text`):** The resulting policy, or "none" when no policy is set.

**JSON mode (`--output json`):** payload type `managementapi.RequestBackpressureSettings`.

## deployment replica

Inspect and terminate individual replicas of a deployment.

### terminate

```sh theme={"system"}
baseten model deployment replica terminate [OPTIONS]
```

Terminate a single replica of a model deployment.

Prompts for yes/no confirmation. Pass `--yes` to skip the prompt. When stdin is not a terminal, `--yes` is required.

#### Options

**--deployment-id** `TEXT`

ID of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**--deployment-name** `TEXT`

Name of the deployment.

Mutually exclusive with other flags in group `deployment-ref`.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--replica-id** `TEXT` *required*

ID of the replica.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--yes** `BOOL`

Skip the interactive confirmation prompt. Required when stdin is not a terminal.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Terminate a replica without the confirmation prompt

```sh theme={"system"}
baseten model deployment replica terminate --model-id <model-id> --deployment-id <deployment-id> --replica-id <replica-id> --yes
```

#### Filter output with `--jq`

Print just the success flag

```sh theme={"system"}
baseten model deployment replica terminate --model-id <model-id> --deployment-id <deployment-id> --replica-id <replica-id> --yes --jq '.success'
```

#### Output

**Text mode (`--output text`):** On success, prints "Terminated replica `id` of deployment `id`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.TerminateReplicaResponse`.

## environment

An environment such as production or development points at the deployment currently serving it. Activate it, read its logs and metrics, and configure promotion, autoscaling, and request backpressure.

### activate

```sh theme={"system"}
baseten model environment activate [OPTIONS]
```

Activate the deployment associated with an environment.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Activate the deployment associated with an environment

```sh theme={"system"}
baseten model environment activate --model-id <model-id> --environment production
```

#### Filter output with `--jq`

Print just the success flag

```sh theme={"system"}
baseten model environment activate --model-id <model-id> --environment production --jq '.success'
```

#### Output

**Text mode (`--output text`):** On success, prints "Activated environment `name`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.ActivateResponse`.

### deactivate

```sh theme={"system"}
baseten model environment deactivate [OPTIONS]
```

Deactivate the deployment associated with an environment.

Prompts for yes/no confirmation. Pass `--yes` to skip the prompt. When stdin is not a terminal, `--yes` is required.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--yes** `BOOL`

Skip the interactive confirmation prompt. Required when stdin is not a terminal.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Deactivate an environment without the confirmation prompt

```sh theme={"system"}
baseten model environment deactivate --model-id <model-id> --environment production --yes
```

#### Filter output with `--jq`

Print just the success flag

```sh theme={"system"}
baseten model environment deactivate --model-id <model-id> --environment production --yes --jq '.success'
```

#### Output

**Text mode (`--output text`):** On success, prints "Deactivated environment `name`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.DeactivateResponse`.

### describe

```sh theme={"system"}
baseten model environment describe [OPTIONS]
```

Describe a model environment by name.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Describe the production environment of a model

```sh theme={"system"}
baseten model environment describe --model-id <model-id> --environment production
```

#### Filter output with `--jq`

Print the current deployment ID

```sh theme={"system"}
baseten model environment describe --model-id <model-id> --environment production --jq '.current_deployment.id'
```

#### Output

**Text mode (`--output text`):** Field-per-line summary: Name, Model, Current Deployment, Status, Candidate Deployment (optional), Created.

**JSON mode (`--output json`):** payload type `managementapi.Environment`.

### list

```sh theme={"system"}
baseten model environment list [OPTIONS]
```

List all environments of a model.

#### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

List all environments of a model

```sh theme={"system"}
baseten model environment list --model-id <model-id>
```

#### Filter output with `--jq`

Print just the environment names

```sh theme={"system"}
baseten model environment list --model-id <model-id> --jq '.environments[].name'
```

#### Output

**Text mode (`--output text`):** Table with columns: NAME, CURRENT DEPLOYMENT, STATUS. When no environments exist, prints "No environments found." to stderr.

**JSON mode (`--output json`):** payload type `managementapi.Environments`.

### logs

```sh theme={"system"}
baseten model environment logs [OPTIONS]
```

Fetch logs for a model environment, spanning every deployment that was active on the environment across the time range.

By default returns up to `--limit` lines from the last 30 minutes, newest first, and prints a note to stderr when `--limit` trims older lines. Use `--start`/`--end` or `--since` to scope the window (max 7 days). Use `--tail` to stream live logs until the environment's current deployment leaves a runnable state or you interrupt with Ctrl-C.

For machine-readable streaming, prefer `--output jsonl` over `--output json`.

For request-ID tracing, scope, and log export, see [Logs](https://docs.baseten.co/observability/logs.md).

#### Options

**--end** `TEXT`

End of the log time range. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. Default is now. Window must be at most 7 days.

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**--excludes** `TEXT (repeatable)`

Case-sensitive substring; lines containing it are dropped. May be repeated.

**--includes** `TEXT (repeatable)`

Case-sensitive substring that must appear in the log message. May be repeated; all must match.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--limit** `INTEGER` (default: 5000)

Maximum number of log lines to return, paging backward from the end of the window. Use 0 for no limit (every log line in the window). Not applicable with `--tail`.

**--min-level** `TEXT`

Only return logs at or above this severity level.

One of: `debug`, `info`, `warning`, `error`

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--replica** `TEXT`

Only return logs emitted by this replica (5-char short ID).

**--request-id** `TEXT`

Only return logs tagged with this inference request ID.

**--search-pattern** `TEXT`

RE2 regular expression matched against the log message. Prefer `--includes` and `--excludes` for plain substring matches.

**--since** `TEXT`

Shortcut for fetching logs from a relative time ago until now. Accepts a duration (e.g. '30m', '1h30m') or '`N`d' (e.g. '3d'). Maximum '7d'. Mutually exclusive with `--start` and `--end`.

**--start** `TEXT`

Start of the log time range. Accepts ISO 8601 (e.g. '2026-05-14', '2026-05-14T12:00:00', '2026-05-14T12:00:00Z'). Values without a timezone designator are interpreted in the local timezone. Default is 30 minutes before the end. Window must be at most 7 days.

**--tail** `BOOL`

Stream new logs as they arrive until the deployment leaves a runnable state or you interrupt with Ctrl-C. Cannot be combined with the time-range or filter flags. For machine-readable streaming, prefer `--output` jsonl over `--output` json.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Print logs for the production environment over the last hour

```sh theme={"system"}
baseten model environment logs --model-id <model-id> --environment production --since 1h
```

Tail live logs until the environment's current deployment leaves a runnable state

```sh theme={"system"}
baseten model environment logs --model-id <model-id> --environment production --tail
```

#### Filter output with `--jq`

Stream just the log messages as a JSONL stream

```sh theme={"system"}
baseten model environment logs --model-id <model-id> --environment production --output jsonl --jq '.message'
```

#### Output

**Text mode (`--output text`):** One line per log record: "\[YYYY-MM-DD HH:MM:SS]: (replica) message".

**JSON mode (`--output json`):** payload type `managementapi.Log`.

### metrics

```sh theme={"system"}
baseten model environment metrics [OPTIONS]
```

Fetch metrics aggregated across every deployment that was active on the environment over the time range.

Use `--mode current` for a snapshot, `--mode summary` to aggregate a window, or `--mode series` to plot values over time. Scope the window with `--since` or `--start`/`--end` (max 7 days; only applies to summary and series), and select metrics with one or more `--metric` flags. In series mode the window is split at each promotion so every point reflects the deployment(s) serving the environment at that time.

#### Options

**--end** `TEXT`

End of the metrics time range. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. If omitted, the server defaults the end to now. Window must be at most 7 days.

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--metric** `TEXT (repeatable)`

Name of a metric to return; see [https://docs.baseten.co/observability/export-metrics/supported-metrics](https://docs.baseten.co/observability/export-metrics/supported-metrics.md) for the available names. May be repeated. When omitted, a default set is returned.

**--mode** `TEXT` (default: current)

Aggregation mode. 'current' returns an instantaneous snapshot at now; 'summary' aggregates the whole window into one value per metric; 'series' returns evenly-spaced points across the window. `--start`/`--end`/`--since` are only meaningful for summary and series.

One of: `current`, `summary`, `series`

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**--no-chart** `BOOL`

For `--mode` series, emit a per-step table instead of sparklines.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--since** `TEXT`

Shortcut for a window from a relative time ago until now. Accepts a duration (e.g. '30m', '1h30m') or '`N`d' (e.g. '3d'). Maximum '7d'. Mutually exclusive with `--start` and `--end`.

**--start** `TEXT`

Start of the metrics time range. Accepts ISO 8601 (e.g. '2026-05-14', '2026-05-14T12:00:00', '2026-05-14T12:00:00Z'). Values without a timezone designator are interpreted in the local timezone. If omitted, the server defaults the start to one hour before the end. Window must be at most 7 days.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Show a current snapshot of the default metrics for the production environment

```sh theme={"system"}
baseten model environment metrics --model-id <model-id> --environment production
```

Summarize request volume and latency over the last hour

```sh theme={"system"}
baseten model environment metrics --model-id <model-id> --environment production --mode summary --since 1h --metric baseten_inference_requests_total --metric baseten_end_to_end_response_time_seconds
```

Plot a series over the last 6 hours

```sh theme={"system"}
baseten model environment metrics --model-id <model-id> --environment production --mode series --since 6h
```

#### Filter output with `--jq`

Print the metric names returned

```sh theme={"system"}
baseten model environment metrics --model-id <model-id> --environment production --jq '.metric_descriptors[].name'
```

#### Output

**Text mode (`--output text`):** For `current` and `summary`, a table with columns METRIC, one column per label dimension (for example QUANTILE, STAT), and VALUE; summary counter values show "total (rate/s)". For `series`, a sparkline per metric label set with its min-max range and end value, or a per-step table under `--no-chart`.

**JSON mode (`--output json`):** payload type `managementapi.GetModelMetricsResponse`.

The metrics response: metric\_descriptors, index-mapped metric\_values, the resolved mode, and the returned window.

### update-autoscaling

```sh theme={"system"}
baseten model environment update-autoscaling [OPTIONS]
```

Update an environment's autoscaling settings, which apply to whichever deployment currently serves it.

Only the flags you pass are changed; every other setting is left alone.

Run `baseten model environment describe` to see the current values.

#### Options

**--autoscaling-window** `INTEGER`

Timeframe of traffic considered for autoscaling decisions, in seconds.

**--concurrency-target** `INTEGER`

Number of requests per replica before scaling up.

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--max-replica** `INTEGER`

Maximum number of replicas.

**--max-scale-down-rate** `INTEGER`

Maximum percentage of replicas that can be removed per autoscaling window (1-50). For example, 20 means at most 20% of replicas are removed per window.

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--scale-down-delay** `INTEGER`

Waiting period before scaling down any active replica, in seconds.

**--target-in-flight-tokens** `INTEGER`

Target number of in-flight tokens for autoscaling decisions. Early access only.

**--target-utilization-percentage** `INTEGER`

Target utilization percentage for scaling up and down.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--min-replica** `INTEGER`

Minimum number of replicas.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Raise the production environment's replica bounds

```sh theme={"system"}
baseten model environment update-autoscaling --model-id <model-id> --environment production --min-replica 2 --max-replica 10
```

#### Filter output with `--jq`

Print the environment's resulting minimum replica count

```sh theme={"system"}
baseten model environment update-autoscaling --model-id <model-id> --environment production --min-replica 2 --jq '.environment.autoscaling_settings.min_replica'
```

#### Output

**Text mode (`--output text`):** On success, prints "Updated autoscaling settings for environment `name`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.UpdateEnvironmentResponse`.

### update-promotion

```sh theme={"system"}
baseten model environment update-promotion [OPTIONS]
```

Update how deployments are promoted into an environment: whether to redeploy, whether to roll out gradually and with what rolling deploy config, what to do with the outgoing deployment, and whether to ramp up traffic.

Only the flags you pass are changed; every other setting is left alone.

To use [mixed mode](https://docs.baseten.co/deployment/rolling-deployments.md#provisioning-modes), set both `--max-surge-percent` and `--max-unavailable-percent` to positive values. Set the budget you want to disable to `0`. These settings apply to future promotions into the environment.

Inspect `promotion_settings` in the JSON output from [`model environment describe`](#describe).

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--max-surge-percent** `INTEGER`

Maximum percentage of the baseline replica count to provision as extra replicas across both deployments, including replicas still starting. Accepts integers from 0 to 100. Pass `0` to disable this budget; omit the flag to keep its current value. Both budgets can be positive in mixed mode. [Configure rolling deployments](https://docs.baseten.co/deployment/rolling-deployments.md#provisioning-modes).

**--max-unavailable-percent** `INTEGER`

Maximum percentage of the baseline replica count that can be unavailable through planned replica replacement. Accepts integers from 0 to 50. Pass `0` to disable this budget; omit the flag to keep its current value. Both budgets can be positive in mixed mode. [Configure rolling deployments](https://docs.baseten.co/deployment/rolling-deployments.md#provisioning-modes).

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--promotion-cleanup-strategy** `TEXT`

The cleanup strategy to use after a promotion completes.

One of: `keep`, `scale-to-zero`, `deactivate`

**--redeploy-on-promotion** `BOOL`

Whether to deploy on all promotions. Enabling this allows model code to safely handle environment-specific logic: when a deployment is promoted, a new deployment is created with a copy of the image. Pass `true` or `false` explicitly; omit the flag to leave this setting unchanged.

**--replica-overhead-percent** `INTEGER`

The replica overhead percentage for rolling deploys.

**--rolling-deploy** `BOOL`

Whether the environment should rely on rolling deploy orchestration. Pass `true` or `false` explicitly; omit the flag to leave this setting unchanged.

**--rolling-deploy-strategy** `TEXT`

The rolling deploy strategy to use for promotions.

One of: `replica`

**--stabilization-time-seconds** `INTEGER`

The stabilization time for rolling deploys, in seconds.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Turn on rolling deploys and scale the outgoing deployment to zero

```sh theme={"system"}
baseten model environment update-promotion --model-id <model-id> --environment production --rolling-deploy true --promotion-cleanup-strategy scale-to-zero
```

Slow the rollout by lowering the surge percentage

```sh theme={"system"}
baseten model environment update-promotion --model-id <model-id> --environment production --max-surge-percent 10
```

**To configure mixed mode**:

Replace `<MODEL_ID>` with your model's ID and run the following command:

```sh Command theme={"system"}
baseten model environment update-promotion --model-id "<MODEL_ID>" \
  --environment production \
  --rolling-deploy true \
  --max-surge-percent 25 \
  --max-unavailable-percent 10 \
  --jq '.environment.promotion_settings.rolling_deploy_config | {max_surge_percent, max_unavailable_percent}'
```

```json Output theme={"system"}
{
  "max_surge_percent": 25,
  "max_unavailable_percent": 10
}
```

#### Filter output with `--jq`

Print the resulting cleanup strategy

```sh theme={"system"}
baseten model environment update-promotion --model-id <model-id> --environment production --rolling-deploy true --jq '.environment.promotion_settings.promotion_cleanup_strategy'
```

#### Output

**Text mode (`--output text`):** On success, prints "Updated promotion settings for environment `name`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.UpdateEnvironmentResponse`.

### update-request-backpressure

```sh theme={"system"}
baseten model environment update-request-backpressure [OPTIONS]
```

Set the policy applied when the environment's request queue is full. Pass `--policy null` to clear an existing policy and fall back to the default.

Run `baseten model environment describe` to see the current values.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--policy** `TEXT | null` *required*

Backpressure policy to apply. Pass null to clear an existing policy.

One of: `queue-on-full`, `reject-on-full`, `null`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Reject requests once the queue is full

```sh theme={"system"}
baseten model environment update-request-backpressure --model-id <model-id> --environment production --policy reject-on-full
```

Clear the policy

```sh theme={"system"}
baseten model environment update-request-backpressure --model-id <model-id> --environment production --policy null
```

#### Filter output with `--jq`

Print the resulting policy

```sh theme={"system"}
baseten model environment update-request-backpressure --model-id <model-id> --environment production --policy reject-on-full --jq '.environment.request_backpressure_settings.policy'
```

#### Output

**Text mode (`--output text`):** The resulting policy, or "none" when no policy is set.

**JSON mode (`--output json`):** payload type `managementapi.UpdateEnvironmentResponse`.

## environment autoscaling-schedule

A schedule scales an environment to a target replica count over a recurring or one-time window. Manage the schedules themselves and the timezone they share.

### create

```sh theme={"system"}
baseten model environment autoscaling-schedule create [OPTIONS]
```

Add one autoscaling schedule to an environment.

`--cadence` selects the schedule's shape. 'daily' and 'hourly' are recurring and need `--weekdays` and a minute window; 'one-time' runs once and needs `--start-at` and `--end-at` instead.

`--min-replica` and `--max-replica` are required. Any other autoscaling flag you omit is inherited from the environment while the schedule is active.

`--timezone` is required for the first schedule on an environment, since the timezone is shared by the whole collection and has no default. Afterwards it is optional and must match the existing one; use 'update-settings' to change it for every schedule at once.

Run 'baseten model environment describe' to see the current values.

#### Options

**--autoscaling-window** `INTEGER`

Timeframe of traffic considered for autoscaling decisions, in seconds.

**--cadence** `TEXT` *required*

Shape of the schedule. Recurring schedules use `--weekdays` and a minute window; one-time schedules use `--start-at` and `--end-at`.

One of: `daily`, `hourly`, `one-time`

**--concurrency-target** `INTEGER`

Number of requests per replica before scaling up.

**--enabled** `BOOL`

Whether the schedule is enabled. Defaults to true on create.

**--end-at** `TEXT`

Exclusive end of the window, ISO 8601. One-time schedules only.

**--end-hour** `INTEGER`

Hour the window closes, in the collection timezone. Omit for an hourly schedule that runs every hour. Recurring schedules only.

**--end-minute** `INTEGER`

Minute the window closes. Recurring schedules only.

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--max-replica** `INTEGER`

Maximum number of replicas.

**--max-scale-down-rate** `INTEGER`

Maximum percentage of replicas that can be removed per autoscaling window (1-50). For example, 20 means at most 20% of replicas are removed per window.

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**--name** `TEXT` *required*

Name of the schedule, unique among the environment's schedules.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--scale-down-delay** `INTEGER`

Waiting period before scaling down any active replica, in seconds.

**--start-at** `TEXT`

Inclusive start of the window, ISO 8601 (for example 2026-09-01T08:00). Values without a timezone designator are read in the local timezone. Must be in the future. One-time schedules only.

**--start-hour** `INTEGER`

Hour the window opens, in the collection timezone. Omit for an hourly schedule that runs every hour. Recurring schedules only.

**--start-minute** `INTEGER`

Minute the window opens. Recurring schedules only.

**--target-in-flight-tokens** `INTEGER`

Target number of in-flight tokens for autoscaling decisions. Early access only.

**--target-utilization-percentage** `INTEGER`

Target utilization percentage for scaling up and down.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--timezone** `TEXT`

IANA timezone shared by every schedule on the environment, for example America/New\_York. Required for the first schedule; afterwards it must match the existing one.

**--weekdays** `TEXT (repeatable)`

Weekdays the schedule runs, comma-separated. Recurring schedules only.

One of: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`

**--min-replica** `INTEGER`

Minimum number of replicas.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Scale up on weekday mornings

```sh theme={"system"}
baseten model environment autoscaling-schedule create --model-id <model-id> --environment production --name weekday-peak --cadence daily --weekdays monday,tuesday,wednesday,thursday,friday --start-hour 8 --start-minute 0 --end-hour 18 --end-minute 0 --timezone America/New_York --min-replica 4 --max-replica 20
```

Scale up for a one-off launch window

```sh theme={"system"}
baseten model environment autoscaling-schedule create --model-id <model-id> --environment production --name launch --cadence one-time --start-at 2026-09-01T08:00 --end-at 2026-09-01T20:00 --timezone America/New_York --min-replica 10 --max-replica 50
```

#### Filter output with `--jq`

Print the ids of every schedule after the create

```sh theme={"system"}
baseten model environment autoscaling-schedule create --model-id <model-id> --environment production --name weekday-peak --cadence daily --weekdays monday --start-minute 0 --end-minute 0 --timezone UTC --min-replica 1 --max-replica 2 --jq '.environment.autoscaling_schedules.schedules[].id'
```

#### Output

**Text mode (`--output text`):** On success, prints "Created autoscaling schedule `name`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.UpdateEnvironmentResponse`.

### delete

```sh theme={"system"}
baseten model environment autoscaling-schedule delete [OPTIONS]
```

Remove one autoscaling schedule from an environment, identified by id or by name.

Run 'baseten model environment autoscaling-schedule list' to see both.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--schedule-id** `TEXT`

Stable identifier of the schedule, from 'autoscaling-schedule list'.

Mutually exclusive with other flags in group `schedule-ref`.

**--schedule-name** `TEXT`

Name of the schedule, unique among the environment's schedules.

Mutually exclusive with other flags in group `schedule-ref`.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Delete a schedule by id

```sh theme={"system"}
baseten model environment autoscaling-schedule delete --model-id <model-id> --environment production --schedule-id <schedule-id>
```

Delete a schedule by name

```sh theme={"system"}
baseten model environment autoscaling-schedule delete --model-id <model-id> --environment production --schedule-name weekday-peak
```

#### Filter output with `--jq`

Print the ids that remain

```sh theme={"system"}
baseten model environment autoscaling-schedule delete --model-id <model-id> --environment production --schedule-id <schedule-id> --jq '.environment.autoscaling_schedules.schedules[].id'
```

#### Output

**Text mode (`--output text`):** On success, prints "Deleted autoscaling schedule `id`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.UpdateEnvironmentResponse`.

### list

```sh theme={"system"}
baseten model environment autoscaling-schedule list [OPTIONS]
```

List every autoscaling schedule on an environment with its id, which the update and delete commands take.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

List an environment's schedules

```sh theme={"system"}
baseten model environment autoscaling-schedule list --model-id <model-id> --environment production
```

#### Filter output with `--jq`

Print each schedule's id and name

```sh theme={"system"}
baseten model environment autoscaling-schedule list --model-id <model-id> --environment production --jq '.schedules[] | "\(.id) \(.name)"'
```

#### Output

**Text mode (`--output text`):** Table with columns: ID, NAME, CADENCE, ENABLED, WINDOW, REPLICAS. When no schedules exist, prints "No autoscaling schedules found." to stderr.

**JSON mode (`--output json`):** payload type `managementapi.EnvironmentAutoscalingSchedules`.

### update

```sh theme={"system"}
baseten model environment autoscaling-schedule update [OPTIONS]
```

Change one autoscaling schedule, identified by id or by name.

Only the flags you pass are changed; the rest of the schedule is preserved. Because the API replaces a schedule wholesale, the command reads the environment first and merges your changes into the existing schedule.

Pass `--cadence` to change a schedule's shape. The new shape's timing flags are then required, since a recurring window and a one-time interval have nothing in common to carry over; the name, enabled state, and autoscaling overrides carry over either way.

`--timezone` is not accepted here, because it belongs to the whole collection; use 'update-settings'.

#### Options

**--autoscaling-window** `INTEGER`

Timeframe of traffic considered for autoscaling decisions, in seconds.

**--cadence** `TEXT`

New shape for the schedule. Changing it requires the new shape's timing flags, since there is nothing to carry over.

One of: `daily`, `hourly`, `one-time`

**--concurrency-target** `INTEGER`

Number of requests per replica before scaling up.

**--enabled** `BOOL`

Whether the schedule is enabled. Pass `true` or `false` explicitly; omit the flag to leave this setting unchanged.

**--end-at** `TEXT`

Exclusive end of the window, ISO 8601. One-time schedules only.

**--end-hour** `INTEGER`

Hour the window closes, in the collection timezone. Omit for an hourly schedule that runs every hour. Recurring schedules only.

**--end-minute** `INTEGER`

Minute the window closes. Recurring schedules only.

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--max-replica** `INTEGER`

Maximum number of replicas.

**--max-scale-down-rate** `INTEGER`

Maximum percentage of replicas that can be removed per autoscaling window (1-50). For example, 20 means at most 20% of replicas are removed per window.

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**--name** `TEXT`

New name for the schedule, unique among the environment's schedules.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--scale-down-delay** `INTEGER`

Waiting period before scaling down any active replica, in seconds.

**--schedule-id** `TEXT`

Stable identifier of the schedule, from 'autoscaling-schedule list'.

Mutually exclusive with other flags in group `schedule-ref`.

**--schedule-name** `TEXT`

Name of the schedule, unique among the environment's schedules.

Mutually exclusive with other flags in group `schedule-ref`.

**--start-at** `TEXT`

Inclusive start of the window, ISO 8601 (for example 2026-09-01T08:00). Values without a timezone designator are read in the local timezone. Must be in the future. One-time schedules only.

**--start-hour** `INTEGER`

Hour the window opens, in the collection timezone. Omit for an hourly schedule that runs every hour. Recurring schedules only.

**--start-minute** `INTEGER`

Minute the window opens. Recurring schedules only.

**--target-in-flight-tokens** `INTEGER`

Target number of in-flight tokens for autoscaling decisions. Early access only.

**--target-utilization-percentage** `INTEGER`

Target utilization percentage for scaling up and down.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--weekdays** `TEXT (repeatable)`

Weekdays the schedule runs, comma-separated. Recurring schedules only.

One of: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`

**--min-replica** `INTEGER`

Minimum number of replicas.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Raise a schedule's replica floor

```sh theme={"system"}
baseten model environment autoscaling-schedule update --model-id <model-id> --environment production --schedule-id <schedule-id> --min-replica 6
```

Turn a schedule off without deleting it, naming it instead of using its id

```sh theme={"system"}
baseten model environment autoscaling-schedule update --model-id <model-id> --environment production --schedule-name weekday-peak --enabled false
```

Convert a recurring schedule into a one-time one

```sh theme={"system"}
baseten model environment autoscaling-schedule update --model-id <model-id> --environment production --schedule-name weekday-peak --cadence one-time --start-at 2026-09-01T08:00 --end-at 2026-09-01T20:00
```

#### Filter output with `--jq`

Print the resulting schedule names

```sh theme={"system"}
baseten model environment autoscaling-schedule update --model-id <model-id> --environment production --schedule-id <schedule-id> --min-replica 6 --jq '.environment.autoscaling_schedules.schedules[].name'
```

#### Output

**Text mode (`--output text`):** On success, prints "Updated autoscaling schedule `id`" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.UpdateEnvironmentResponse`.

### update-settings

```sh theme={"system"}
baseten model environment autoscaling-schedule update-settings [OPTIONS]
```

Change the settings shared by all of an environment's autoscaling schedules. Today that is only the timezone.

Setting the timezone rewrites every existing schedule, which is why it lives here rather than on 'update'. The environment must already have at least one schedule, since the timezone is stored per schedule.

Run 'baseten model environment autoscaling-schedule list' to see the schedules this affects.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--timezone** `TEXT` *required*

IANA timezone to apply to every schedule on the environment, for example America/New\_York.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Move every schedule to a new timezone

```sh theme={"system"}
baseten model environment autoscaling-schedule update-settings --model-id <model-id> --environment production --timezone Europe/Berlin
```

#### Filter output with `--jq`

Print the resulting timezone

```sh theme={"system"}
baseten model environment autoscaling-schedule update-settings --model-id <model-id> --environment production --timezone Europe/Berlin --jq '.environment.autoscaling_schedules.timezone'
```

#### Output

**Text mode (`--output text`):** On success, prints "Updated autoscaling schedule settings" to stderr; no stdout output.

**JSON mode (`--output json`):** payload type `managementapi.UpdateEnvironmentResponse`.

## environment traffic-rule

> [!NOTE]
>
> PRE-RELEASE: Traffic routing rules are not GA yet. Their arguments, flags, and output may change.

A traffic routing rule changes what happens to requests that reach an environment. A shadow rule sends a copy of a percentage of the environment's traffic to another environment or a specific deployment and discards the responses, so you can test a candidate there against live traffic.

A rule names its target once. Send traffic somewhere else by deleting the rule and creating a new one. Every rule carries an expiry, at most 7 days out. [`model environment describe`](https://docs.baseten.co/reference/cli/baseten/model#describe-2) shows an environment's active rules.

### list

```sh theme={"system"}
baseten model environment traffic-rule list [OPTIONS]
```

Lists every active rule on an environment with the ID that `update` and `delete` take.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

List an environment's rules

```sh theme={"system"}
baseten model environment traffic-rule list --model-id <model-id> --environment production
```

#### Filter output with `--jq`

Print each rule's ID and percentage

```sh theme={"system"}
baseten model environment traffic-rule list --model-id <model-id> --environment production --jq '.rules[] | "\(.id) \(.percent_traffic)"'
```

#### Output

**Text mode (`--output text`):** Table with columns: ID, TYPE, TARGET, PERCENT, SAMPLING MODE, PROPAGATE CANCELLATION, EXPIRES. When no rules exist, prints "No traffic rules found." to stderr.

**JSON mode (`--output json`):** Go output type `managementapi.EnvironmentTrafficRouting`.

### create

```sh theme={"system"}
baseten model environment traffic-rule create [OPTIONS]
```

Adds a rule to an environment. Set one target with `--target-environment` or `--target-deployment-id`. A target environment sends the shadow traffic to whichever deployment that environment is serving.

`--sampling-mode random` picks each request independently. `--sampling-mode user-session` keeps a whole session together, so every request in a sampled session is shadowed. `--expires-at` takes an ISO 8601 time such as `2026-11-02T18:00`, at most 7 days out. `--propagate-client-cancellation` decides whether a shadow request is cancelled when the original client disconnects, and it needs an explicit `true` or `false`.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**--expires-at** `TEXT` *required*

When the rule stops, ISO 8601 (for example 2026-10-08T18:00), at most 7 days out. Values without a timezone designator are read in the local timezone.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--percent-traffic** `INTEGER` *required*

Percentage of the environment's traffic to shadow.

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--propagate-client-cancellation** `BOOL` *required*

Whether a shadow request is cancelled when the original client disconnects.

**--sampling-mode** `TEXT` *required*

How requests are picked for shadowing. random picks each request independently. user-session keeps a whole session together.

One of: `random`, `user-session`

**--target-deployment-id** `TEXT`

ID of the target deployment.

Mutually exclusive with other flags in group `target`.

**--target-environment** `TEXT`

Name of the target environment. Traffic goes to whichever deployment the environment is serving.

Mutually exclusive with other flags in group `target`.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--type** `TEXT` *required*

Rule type. A shadow rule sends a copy of the environment's traffic to its target.

One of: `shadow`

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Shadow 25% of production's traffic to staging

```sh theme={"system"}
baseten model environment traffic-rule create --model-id <model-id> --environment production --type shadow --target-environment staging --percent-traffic 25 --expires-at <iso-time-within-7-days> --sampling-mode user-session --propagate-client-cancellation true
```

Shadow 10% of production's traffic to a specific deployment

```sh theme={"system"}
baseten model environment traffic-rule create --model-id <model-id> --environment production --type shadow --target-deployment-id <deployment-id> --percent-traffic 10 --expires-at <iso-time-within-7-days> --sampling-mode random --propagate-client-cancellation false
```

#### Filter output with `--jq`

Print the IDs of the environment's active rules after the create

```sh theme={"system"}
baseten model environment traffic-rule create --model-id <model-id> --environment production --type shadow --target-environment staging --percent-traffic 25 --expires-at <iso-time-within-7-days> --sampling-mode random --propagate-client-cancellation false --jq '.environment.traffic_routing.rules[].id'
```

#### Output

**Text mode (`--output text`):** Prints "Created traffic rule" to stderr; nothing on stdout.

**JSON mode (`--output json`):** Go output type `managementapi.UpdateEnvironmentResponse`.

### update

```sh theme={"system"}
baseten model environment traffic-rule update [OPTIONS]
```

Changes one rule, identified by `--rule-id`. Only the flags you pass change; the command reads the environment, merges your flags into the existing rule, and writes it back, because the API replaces a rule wholesale.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**--expires-at** `TEXT`

New time the rule stops, ISO 8601 (for example 2026-10-08T18:00), at most 7 days out. Values without a timezone designator are read in the local timezone.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--percent-traffic** `INTEGER`

New percentage of the environment's traffic to shadow.

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--propagate-client-cancellation** `BOOL`

Whether a shadow request is cancelled when the original client disconnects.

**--rule-id** `TEXT` *required*

ID of the rule. Run 'baseten model environment traffic-rule list' to see the environment's rules.

**--sampling-mode** `TEXT`

New way requests are picked for shadowing.

One of: `random`, `user-session`

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Raise the percentage of traffic a rule shadows

```sh theme={"system"}
baseten model environment traffic-rule update --model-id <model-id> --environment production --rule-id <rule-id> --percent-traffic 50
```

#### Filter output with `--jq`

Print each active rule's percentage after the update

```sh theme={"system"}
baseten model environment traffic-rule update --model-id <model-id> --environment production --rule-id <rule-id> --percent-traffic 50 --jq '.environment.traffic_routing.rules[].percent_traffic'
```

#### Output

**Text mode (`--output text`):** Prints "Updated traffic rule `id`" to stderr; nothing on stdout.

**JSON mode (`--output json`):** Go output type `managementapi.UpdateEnvironmentResponse`.

### delete

```sh theme={"system"}
baseten model environment traffic-rule delete [OPTIONS]
```

Removes one rule from an environment, identified by `--rule-id`.

Prompts for yes/no confirmation. Pass `--yes` to skip the prompt. When stdin is not a terminal, `--yes` is required.

#### Options

**--environment** `TEXT` *required*

Name of the environment (e.g. production). Run 'baseten model environment list' to see a model's environments.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**--model-id** `TEXT`

ID of the model.

Mutually exclusive with other flags in group `model-ref`.

**--model-name** `TEXT`

Name of the model. Use `--team` to disambiguate when the same name exists in multiple teams.

Mutually exclusive with other flags in group `model-ref`.

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--rule-id** `TEXT` *required*

ID of the rule. Run 'baseten model environment traffic-rule list' to see the environment's rules.

**--team** `TEXT`

Team name or ID. Only valid with `--model-name`.

**--yes** `BOOL`

Skip the interactive confirmation prompt. Required when stdin is not a terminal.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Delete a rule

```sh theme={"system"}
baseten model environment traffic-rule delete --model-id <model-id> --environment production --rule-id <rule-id> --yes
```

#### Filter output with `--jq`

Print the IDs of the rules that remain

```sh theme={"system"}
baseten model environment traffic-rule delete --model-id <model-id> --environment production --rule-id <rule-id> --yes --jq '.environment.traffic_routing.rules[].id'
```

#### Output

**Text mode (`--output text`):** Prints "Deleted traffic rule `id`" to stderr; nothing on stdout.

**JSON mode (`--output json`):** Go output type `managementapi.UpdateEnvironmentResponse`.

## image

Build a local Docker image, or just its Docker build context, from a model directory.

These commands run entirely locally: they shell out to the truss CLI (via 'uv') to generate the build context and to 'docker' to build the image. They need no authentication and make no Baseten API calls. 'uv' must be on PATH; 'build' also requires 'docker'.

### build

```sh theme={"system"}
baseten model image build [OPTIONS] [-- DOCKER_BUILD_ARGS...]
```

Generate the Docker build context for a model directory and build it into a local Docker image.

The current directory is used by default; pass `--dir` to point at a model directory elsewhere. The build context is written to a temporary directory that is removed afterward unless `--build-dir` is given.

Any arguments after '--' are passed through verbatim to 'docker build'. If you supply your own `--iidfile` there, it is honored and used to report the image ID; otherwise one is injected internally.

#### Options

**--build-dir** `TEXT`

Directory for the Docker build context. Defaults to a temp dir removed after the build.

**--cache-mount-id** `TEXT`

Enable a persistent apt/pip/uv build cache keyed by this id.

**--dir** `TEXT` (default: .)

Model directory.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--root-user** `BOOL`

Run the image's container as root instead of the default non-root user.

**--tag** `TEXT`

Image tag. Defaults to '`model_name`:latest' from config.yaml.

**--truss-executable** `TEXT`

Run this truss executable instead of fetching one with uv, e.g. a virtualenv's bin/truss. A value with no path separator is looked up on PATH, so '`--truss-executable` truss' runs the truss you installed. Defaults to BASETEN\_TRUSS\_EXECUTABLE.

**--truss-version** `TEXT`

Version of truss to fetch and run with 'uv tool run', e.g. 0.18.26. Defaults to BASETEN\_TRUSS\_VERSION, or the latest release. Mutually exclusive with `--truss-executable`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Build the current directory into a local Docker image

```sh theme={"system"}
baseten model image build
```

Build another directory with a custom tag

```sh theme={"system"}
baseten model image build --dir ./my-model --tag my-model:dev
```

Pass extra flags through to docker build

```sh theme={"system"}
baseten model image build -- --no-cache --build-arg FOO=bar
```

#### Filter output with `--jq`

Print the built image ID

```sh theme={"system"}
baseten model image build --jq '.image_id'
```

#### Output

**Text mode (`--output text`):** Build progress from truss and docker is streamed to stderr. On success a one-line summary is printed to stdout.

**JSON mode (`--output json`):** payload type `cmd.ModelImageBuildResult`.

Under `--output` json, stdout is the \{image\_id, tag} result. image\_id is empty when it cannot be resolved (e.g. a custom buildx builder that does not write the iidfile).

### prepare

```sh theme={"system"}
baseten model image prepare [OPTIONS] --build-dir DIR
```

Generate the Docker build context (Dockerfile and supporting files) for a model directory into `--build-dir`, without building an image.

The current directory is used by default; pass `--dir` to point at a model directory elsewhere. The resulting directory is self-contained and can be built with 'docker build `build-dir`'.

#### Options

**--build-dir** `TEXT` *required*

Directory for the Docker build context. Created if absent and kept.

**--cache-mount-id** `TEXT`

Enable a persistent apt/pip/uv build cache keyed by this id.

**--dir** `TEXT` (default: .)

Model directory.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies `--output` json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--root-user** `BOOL`

Run the image's container as root instead of the default non-root user.

**--truss-executable** `TEXT`

Run this truss executable instead of fetching one with uv, e.g. a virtualenv's bin/truss. A value with no path separator is looked up on PATH, so '`--truss-executable` truss' runs the truss you installed. Defaults to BASETEN\_TRUSS\_EXECUTABLE.

**--truss-version** `TEXT`

Version of truss to fetch and run with 'uv tool run', e.g. 0.18.26. Defaults to BASETEN\_TRUSS\_VERSION, or the latest release. Mutually exclusive with `--truss-executable`.

**-v, --verbose** `BOOL`

Enable verbose logging

#### Examples

Write the current directory's build context to ./ctx

```sh theme={"system"}
baseten model image prepare --build-dir ./ctx
```

#### Filter output with `--jq`

Print the generated Dockerfile path

```sh theme={"system"}
baseten model image prepare --build-dir ./ctx --jq '.dockerfile'
```

#### Output

**Text mode (`--output text`):** Progress from truss is streamed to stderr. On success a one-line summary is printed to stdout.

**JSON mode (`--output json`):** payload type `cmd.ModelImagePrepareResult`.

Under `--output` json, stdout is the \{build\_dir, dockerfile} result with absolute paths.
