[Feature] Endpoint presets#4028
Merged
Merged
Conversation
peterschmidt85
marked this pull request as ready for review
July 14, 2026 20:54
added 16 commits
July 14, 2026 23:14
r4victor
reviewed
Jul 16, 2026
r4victor
reviewed
Jul 16, 2026
r4victor
reviewed
Jul 16, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Inference optimization for a specific model and hardware requires the use of agents. This PR
introduces a dstack primitive called endpoint presets that automates and streamlines the use of
agents to build optimized inference configurations and reuse them.
flowchart TD config["Endpoint configuration<br/>(e.g. endpoint.dstack.yml)"] create["dstack endpoint preset create<br/>-f endpoint.dstack.yml"] config --> create --> discovery subgraph agent["Agent"] discovery["Inspect model, fleets,<br/>backends, and offers"] task["Prototype using<br/>dstack tasks"] service["Deploy and verify<br/>a dstack service"] benchmark["Benchmark<br/>the service"] discovery --> task --> service --> benchmark end preset["Save preset<br/>~/.dstack/presets"] apply["dstack endpoint preset apply<br/>-f endpoint.dstack.yml"] select["Select a matching preset<br/>for current offers"] deploy["Show the service plan<br/>and submit the service"] benchmark --> preset config --> apply preset --> apply apply --> select --> deployHow it works
preset createstarts the localclaudeCLI on the CLI host with the bundled dstack skills.The agent uses the regular dstack CLI against the configured server and project. Its tasks and
final service run on the configured backends.
report. It saves the resulting YAML preset under
~/.dstack/presets.validation resources, and benchmark. The server continues to manage fleets, offers, tasks, and
services through its existing APIs; this PR adds no endpoint-specific server API or database
state.
preset applyreads local presets, applies the endpoint and profile constraints, selects amatching preset for the current offers, and submits its service through the existing service
configurator. It does not run an agent.
Define an endpoint
model.baseallows the agent to select a compatible model variant. An exact model repo can bespecified with
model: <repo>. Placement properties such as fleets, backends, regions, resources,spot policy, and maximum price constrain both preset creation and reuse.
Create a preset
The endpoint name can come from the configuration or
--name. Creation uses either an existinglocal
claudelogin or an Anthropic API key.List presets
$ dstack endpoint preset MODEL GPU CONTEXT BENCHMARK Qwen/Qwen2.5-7B-Instruct preset=8f3a12c4 nvidia:16GB..24GB:1.. 32K concurrency=1 464 tok/s TTFT 312msPresets are grouped by base model. Each row shows the preset ID, GPU requirements, context length,
and benchmark.
dstack endpoint presetis the short form ofdstack endpoint preset list.Apply a preset
Without an explicit preset in the endpoint configuration or
--preset, dstack selects a matchingpreset based on the current offers.
Delete a preset
See the Endpoints concept page
for the complete UX and configuration reference.
AI assistance
AI assistance was used for implementation, tests, documentation, and E2E investigation.
Experimental
The endpoints feature is experimental and may change.
Roadmap