Skip to content

dstack endpoint

The dstack endpoint commands create, list, apply, and delete local endpoint presets.

dstack endpoint preset list

The dstack endpoint preset list command lists locally stored presets.

Usage
$ dstack endpoint preset list --help
Usage: dstack endpoint preset list [-h] [-v] [--json]

Options:
  -h, --help     show this help message and exit
  -v, --verbose
  --json         Output in JSON format

dstack endpoint preset create

The dstack endpoint preset create command uses an agent to create and save a verified preset from an endpoint configuration.

Usage
$ dstack endpoint preset create --help
Usage: dstack endpoint preset create [-h] -f FILE [-n NAME] [--profile NAME]
                                     [--max-price PRICE]
                                     [--max-duration DURATION] [-b NAME]
                                     [-r NAME] [--instance-type NAME]
                                     [--fleet NAME]
                                     [-R | --dont-destroy | --idle-duration IDLE_DURATION]
                                     [--spot | --on-demand | --spot-auto | --spot-policy POLICY]
                                     [--retry | --no-retry | --retry-duration DURATION]
                                     [--keep-service] [--debug]

Options:
  -h, --help            show this help message and exit
  -f, --file FILE       The endpoint configuration file
  -n, --name NAME       The endpoint name. Required when the configuration
                        omits name
  --keep-service        Leave the verified service running
  --debug               Save the agent prompt and raw trace

Profile:
  --profile NAME        The name of the profile. Defaults to $DSTACK_PROFILE
  --max-price PRICE     The maximum price per hour, in dollars
  --max-duration DURATION
                        The maximum duration of the run
  -b, --backend NAME    The backends that will be tried for provisioning
  -r, --region NAME     The regions that will be tried for provisioning
  --instance-type NAME  The cloud-specific instance types that will be tried
                        for provisioning

Fleets:
  --fleet NAME          Consider only the specified fleet(s)
  -R, --reuse           Reuse an existing instance from fleet (do not
                        provision a new one)
  --dont-destroy        Do not destroy instance after the run is finished (if
                        the run provisions a new instance)
  --idle-duration IDLE_DURATION
                        Time to wait before destroying the idle instance (if
                        the run provisions a new instance)

Spot Policy:
  --spot                Consider only spot instances
  --on-demand           Consider only on-demand instances
  --spot-auto           Consider both spot and on-demand instances
  --spot-policy POLICY  One of spot, on-demand, auto

Retry Policy:
  --retry
  --no-retry
  --retry-duration DURATION
Agent settings

Preset creation uses the existing claude login unless DSTACK_AGENT_ANTHROPIC_API_KEY is set.

Variable Description
DSTACK_AGENT_ANTHROPIC_API_KEY Anthropic API key used by the agent.
DSTACK_AGENT_CLAUDE_PATH claude executable name or path. Defaults to claude from PATH.
DSTACK_AGENT_ANTHROPIC_MODEL Claude model used by the agent. Defaults to claude-opus-4-8.
DSTACK_AGENT_CLAUDE_EFFORT Claude effort level: low, medium, high, xhigh, or max. If unset, the claude CLI default is used.

Agent progress is written to agent.log under ~/.dstack/agent/<endpoint-name>/<timestamp>-<preset-id>/. Failed attempts use the -failed suffix. Pass --debug to also save the effective endpoint configuration (endpoint.dstack.yml), agent prompt (prompt.md), and raw trace (trace.jsonl).

dstack endpoint preset get

The dstack endpoint preset get command outputs one locally stored preset as JSON.

Usage
$ dstack endpoint preset get --help
Usage: dstack endpoint preset get [-h] --json ID

Positional Arguments:
  ID          The preset ID

Options:
  -h, --help  show this help message and exit
  --json      Output in JSON format

dstack endpoint preset apply

The dstack endpoint preset apply command selects a matching local preset and submits its service.

Usage
$ dstack endpoint preset apply --help
Usage: dstack endpoint preset apply [-h] -f FILE [-n NAME] [--profile NAME]
                                    [--max-price PRICE]
                                    [--max-duration DURATION] [-b NAME]
                                    [-r NAME] [--instance-type NAME]
                                    [--fleet NAME]
                                    [-R | --dont-destroy | --idle-duration IDLE_DURATION]
                                    [--spot | --on-demand | --spot-auto | --spot-policy POLICY]
                                    [--retry | --no-retry | --retry-duration DURATION]
                                    [--preset ID] [-y] [--force] [-d] [-v]

Options:
  -h, --help            show this help message and exit
  -f, --file FILE       The endpoint configuration file
  -n, --name NAME       The endpoint name. Required when the configuration
                        omits name
  --preset ID           The preset ID to use
  -y, --yes             Do not ask for confirmation
  --force               Force apply when no changes are detected
  -d, --detach          Exit after submitting the service
  -v, --verbose         Show all plan properties

Profile:
  --profile NAME        The name of the profile. Defaults to $DSTACK_PROFILE
  --max-price PRICE     The maximum price per hour, in dollars
  --max-duration DURATION
                        The maximum duration of the run
  -b, --backend NAME    The backends that will be tried for provisioning
  -r, --region NAME     The regions that will be tried for provisioning
  --instance-type NAME  The cloud-specific instance types that will be tried
                        for provisioning

Fleets:
  --fleet NAME          Consider only the specified fleet(s)
  -R, --reuse           Reuse an existing instance from fleet (do not
                        provision a new one)
  --dont-destroy        Do not destroy instance after the run is finished (if
                        the run provisions a new instance)
  --idle-duration IDLE_DURATION
                        Time to wait before destroying the idle instance (if
                        the run provisions a new instance)

Spot Policy:
  --spot                Consider only spot instances
  --on-demand           Consider only on-demand instances
  --spot-auto           Consider both spot and on-demand instances
  --spot-policy POLICY  One of spot, on-demand, auto

Retry Policy:
  --retry
  --no-retry
  --retry-duration DURATION

dstack endpoint preset delete

The dstack endpoint preset delete command deletes one local preset by ID or all presets for a base model.

Usage
$ dstack endpoint preset delete --help
Usage: dstack endpoint preset delete [-h] [--model MODEL] [-y] [ID]

Positional Arguments:
  ID             The preset ID

Options:
  -h, --help     show this help message and exit
  --model MODEL  Delete all presets for a base model
  -y, --yes      Do not ask for confirmation