feat: add official vLLM Router frontend - #2
Merged
Conversation
cquil11
marked this pull request as ready for review
August 10, 2026 17:36
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 328280d. Configure here.
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.

Human written description READ FIRST
Goal: add support for vLLM router in addition to existing support for SGLang model gateway
src/srtctl/frontends/static_router.pyto encompass logic between "native engine routers" ie vllm and sglangSummary
Add first-class support for the official vLLM Router while preserving all existing frontend names and behavior:
frontend.typevllmvllm servevllm-routervllm serveendpointssglangdynamoThe implementation introduces a shared static-router abstraction for the orchestration that SGLang Router and vLLM Router have in common, with small adapters for their protocol and CLI differences.
Architecture
Frontend implementations register through
@register_frontend(...), andget_frontend()resolves the configured adapter through that registry. Existing frontend types remain registered under their current names;vllm-routeris additive.StaticRouterFrontendowns the common static-router lifecycle:SGLangFrontendandVLLMRouterFrontendprovide only the backend-specific command, URL, health, and bootstrap behavior.vLLM Router behavior
frontend.type: vllm-routerrequiresbackend.type: vllm.--worker-urls.--vllm-pd-disaggregation, repeated--prefilland--decodeendpoints, and the allocated prefill NIXL bootstrap ports.X-Session-IDcan be passed to Router policies such asconsistent_hashfor stable AgentX conversation affinity.frontend.container_image, including cluster image aliases.Direct
frontend.type: vllmis unchanged: it launches one aggregatevllm serveon the public inference port with no Router process.vLLM parallel topology
Direct vLLM and single-node vLLM Router workers preserve native vLLM behavior: one
vllm servecommand owns the configured DP, TP, PP, and PCP ranks and performs vLLM's internal DP load balancing.For multi-node Router DP,
backend.dp_launch_mode: per_nodelaunches one hybrid-LB server per node. srtctl validates and derives the distributed topology from the Slurm allocation:DP * TP * PP * PCP;local GPUs / (TP * PP * PCP);--intra-node-data-parallel-sizevalue;headlessfields is rejected rather than silently overwritten.The legacy Dynamo
per_gpulayout remains available for pure DP withTP=PP=PCP=1. Multi-node TP-only direct serving is rejected explicitly instead of being misinterpreted as DP.Readiness and observability
The existing Router
/workerscount is necessary but not sufficient: official vLLM Router can list every DP-expanded rank before every advertised base API is ready. After the expanded-count gate passes, the vLLM Router adapter therefore requires HTTP 200 from every exact backend/healthURL before launching the benchmark. Other frontend adapters retain their existing readiness semantics.AIPerf receives every logical vLLM worker metrics URL. Static/direct frontends skip Dynamo's NATS and etcd infrastructure, and logical endpoint selection avoids duplicate metrics from follower ranks.
Final validation
Current srt-slurm head:
0f2a4ddd67aa17075000826c763085541d38c728The final official InferenceX Router sweep is workflow 31502477920, which completed successfully:
All four performance jobs completed Slurm with exit code
0:0, passed the requiredvllm:metrics gate, and used the all-base readiness barrier. Every evaluation completed all 1,319 GSM8K requests witheval_exit=0. The workflow published Router logs, backend logs, raw and aggregate AgentX results, evaluation outputs, and metrics artifacts for every topology.InferenceX integration: SemiAnalysisAI/InferenceX#2549
Note
Medium Risk
Touches job startup (health gating, infra skip, vLLM process layout) and routing CLI for multiple frontends; misconfiguration is mostly caught at recipe load, but runtime regressions could affect SGLang and Dynamo vLLM DP paths.
Overview
Adds
frontend.type: vllm-router, which runs the officialvllm-routerprocess against privatevllm serveworkers (aggregate--worker-urls, disaggregated--vllm-pd-disaggregationwith NIXL bootstrap ports). Directvllmstays router-free on a single aggregate node;sglangandvllm-routerskip NATS/etcd like other static frontends.Refactors SGLang routing into a shared
StaticRouterFrontend(worker URL collection by positive HTTP port, P/D vs agg CLI, optionalfrontend.container_image). Frontends register via@register_frontend; health parsing goes through each adapter, withcheck_static_router_healthfor/workers. Benchmark startup can alsowait_for_http_endpointswhen an adapter requires every advertised backend/health(vLLM Router readiness race).vLLM backend changes tighten DP topology: default
dp_launch_mode: per_rank(per_gpualias), validateGPUs = DP × TP × PP × PCP, derive hybrid-LBper_nodepools for multi-node Router DP, and build router worker commands with private ports/KV transfer. Load-time validation covers router/backend pairing, SGLangtp-size % dp-size, and conflicting manual DP coordinator flags. SGLang P/D under the native router gets--skip-server-warmupso readiness follows the real router path.Reviewed by Cursor Bugbot for commit d6b2f91. Bugbot is set up for automated code reviews on this repo. Configure here.