Skip to content

dstack preset

The dstack preset commands create, list, export, and delete local presets, and push them to and pull them from a registry.

The commands that take a preset — get, export, and delete — accept its ID or name. A pulled preset's name includes the project it came from, e.g. main/qwen38-27b-mi300x.

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] [-a] [-n COUNT]
                          [--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
  -a, --all             Show all presets. By default, it only shows unfinished
                        creations or the last one.
  -n, --last COUNT      Show only the last N presets. Implies --all
  --base MODEL          Show only presets for a base model
  --repo REPO           Show only presets serving a model repo

dstack preset create

Deprecated: pass a preset configuration to dstack apply instead.

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 DURATION]
                            [--spot | --on-demand | --spot-auto | --spot-policy POLICY]
                            [--retry | --no-retry | --retry-duration DURATION]
                            [--keep-service] [--trials N] [--previous ID] [-y]

Options:
  -h, --help            show this help message and exit
  -f, --file FILE       The preset configuration file
  -n, --name NAME       The preset name
  --keep-service        Leave the verified service running
  --trials N            The number of benchmarked trials before the best one
                        is promoted
  --previous ID         Give the agent a previous session's results to analyze
                        and improve on. Repeat for several
  -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 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), the recorded trials, the agent prompt (prompt.md), and the real-time 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 resume

The dstack preset resume command resumes an interrupted preset creation.

Usage
$ dstack preset resume --help
Usage: dstack preset resume [-h] [--keep-service] ID

Positional Arguments:
  ID              The preset ID or name

Options:
  -h, --help      show this help message and exit
  --keep-service  Leave the verified service running

dstack preset export

The dstack preset export command exports a preset as a service configuration that dstack apply deploys.

Usage
$ dstack preset export --help
Usage: dstack preset export [-h] -f FILE [-n NAME] [--force] ID

Positional Arguments:
  ID                    The preset ID or name

Options:
  -h, --help            show this help message and exit
  -f, --file FILE       The service configuration file to write
  -n, --name NAME       The service name. Defaults to the preset name if set
  --force               Overwrite existing files

dstack preset push

The dstack preset push command pushes a local preset to the registry as <project>/<name>.

Usage
$ dstack preset push --help
Usage: dstack preset push [-h] ID PROJECT/NAME

Positional Arguments:
  ID            The local preset ID or name
  PROJECT/NAME  The name to push it under in the registry, prefixed by the
                project

Options:
  -h, --help    show this help message and exit

dstack preset pull

The dstack preset pull command pulls <project>/<name> or <project>/<id> from the registry and stores it locally.

Usage
$ dstack preset pull --help
Usage: dstack preset pull [-h] PROJECT/NAME

Positional Arguments:
  PROJECT/NAME  The preset name or ID in the registry, prefixed by the project

Options:
  -h, --help    show this help message and exit

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