[Presets] Support for dstack preset push and dstack preset pull - #4194
Open
peterschmidt85 wants to merge 7 commits into
Open
[Presets] Support for dstack preset push and dstack preset pull#4194peterschmidt85 wants to merge 7 commits into
dstack preset push and dstack preset pull#4194peterschmidt85 wants to merge 7 commits into
Conversation
Adds the client half of the preset registry: a preset is pushed to a project as `<project>/<name>` and pulled anywhere else by name or ID. Push carries the verified service, its benchmark, the hardware it was verified on, and the preset's files; the creation session stays local. Stored presets are now tagged by status, `verified` for a local creation and `pulled` for a registry copy, and the served model repository is reported as `repo` instead of `model`. Presets written by earlier versions are upgraded when read. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`PresetConfiguration` and its neighbours moved to `configurations.py`, but the reference page still imported them from `core.models.presets`, which failed the docs build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`get_files` replaces `get_file`: one request returns every archive the preset carries, framed by path and length, so a pull costs one round trip and one preset lookup however many files there are. The archives are also keyed by their path in the container now, which is what `RunSpec` carries, so `PresetArchiveMapping` is gone and the envelope is the same as a run's. Where each archive lands on disk is what the preset's own `files` already say. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Presets can be the target of events, and `list_events` filters by them, so a server extending dstack with a preset registry can record who pushed what. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`files` may mount a directory, and exporting a preset carrying one failed with `IsADirectoryError`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The events table rendered a preset target as `---`, and neither the type filter nor the target ID filter knew about presets. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The presets docs cover pushing, pulling, and the registry behind them. Traces move under Monitor presets, the intro is shorter, and the export snippet matches what the command prints now. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
peterschmidt85
marked this pull request as ready for review
August 24, 2026 13:31
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.
Push and pull
A preset created on one machine can now be used on another. Push it to the registry:
Then, on any other machine, pull it from the registry and export it to a service configuration:
$ dstack preset pull main/qwen38-27b-mi300x OK $ dstack preset export main/qwen38-27b-mi300x -f qwen38.dstack.yml OK $ dstack apply -f qwen38.dstack.ymlexportwrites the preset's patch files next to the configuration, so the service is appliedexactly as it was verified.
Push shares the verified service, its benchmark, and the hardware it was verified on. The
configuration, prompt, and trials that produced it stay on the machine that created it.
A pulled preset is used like any other, and is named
<project>/<name>, which can never clashwith a preset of your own:
Its status is
pulled, in the table above and indstack preset get --json.Pushing the same name again pushes a new preset that the name then points to; the previous one
stays available as
<project>/<id>, whichpullalso accepts.Registry
The registry is part of the dstack server. On dstack Sky, that is https://sky.dstack.ai. Push and
pull require membership in the project. If the server has no registry, both say so.
The server comes from the project's entry in
~/.dstack/config.yml. A project that is not therefalls back to dstack Sky;
DSTACK_NO_SKY_FALLBACKturns the fallback off.Note
The fallback is exactly the one
dstack loginapplies.Also here
dstack preset exportno longer fails withIsADirectoryErrorwhen the preset mounts adirectory in
files.list_eventsfilters by them, so a server with aregistry can record who pushed what. The events table shows them and filters by them.
Breaking changes
dstack preset get --jsonreports the served model repository asrepoinstead ofmodel, sobase(the model family),repo(what the service loads), andservice.model(what theendpoint serves it as) are now distinct.
Backward compatibility
Note
The registry that
pushandpulltalk to is implemented separately and is not part of thisPR.