Skip to main content
Create, list, and push Baseten models. Authentication is through baseten auth login or the BASETEN_API_KEY environment variable.

push

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

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.
INTEGER
Timeframe of traffic considered for autoscaling decisions, in seconds.
INTEGER
Number of requests per replica before scaling up.
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.
TEXT
Deployment timeout as a duration (e.g. 30m, 1h); allowed range 10m to 24h.
TEXT
Human-readable name for the new deployment.
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.
TEXT
Model directory to push. Defaults to the current directory when --file is not set.
BOOL
Disable archive download for the new model. Only valid for new models.
BOOL
Validate the push and request upload credentials without uploading or creating anything.
TEXT
Stable environment to push to. Run ‘baseten model environment list’ to see a model’s environments.
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.
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.
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 for the available types. Cannot be combined with --preserve-env-instance-type.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
User-provided labels for the deployment as a JSON object, e.g. ’{“team”:“ml”,“priority”:1}’.
INTEGER
Maximum number of replicas.
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.
BOOL
Force a full rebuild without using cached layers.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
INTEGER
For this promotion only, the maximum surge percentage for rolling deploys.
INTEGER
For this promotion only, the maximum unavailable percentage for rolling deploys.
TEXT
Override the model_name from config.yaml for this push only. The on-disk config.yaml is not modified.
TEXT
For this promotion only, the cleanup strategy to use after it completes.One of: keep, scale-to-zero, deactivate
INTEGER
For this promotion only, the replica overhead percentage for rolling deploys.
BOOL
For this promotion only, whether to use rolling deploy orchestration.
TEXT
For this promotion only, the rolling deploy strategy.One of: replica
INTEGER
For this promotion only, the stabilization time for rolling deploys, in seconds.
BOOL
Keep the target environment’s current instance type instead of applying the one from config.yaml. Only meaningful when an environment is targeted.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
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.
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
INTEGER
Waiting period before scaling down any active replica, in seconds.
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.
INTEGER
Target number of in-flight tokens for autoscaling decisions. Early access only.
INTEGER
Target utilization percentage for scaling up and down.
TEXT
Team the model belongs to. Only valid for new models.
BOOL
Block until the deployment is active. Exits non-zero on a terminal-failure status.
BOOL
After pushing, watch the model directory and live-patch the development deployment on change. Implies --develop.
BOOL
With --watch, hot-reload the running container when every change is to model code; mixed changes fall back to a cold patch.
BOOL
With --watch, let the development deployment scale to zero while watching. By default it is kept warm by periodic pings.
INTEGER
Minimum number of replicas.
BOOL
For this promotion only, whether to create a new deployment with a copy of the image.
BOOL
Enable verbose logging

Examples

Push the current directory as a new deployment
Push and stream build/runtime logs until the deployment is active
Push a single configuration file directly:
Read the configuration from standard input:
Push with an instance type and autoscaling settings for the new deployment

Filter output with --jq

Print the new deployment’s 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. 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

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

TEXT
default:"."
Model directory to watch. Defaults to the current directory.
BOOL
Hot-reload the running container when every change is to model code; mixed changes fall back to a cold patch.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
BOOL
Let the development deployment scale to zero while watching. By default it is kept warm by periodic pings.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team the model belongs to. Use to disambiguate when the same model_name exists in multiple teams.
BOOL
Enable verbose logging

Examples

Watch the current directory against its model’s development deployment
Watch another directory and hot-reload on model-code changes

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

List Baseten models.

Options

TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID to scope the listing to. Defaults to all teams the caller can see.
BOOL
Enable verbose logging

Examples

List all models accessible to the caller
List only models in a specific team

Filter output with --jq

Print just the model IDs

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

Describe a Baseten model.

Options

TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Describe a model by ID
Describe a model by name

Filter output with --jq

Print the 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

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

TEXT
Inline JSON request body. The shape is the deployed model’s own input schema; see https://docs.baseten.co/inference/calling-your-model.Mutually exclusive with other flags in group predict-input.
TEXT
Specific deployment to target. Mutually exclusive with --environment, --deployment-name, and --regional.
TEXT
Name of the deployment to target. Mutually exclusive with --environment, --deployment-id, and --regional.
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.
TEXT
Path to a JSON file containing the request body. Use ’-’ for stdin.Mutually exclusive with other flags in group predict-input.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Regional environment name; routes through the regional hostname. Mutually exclusive with —environment, —deployment-id, and —deployment-name.
TEXT
Team name or ID. Only valid with --model-name.
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.
BOOL
Enable verbose logging

Examples

Send an inline JSON body
Send a request body from a file

Filter output with --jq

Extract a field when the model returns JSON

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

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

TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Delete by ID without confirmation
Delete by name with interactive confirmation

Filter output with --jq

Print the deleted model’s 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

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

TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
required
New name for the model, unique within its team.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Rename by ID
Rename by name, scoped to a team

Filter output with --jq

Print the model’s new 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

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

TEXT (repeatable)
Only return entries referencing one of these model deployment IDs. May be repeated.
TEXT
default:"desc"
Sort order by the time the action occurred: ‘desc’ (newest first) or ‘asc’ (oldest first).One of: asc, desc
TEXT
End of the time window. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. Defaults to now.
TEXT (repeatable)
Only return entries for one of these environments. May be repeated.
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.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
INTEGER
default:"20"
Maximum number of entries to return, paging as needed. Use 0 for no limit (every entry in the window).
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
Case-insensitive substring matched against resource names and IDs in the entry.
TEXT
Shortcut for a window from a relative time ago until now. Accepts a duration (e.g. ‘30m’, ‘1h30m’) or ‘Nd’ (e.g. ‘3d’). Mutually exclusive with --start and --end.
TEXT (repeatable)
Only return entries issued from one of these surfaces. May be repeated. One of: ui, api, mcp, other.
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.
TEXT
Team name or ID. Only valid with --model-name.
TEXT (repeatable)
Only return entries whose acting user is one of these IDs. May be repeated.
BOOL
Enable verbose logging

Examples

List the 20 most recent audit-log entries for a model
List promote events for a model over the last 30 days

Filter output with --jq

Stream each entry’s event type as a JSONL stream

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

Activate a model deployment.

Options

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Activate a deployment

Filter output with --jq

Print just the success flag

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

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

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Print the deployment’s config.yaml

Filter output with --jq

Extract the parsed model_name field

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

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

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Deactivate a deployment without the confirmation prompt

Filter output with --jq

Print just the success flag

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

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

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
Extract the model source tar into this directory.Mutually exclusive with other flags in group download-out.
TEXT
Save the model source as an uncompressed tar file at this path.Mutually exclusive with other flags in group download-out.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
BOOL
Allow overwriting an existing file or non-empty directory.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Save the model source as a tar file
Extract the model source into a directory

Filter output with --jq

Print just the destination path

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

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, including mixed mode (beta) when enabled for your organization. Configure those settings with model environment 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

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.
INTEGER
Timeframe of traffic considered for autoscaling decisions, in seconds.
INTEGER
Number of requests per replica before scaling up.
TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
default:"production"
Target environment name. Defaults to production.
TEXT
Instance type to set on the environment, for example A10Gx4x16. See https://docs.baseten.co/deployment/resources for the available types. Cannot be combined with --preserve-env-instance-type.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
INTEGER
Maximum number of replicas.
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.
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
INTEGER
For this promotion only, the maximum surge percentage for rolling deploys.
INTEGER
For this promotion only, the maximum unavailable percentage for rolling deploys.
TEXT
For this promotion only, the cleanup strategy to use after it completes.One of: keep, scale-to-zero, deactivate
INTEGER
For this promotion only, the replica overhead percentage for rolling deploys.
BOOL
For this promotion only, whether to use rolling deploy orchestration.
TEXT
For this promotion only, the rolling deploy strategy.One of: replica
INTEGER
For this promotion only, the stabilization time for rolling deploys, in seconds.
BOOL
Keep the target environment’s current instance type instead of applying the promoted deployment’s.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Region slug to set on the environment. Pass an empty string for Global. Run ‘baseten org regions’ to see the slugs available.
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
INTEGER
Waiting period before scaling down any active replica, in seconds.
INTEGER
Target number of in-flight tokens for autoscaling decisions. Early access only.
INTEGER
Target utilization percentage for scaling up and down.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
INTEGER
Minimum number of replicas.
BOOL
For this promotion only, whether to create a new deployment with a copy of the image.
BOOL
Enable verbose logging

Examples

Promote a deployment to production without the confirmation prompt
Promote to a non-production environment using the deployment’s own instance type
Promote to production and switch the environment to a different instance type

Filter output with --jq

Print the promoted deployment’s 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

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

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Delete a deployment without the confirmation prompt

Filter output with --jq

Print the deleted deployment’s 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

Describe a model deployment by ID.

Options

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Describe a deployment by ID

Filter output with --jq

Print just the deployment status

Output

Text mode (--output text): Field-per-line summary: ID, Name, Model, Environment (optional), Status, Instance (optional), Replicas, Created. JSON mode (--output json): payload type managementapi.Deployment.

list

List all deployments of a model.

Options

TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

List all deployments of a model

Filter output with --jq

Print just the deployment IDs

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

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.

Options

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
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.
TEXT (repeatable)
Case-sensitive substring; lines containing it are dropped. May be repeated.
TEXT (repeatable)
Case-sensitive substring that must appear in the log message. May be repeated; all must match.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
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.
TEXT
Only return logs at or above this severity level.One of: debug, info, warning, error
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Only return logs emitted by this replica (5-char short ID).
TEXT
Only return logs tagged with this inference request ID.
TEXT
RE2 regular expression matched against the log message. Prefer --includes and --excludes for plain substring matches.
TEXT
Shortcut for fetching logs from a relative time ago until now. Accepts a duration (e.g. ‘30m’, ‘1h30m’) or ‘Nd’ (e.g. ‘3d’). Maximum ‘7d’. Mutually exclusive with --start and --end.
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.
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.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Print logs for a deployment over the last hour
Print logs for a fixed time range
Tail live logs until the deployment leaves a runnable state
Filter to warnings and above that contain a term

Filter output with --jq

Stream just the log messages as a JSONL stream

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

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

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
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.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT (repeatable)
Name of a metric to return; see https://docs.baseten.co/observability/export-metrics/supported-metrics for the available names. May be repeated. When omitted, a default set is returned.
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
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
BOOL
For --mode series, emit a per-step table instead of sparklines.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Shortcut for a window from a relative time ago until now. Accepts a duration (e.g. ‘30m’, ‘1h30m’) or ‘Nd’ (e.g. ‘3d’). Maximum ‘7d’. Mutually exclusive with --start and --end.
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.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Show a current snapshot of the default metrics
Summarize request volume and latency over the last hour
Plot a series over the last 6 hours

Filter output with --jq

Print the metric names returned

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

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

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
required
New name for the deployment, unique among the model’s deployments. Only alphanumeric characters, hyphens, underscores, and periods are allowed.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Rename a deployment

Filter output with --jq

Print the deployment’s new 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

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

INTEGER
Timeframe of traffic considered for autoscaling decisions, in seconds.
INTEGER
Number of requests per replica before scaling up.
TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
INTEGER
Maximum number of replicas.
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.
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
INTEGER
Waiting period before scaling down any active replica, in seconds.
INTEGER
Target number of in-flight tokens for autoscaling decisions. Early access only.
INTEGER
Target utilization percentage for scaling up and down.
TEXT
Team name or ID. Only valid with --model-name.
INTEGER
Minimum number of replicas.
BOOL
Enable verbose logging

Examples

Raise a deployment’s replica bounds
Shorten the scale-down delay, leaving every other setting unchanged

Filter output with --jq

Print just the 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

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

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT | null
required
Backpressure policy to apply. Pass null to clear an existing policy.One of: queue-on-full, reject-on-full, null
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Reject requests once the queue is full
Clear the policy

Filter output with --jq

Print the resulting 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

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

TEXT
ID of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Name of the deployment.Mutually exclusive with other flags in group deployment-ref.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
required
ID of the replica.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Terminate a replica without the confirmation prompt

Filter output with --jq

Print just the success flag

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

Activate the deployment associated with an environment.

Options

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Activate the deployment associated with an environment

Filter output with --jq

Print just the success flag

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

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

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Deactivate an environment without the confirmation prompt

Filter output with --jq

Print just the success flag

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

Describe a model environment by name.

Options

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Describe the production environment of a model

Filter output with --jq

Print the 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

List all environments of a model.

Options

TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

List all environments of a model

Filter output with --jq

Print just the environment names

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

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.

Options

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.
TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT (repeatable)
Case-sensitive substring; lines containing it are dropped. May be repeated.
TEXT (repeatable)
Case-sensitive substring that must appear in the log message. May be repeated; all must match.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
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.
TEXT
Only return logs at or above this severity level.One of: debug, info, warning, error
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Only return logs emitted by this replica (5-char short ID).
TEXT
Only return logs tagged with this inference request ID.
TEXT
RE2 regular expression matched against the log message. Prefer --includes and --excludes for plain substring matches.
TEXT
Shortcut for fetching logs from a relative time ago until now. Accepts a duration (e.g. ‘30m’, ‘1h30m’) or ‘Nd’ (e.g. ‘3d’). Maximum ‘7d’. Mutually exclusive with --start and --end.
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.
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.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Print logs for the production environment over the last hour
Tail live logs until the environment’s current deployment leaves a runnable state

Filter output with --jq

Stream just the log messages as a JSONL stream

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

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

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.
TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT (repeatable)
Name of a metric to return; see https://docs.baseten.co/observability/export-metrics/supported-metrics for the available names. May be repeated. When omitted, a default set is returned.
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
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
BOOL
For --mode series, emit a per-step table instead of sparklines.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Shortcut for a window from a relative time ago until now. Accepts a duration (e.g. ‘30m’, ‘1h30m’) or ‘Nd’ (e.g. ‘3d’). Maximum ‘7d’. Mutually exclusive with --start and --end.
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.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Show a current snapshot of the default metrics for the production environment
Summarize request volume and latency over the last hour
Plot a series over the last 6 hours

Filter output with --jq

Print the metric names returned

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

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

INTEGER
Timeframe of traffic considered for autoscaling decisions, in seconds.
INTEGER
Number of requests per replica before scaling up.
TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
INTEGER
Maximum number of replicas.
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.
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
INTEGER
Waiting period before scaling down any active replica, in seconds.
INTEGER
Target number of in-flight tokens for autoscaling decisions. Early access only.
INTEGER
Target utilization percentage for scaling up and down.
TEXT
Team name or ID. Only valid with --model-name.
INTEGER
Minimum number of replicas.
BOOL
Enable verbose logging

Examples

Raise the production environment’s replica bounds

Filter output with --jq

Print the environment’s resulting minimum replica count

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

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. For organizations with mixed mode (beta) enabled, 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.

Options

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
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 when mixed mode (beta) is enabled for your organization. Configure rolling deployments.
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 when mixed mode (beta) is enabled for your organization. Configure rolling deployments.
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
The cleanup strategy to use after a promotion completes.One of: keep, scale-to-zero, deactivate
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.
INTEGER
The replica overhead percentage for rolling deploys.
BOOL
Whether the environment should rely on rolling deploy orchestration. Pass true or false explicitly; omit the flag to leave this setting unchanged.
TEXT
The rolling deploy strategy to use for promotions.One of: replica
INTEGER
The stabilization time for rolling deploys, in seconds.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Turn on rolling deploys and scale the outgoing deployment to zero
Slow the rollout by lowering the surge percentage
To configure mixed mode (beta): If mixed mode is enabled for your organization, replace <MODEL_ID> with your model’s ID and run the following command:

Filter output with --jq

Print the resulting 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

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

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT | null
required
Backpressure policy to apply. Pass null to clear an existing policy.One of: queue-on-full, reject-on-full, null
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Reject requests once the queue is full
Clear the policy

Filter output with --jq

Print the resulting 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

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

INTEGER
Timeframe of traffic considered for autoscaling decisions, in seconds.
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
INTEGER
Number of requests per replica before scaling up.
BOOL
Whether the schedule is enabled. Defaults to true on create.
TEXT
Exclusive end of the window, ISO 8601. One-time schedules only.
INTEGER
Hour the window closes, in the collection timezone. Omit for an hourly schedule that runs every hour. Recurring schedules only.
INTEGER
Minute the window closes. Recurring schedules only.
TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
INTEGER
Maximum number of replicas.
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.
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
required
Name of the schedule, unique among the environment’s schedules.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
INTEGER
Waiting period before scaling down any active replica, in seconds.
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.
INTEGER
Hour the window opens, in the collection timezone. Omit for an hourly schedule that runs every hour. Recurring schedules only.
INTEGER
Minute the window opens. Recurring schedules only.
INTEGER
Target number of in-flight tokens for autoscaling decisions. Early access only.
INTEGER
Target utilization percentage for scaling up and down.
TEXT
Team name or ID. Only valid with --model-name.
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.
TEXT (repeatable)
Weekdays the schedule runs, comma-separated. Recurring schedules only.One of: monday, tuesday, wednesday, thursday, friday, saturday, sunday
INTEGER
Minimum number of replicas.
BOOL
Enable verbose logging

Examples

Scale up on weekday mornings
Scale up for a one-off launch window

Filter output with --jq

Print the ids of every schedule after the create

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

Remove one autoscaling schedule from an environment, identified by id or by name. Run ‘baseten model environment autoscaling-schedule list’ to see both.

Options

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Stable identifier of the schedule, from ‘autoscaling-schedule list’.Mutually exclusive with other flags in group schedule-ref.
TEXT
Name of the schedule, unique among the environment’s schedules.Mutually exclusive with other flags in group schedule-ref.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Delete a schedule by id
Delete a schedule by name

Filter output with --jq

Print the ids that remain

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

List every autoscaling schedule on an environment with its id, which the update and delete commands take.

Options

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

List an environment’s schedules

Filter output with --jq

Print each schedule’s id and 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

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

INTEGER
Timeframe of traffic considered for autoscaling decisions, in seconds.
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
INTEGER
Number of requests per replica before scaling up.
BOOL
Whether the schedule is enabled. Pass true or false explicitly; omit the flag to leave this setting unchanged.
TEXT
Exclusive end of the window, ISO 8601. One-time schedules only.
INTEGER
Hour the window closes, in the collection timezone. Omit for an hourly schedule that runs every hour. Recurring schedules only.
INTEGER
Minute the window closes. Recurring schedules only.
TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
INTEGER
Maximum number of replicas.
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.
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
New name for the schedule, unique among the environment’s schedules.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
INTEGER
Waiting period before scaling down any active replica, in seconds.
TEXT
Stable identifier of the schedule, from ‘autoscaling-schedule list’.Mutually exclusive with other flags in group schedule-ref.
TEXT
Name of the schedule, unique among the environment’s schedules.Mutually exclusive with other flags in group schedule-ref.
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.
INTEGER
Hour the window opens, in the collection timezone. Omit for an hourly schedule that runs every hour. Recurring schedules only.
INTEGER
Minute the window opens. Recurring schedules only.
INTEGER
Target number of in-flight tokens for autoscaling decisions. Early access only.
INTEGER
Target utilization percentage for scaling up and down.
TEXT
Team name or ID. Only valid with --model-name.
TEXT (repeatable)
Weekdays the schedule runs, comma-separated. Recurring schedules only.One of: monday, tuesday, wednesday, thursday, friday, saturday, sunday
INTEGER
Minimum number of replicas.
BOOL
Enable verbose logging

Examples

Raise a schedule’s replica floor
Turn a schedule off without deleting it, naming it instead of using its id
Convert a recurring schedule into a one-time one

Filter output with --jq

Print the resulting schedule names

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

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

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
TEXT
required
IANA timezone to apply to every schedule on the environment, for example America/New_York.
BOOL
Enable verbose logging

Examples

Move every schedule to a new timezone

Filter output with --jq

Print the resulting 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

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 shows an environment’s active rules.

list

Lists every active rule on an environment with the ID that update and delete take.

Options

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

List an environment’s rules

Filter output with --jq

Print each rule’s ID and percentage

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

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

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
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.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
INTEGER
required
Percentage of the environment’s traffic to shadow.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
required
Whether a shadow request is cancelled when the original client disconnects.
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
TEXT
ID of the target deployment.Mutually exclusive with other flags in group target.
TEXT
Name of the target environment. Traffic goes to whichever deployment the environment is serving.Mutually exclusive with other flags in group target.
TEXT
Team name or ID. Only valid with --model-name.
TEXT
required
Rule type. A shadow rule sends a copy of the environment’s traffic to its target.One of: shadow
BOOL
Enable verbose logging

Examples

Shadow 25% of production’s traffic to staging
Shadow 10% of production’s traffic to a specific deployment

Filter output with --jq

Print the IDs of the environment’s active rules after the create

Output

Text mode (--output text): Prints “Created traffic rule” to stderr; nothing on stdout. JSON mode (--output json): Go output type managementapi.UpdateEnvironmentResponse.

update

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

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
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.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
INTEGER
New percentage of the environment’s traffic to shadow.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Whether a shadow request is cancelled when the original client disconnects.
TEXT
required
ID of the rule. Run ‘baseten model environment traffic-rule list’ to see the environment’s rules.
TEXT
New way requests are picked for shadowing.One of: random, user-session
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Enable verbose logging

Examples

Raise the percentage of traffic a rule shadows

Filter output with --jq

Print each active rule’s percentage after the update

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

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

TEXT
required
Name of the environment (e.g. production). Run ‘baseten model environment list’ to see a model’s environments.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
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.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
required
ID of the rule. Run ‘baseten model environment traffic-rule list’ to see the environment’s rules.
TEXT
Team name or ID. Only valid with --model-name.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Delete a rule

Filter output with --jq

Print the IDs of the rules that remain

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

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

TEXT
Directory for the Docker build context. Defaults to a temp dir removed after the build.
TEXT
Enable a persistent apt/pip/uv build cache keyed by this id.
TEXT
default:"."
Model directory.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Run the image’s container as root instead of the default non-root user.
TEXT
Image tag. Defaults to ‘model_name:latest’ from config.yaml.
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.
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.
BOOL
Enable verbose logging

Examples

Build the current directory into a local Docker image
Build another directory with a custom tag
Pass extra flags through to docker build

Filter output with --jq

Print the built 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

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

TEXT
required
Directory for the Docker build context. Created if absent and kept.
TEXT
Enable a persistent apt/pip/uv build cache keyed by this id.
TEXT
default:"."
Model directory.
TEXT
Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Run the image’s container as root instead of the default non-root user.
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.
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.
BOOL
Enable verbose logging

Examples

Write the current directory’s build context to ./ctx

Filter output with --jq

Print the generated Dockerfile path

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.