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

push

baseten model push [OPTIONS] [--dir DIR]
Build a model archive, upload it to Baseten, and create either a new model or a new deployment of an existing model. 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

--deploy-timeout
TEXT
Deployment timeout as a Go duration (e.g. 30m, 1h); allowed range 10m to 24h.
--deployment-name
TEXT
Human-readable name for the new deployment.
--develop
BOOL
Push as a development deployment: the model’s single mutable dev slot, created if absent and overwritten in place otherwise. Incompatible with —environment and —deployment-name.
--dir
TEXT
default:"."
Model directory to push. Defaults to the current directory.
--disable-archive-download
BOOL
Disable archive download for the new model. Only valid for new models.
--dry-run
BOOL
Validate the push and request upload credentials without uploading or creating anything.
--environment
TEXT
Stable environment to push to.
-q, --jq
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
--labels
TEXT
User-provided labels for the deployment as a JSON object, e.g. ’{“team”:“ml”,“priority”:1}’.
--no-build-cache
BOOL
Force a full rebuild without using cached layers.
-o, --output
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
--override-env-instance-type
BOOL
Use this deployment’s instance type instead of preserving the target environment’s. Only meaningful when an environment is targeted.
--override-name
TEXT
Override the model_name from config.yaml for this push only. The on-disk config.yaml is not modified.
--profile
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
--tail
BOOL
Stream build and runtime logs to stderr after pushing. Logs are always text-formatted; use ‘baseten model deployment logs —tail’ for structured log streaming.
--team
TEXT
Team the model belongs to. Only valid for new models.
--wait
BOOL
Block until the deployment is active. Exits non-zero on a terminal-failure status.
--watch
BOOL
After pushing, watch the model directory and live-patch the development deployment on change. Implies —develop.
--watch-hot-reload
BOOL
With —watch, hot-reload the running container when every change is to model code; mixed changes fall back to a cold patch.
--watch-no-keepalive
BOOL
With —watch, let the development deployment scale to zero while watching. By default it is kept warm by periodic pings.
-v, --verbose
BOOL
Enable verbose logging

Examples

Push the current directory as a new deployment
baseten model push
Push and stream build/runtime logs until the deployment is active
baseten model push --tail --wait

Filter output with --jq

Print the new deployment’s predict URL
baseten model push --jq '.predict_url'

Output

Text mode (--output text): Narrative summary on stdout: success banner, deployment status, log/predict URLs and example next-step commands. 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

baseten model watch [--dir DIR]
Watch a model directory and live-patch its development deployment. It applies each change as you save and runs until you interrupt it.

Options

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

Examples

Watch the current directory against its model’s development deployment
baseten model watch
Watch another directory and hot-reload on model-code changes
baseten model watch --dir ./my-model --hot-reload

Output

Text mode (--output text): Streams patch and sync status to stderr as changes are applied. Produces no stdout output.

list

baseten model list [OPTIONS]
List Baseten models.

Options

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

Examples

List all models accessible to the caller
baseten model list
List only models in a specific team
baseten model list --team my-team

Filter output with --jq

Print just the model IDs
baseten model list --jq '.models[].id'

Output

Text mode (--output text): Table with columns: ID, NAME, TEAM, DEPLOYMENTS, CREATED. When no models exist, prints “No models found.” to stderr. JSON mode (--output json): payload type managementapi.Models.

describe

baseten model describe [OPTIONS]
Describe a Baseten model.

Options

-q, --jq
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
--model-id
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
--model-name
TEXT
Name of the model. Use —team to disambiguate when the same name exists in multiple teams.Mutually exclusive with other flags in group model-ref.
-o, --output
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
--profile
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
--team
TEXT
Team name or ID. Only valid with —model-name.
-v, --verbose
BOOL
Enable verbose logging

Examples

Describe a model by ID
baseten model describe --model-id <model-id>
Describe a model by name
baseten model describe --model-name <name>

Filter output with --jq

Print the production deployment ID
baseten model describe --model-id <model-id> --jq '.production_deployment_id'

Output

Text mode (--output text): Field-per-line summary: ID, Name, Team, Deployments, Instance, Production, Development, Created. Optional fields are omitted when unset. JSON mode (--output json): payload type managementapi.Model.

predict

baseten model predict [OPTIONS]
POST a JSON request to a model and write the response to stdout. Targets the production environment by default. Use --environment, --deployment-id, 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

--data
TEXT
Inline JSON request body.Mutually exclusive with other flags in group predict-input.
--deployment-id
TEXT
Specific deployment to target. Mutually exclusive with —environment and —regional.
--environment
TEXT
Environment to target (e.g. production, development). Defaults to production. Mutually exclusive with —deployment-id and —regional.
--file
TEXT
Path to a JSON file containing the request body. Use ’-’ for stdin.Mutually exclusive with other flags in group predict-input.
-q, --jq
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
--model-id
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
--model-name
TEXT
Name of the model. Use —team to disambiguate when the same name exists in multiple teams.Mutually exclusive with other flags in group model-ref.
-o, --output
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
--profile
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
--regional
TEXT
Regional environment name; routes through the regional hostname. Mutually exclusive with —environment and —deployment-id.
--team
TEXT
Team name or ID. Only valid with —model-name.
--websocket
BOOL
Use the WebSocket predict endpoint. Sends the body as one frame, reads one frame back, then closes. Not for multi-message or back-and-forth sessions.
-v, --verbose
BOOL
Enable verbose logging

Examples

Send an inline JSON body
baseten model predict --model-id <model-id> --data '{"prompt":"hello"}'
Send a request body from a file
baseten model predict --model-id <model-id> --file request.json

Filter output with --jq

Extract a field when the model returns JSON
baseten model predict --model-id <model-id> --data '{"x":1}' --jq '.result'

Output

Text mode (--output text): The model’s response body, passed through verbatim. May be JSON, plain text, or binary, and may stream when the model uses chunked transfer encoding or SSE. JSON mode (--output json): payload type cmd.JSONUndefined. Under --output json, binary frames are base64-encoded under a ‘body’ key. Under --output jsonl, each SSE or binary chunk is emitted as its own record, one per line.

delete

baseten model delete [OPTIONS]
Delete a Baseten model and all of its deployments. Prompts for the model name to confirm the deletion. Pass --yes to skip the prompt. When stdin is not a terminal, --yes is required.

Options

-q, --jq
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
--model-id
TEXT
ID of the model.Mutually exclusive with other flags in group model-ref.
--model-name
TEXT
Name of the model. Use —team to disambiguate when the same name exists in multiple teams.Mutually exclusive with other flags in group model-ref.
-o, --output
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
--profile
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
--team
TEXT
Team name or ID. Only valid with —model-name.
--yes
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
-v, --verbose
BOOL
Enable verbose logging

Examples

Delete by ID without confirmation
baseten model delete --model-id <model-id> --yes
Delete by name with interactive confirmation
baseten model delete --model-name <name>

Filter output with --jq

Print the deleted model’s ID
baseten model delete --model-id <model-id> --yes --jq '.id'

Output

Text mode (--output text): On success, prints “Deleted model name (id)” to stderr; no stdout output. JSON mode (--output json): payload type managementapi.ModelTombstone.