dstack preset¶
The dstack preset commands create, list, apply, and delete local
presets.
dstack preset list¶
The dstack preset list command lists locally stored presets.
Usage¶
$ dstack preset list --help
Usage: dstack preset list [-h] [-v] [-w] [--json] [--base MODEL | --repo REPO]
Options:
-h, --help show this help message and exit
-v, --verbose
-w, --watch Watch presets in realtime
--json Output in JSON format
--base MODEL Show only presets for a base model
--repo REPO Show only presets serving a model repo
dstack preset create¶
The dstack preset create command uses an agent to create and save a
verified preset from a preset configuration.
Usage¶
$ dstack preset create --help
Usage: dstack preset create [-h] -f FILE [-n NAME]
[--profile NAME | --no-profile]
[--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] [--max-trials N] [--debug]
[--resume ID] [-y]
Options:
-h, --help show this help message and exit
-f, --file FILE The preset configuration file
-n, --name NAME The service name. Required when the configuration
omits name
--keep-service Leave the verified service running
--max-trials N The maximum number of benchmarked trials before the
best one is promoted
--debug Save the agent prompt and raw trace
--resume ID Resume an interrupted preset creation by its preset ID
-y, --yes Do not ask for confirmation
Profile:
--profile NAME The name of the profile. Defaults to $DSTACK_PROFILE
--no-profile Don't load any profile. Enabled by default if
$DSTACK_NO_PROFILE is set and --profile is not
specified
--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/presets/<preset-id>/,
alongside the effective configuration (preset.dstack.yml) and the recorded
trials (trials.jsonl). Pass --debug to also save the agent prompt
(prompt.md) and raw trace (trace.jsonl).
dstack preset logs¶
The dstack preset logs command shows a preset creation's log. Pass -f to
re-follow a detached or running creation to completion.
Usage¶
$ dstack preset logs --help
Usage: dstack preset logs [-h] [-f] [--keep-service] ID
Positional Arguments:
ID The preset ID or name
Options:
-h, --help show this help message and exit
-f, --follow Follow to completion and save the preset
--keep-service Leave the verified service running (with -f)
dstack preset stop¶
The dstack preset stop command stops a running preset creation and its runs.
Usage¶
$ dstack preset stop --help
Usage: dstack preset stop [-h] [-y] ID
Positional Arguments:
ID The preset ID or name
Options:
-h, --help show this help message and exit
-y, --yes Do not ask for confirmation
dstack preset get¶
The dstack preset get command outputs one locally stored preset as JSON.
Usage¶
$ dstack preset get --help
Usage: dstack preset get [-h] --json ID
Positional Arguments:
ID The preset ID or name
Options:
-h, --help show this help message and exit
--json Output in JSON format
dstack preset apply¶
The dstack preset apply command selects a matching local preset and
submits its service.
Usage¶
$ dstack preset apply --help
Usage: dstack preset apply [-h] -f FILE [-n NAME]
[--profile NAME | --no-profile] [--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]
--id ID [-y] [--force] [-d] [-v]
Options:
-h, --help show this help message and exit
-f, --file FILE The preset configuration file
-n, --name NAME The service name. Required when the configuration
omits name
--id ID The preset ID to deploy
-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
--no-profile Don't load any profile. Enabled by default if
$DSTACK_NO_PROFILE is set and --profile is not
specified
--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 preset delete¶
The dstack preset delete command deletes one local preset by ID or name, or
all presets for a base model.
Usage¶
$ dstack preset delete --help
Usage: dstack preset delete [-h] [--base MODEL] [--repo REPO] [-y] [ID]
Positional Arguments:
ID The preset ID or name
Options:
-h, --help show this help message and exit
--base MODEL Delete all presets for a base model
--repo REPO Delete all presets serving a model repo
-y, --yes Do not ask for confirmation