Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.baseten.co/llms.txt

Use this file to discover all available pages before exploring further.

Create, list, and push Baseten models. Authentication is via ‘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.
--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. Mutually exclusive with —promote.
-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.
--promote
BOOL
Promote the new deployment to the production environment.
--remote-url
TEXT
Baseten remote URL, overrides BASETEN_REMOTE_URL (default https://app.baseten.co)
--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
Watch the model directory and push on change. (not yet implemented)
--watch-hot-reload
BOOL
Hot-reload the running container on watched changes. (not yet implemented)
--watch-keepalive
BOOL
Keep the watcher alive after the deployment exits. (not yet implemented)
-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.

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
--remote-url
TEXT
Baseten remote URL, overrides BASETEN_REMOTE_URL (default https://app.baseten.co)
--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.

fetch

baseten model fetch [OPTIONS]
Fetch 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
--remote-url
TEXT
Baseten remote URL, overrides BASETEN_REMOTE_URL (default https://app.baseten.co)
--team
TEXT
Team name or ID. Only valid with —model-name.
-v, --verbose
BOOL
Enable verbose logging

Examples

Fetch a model by ID
baseten model fetch --model-id <model-id>
Fetch a model by name
baseten model fetch --model-name <name>

Filter output with --jq

Print the production deployment ID
baseten model fetch --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
--regional
TEXT
Regional environment name; routes via the regional hostname. Mutually exclusive with —environment and —deployment-id.
--remote-url
TEXT
Baseten remote URL, overrides BASETEN_REMOTE_URL (default https://app.baseten.co)
--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
--remote-url
TEXT
Baseten remote URL, overrides BASETEN_REMOTE_URL (default https://app.baseten.co)
--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.