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. The current directory is used by default; pass --dir to push a model directory at another path. The model is identified by the model_name field in config.yaml. Use --override-name to override that for this push only.

Options

TEXT
Deployment timeout as a Go 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
default:"."
Model directory to push. Defaults to the current directory.
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.
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}’.
BOOL
Force a full rebuild without using cached layers.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
BOOL
Use this deployment’s instance type instead of preserving the target environment’s. Only meaningful when an environment is targeted.
TEXT
Override the model_name from config.yaml for this push only. The on-disk config.yaml is not modified.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
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.
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.
BOOL
Enable verbose logging

Examples

Push the current directory as a new deployment
Push and stream build/runtime logs until the deployment is active

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.

Options

TEXT
Inline JSON request body.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.
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.