feat(BA-5502): Support runtime_variants list in deployment config#10661
Draft
jopemachine wants to merge 11 commits intomainfrom
Draft
feat(BA-5502): Support runtime_variants list in deployment config#10661jopemachine wants to merge 11 commits intomainfrom
runtime_variants list in deployment config#10661jopemachine wants to merge 11 commits intomainfrom
Conversation
runtime_variant in service config fileruntime_variant in service config file
runtime_variant in service config fileruntime_variants list in service definition
runtime_variants list in service definitionruntime_variants list in deployment config
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change `ModelServiceDefinition.runtime_variant` (single) to `runtime_variants` (list) so that a service-definition.toml can declare several allowed runtime variants. - Single variant in the list: forced automatically (same as before). - Multiple variants: the user must pick one via the API request; `RuntimeVariantNotAllowed` is raised when the choice is invalid. - Both `runtime_variant = "vllm"` and `runtime_variants = ["vllm", "sglang"]` are accepted in TOML (normalized by a Pydantic model_validator). - Resolution logic lives in `ModelServiceDefinition.resolve_runtime_variant()` to avoid duplication across code paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…r priority Replace CUSTOM default with Sentinel.TOKEN on ExecutionSpec.runtime_variant so that "user did not specify" and "user chose CUSTOM" are distinguishable. resolve_runtime_variant now follows: user request > runtime_variants list > CUSTOM default. - User specified a variant: validate against the list, use it. - User did not specify (Sentinel): single variant in list → use it, multiple → error, no list → fall back to CUSTOM. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract conditions into named properties and methods for clarity - Add `RuntimeVariantNotSpecified` error for unspecified multi-variant case - Remove all `type: ignore` by using explicit None checks for narrowing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…iority semantics Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d fixtures - Remove unused `_has_variant_constraint` property - Consolidate 8 individual test methods into 2 parametrized tests (5 success + 3 error cases) - Extract `make_draft_with_variant` fixture for draft creation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntime_variant` Add type narrowing (cast/isinstance) at call sites where `RuntimeVariant | Sentinel` is passed to APIs expecting `RuntimeVariant`. These are all post-resolve paths where the value is always `RuntimeVariant`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e tests Replace raw tuples with `_ResolveVariantTestCase` dataclass for improved readability. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
resolves #10660 (BA-5502)
Summary
DeploymentConfig.runtime_variant(single value) toruntime_variants(list)RuntimeVariantNotSpecifiederrorruntime_variant = "vllm"(legacy) andruntime_variants = ["vllm", "sglang"]accepted in deployment config TOMLDeploymentConfig.resolve_runtime_variant()RuntimeVariantNotAllowedfor invalid choice,RuntimeVariantNotSpecifiedfor missing choiceExample
deployment-config.tomlChecklist: (if applicable)