Add draft endpoint prototyping loop#4012
Draft
peterschmidt85 wants to merge 20 commits into
Draft
Conversation
added 17 commits
July 4, 2026 16:58
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.
What This PR Does
Adds a draft
endpointconfiguration type for model-serving endpoints.This is a draft PR for reviewing the endpoint UX and the efficiency of the prototyping loop. The code is intentionally still subject to review and rewrite; the goal now is to validate whether the workflow, CLI surface, agent behavior, logs, and preset reuse model feel right before polishing internals.
Main pieces:
type: endpointwithmodel,preset_policy, and normal profile constraints such asfleets,backends,spot_policy, andmax_price.preset_policy: create/reuse-or-createwhen no usable preset is available.Preset mechanics are implemented and validated on initial e2e scenarios, but recipe quality and selection still need broader testing.
How To Use
Start the server with the endpoint agent enabled:
export DSTACK_AGENT_ANTHROPIC_API_KEY=... uv run dstack server --port 3000For local development only, the server can use the existing Claude CLI login instead of
DSTACK_AGENT_ANTHROPIC_API_KEY:export DSTACK_AGENT_CLAUDE_USE_EXISTING_AUTH=1 uv run dstack server --port 3000Production servers must use
DSTACK_AGENT_ANTHROPIC_API_KEY. Do not setDSTACK_AGENT_CLAUDE_USE_EXISTING_AUTHtogether withDSTACK_AGENT_ANTHROPIC_API_KEY; the endpoint agent treats that as a configuration error.Optionally pass Claude CLI effort for endpoint agent sessions:
export DSTACK_AGENT_CLAUDE_EFFORT=highSupported values are
low,medium,high,xhigh, andmax. If unset, dstack does not pass--effortand Claude CLI uses its default.Create or select a project with at least one active fleet. Endpoint creation does not create fleets.
Example endpoint config:
Apply it:
Watch endpoint progress:
Inspect the endpoint:
List learned presets:
Stop the endpoint:
Example
This is an excerpt from the latest successful e2e run.
Endpoint config:
Endpoint progress:
Backlog for v0 (WIP)
Out Of Scope For V1
resourcesoverrides.Notes On Implementation
DSTACK_AGENT_ANTHROPIC_API_KEYand keeps Claude in--baremode.DSTACK_AGENT_CLAUDE_USE_EXISTING_AUTH=1is a local-development-only fallback. It is mutually exclusive withDSTACK_AGENT_ANTHROPIC_API_KEY; setting both is an endpoint agent configuration error.DSTACK_AGENT_CLAUDE_EFFORTpasses Claude CLI--effortfor endpoint agent sessions. If unset, Claude CLI uses its default.--bareso it can read the server user's existing Claude CLI auth and settings; the server logs a warning when this mode is used.HOME, and the agent installs workspace-localdstackandsshwrappers so dstack CLI config and SSH aliases still use the endpoint workspace home.os.killpg; this keeps the Windows pyright matrix clean without changing POSIX behavior.Qwen/Qwen2.5-0.5B-Instruct: existing Claude CLI auth andDSTACK_AGENT_ANTHROPIC_API_KEY.AI Assistance
This PR was developed with AI assistance from Codex.