chore: single global router in front of engines for all deployments#3105
Open
mikasenghaas wants to merge 1 commit into
Open
chore: single global router in front of engines for all deployments#3105mikasenghaas wants to merge 1 commit into
mikasenghaas wants to merge 1 commit into
Conversation
Every deployment shape now runs one client-facing router on server.port with engines behind it on backend_port: local single-node runs spawn a vllm-router in the inference entrypoint, and the SLURM templates collapse per-replica routers into a single global router on inference node 0. router/backend_port move to InferenceConfig top level; router = "None" runs a bare engine (used for per-rank SLURM engine processes). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikasenghaas
marked this pull request as ready for review
July 22, 2026 19:49
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.
Summary
Unifies inference deployment so that every shape — single-node, multi-node, and P/D-disaggregated — runs a single global router as the client-facing endpoint in front of the vLLM engines (first step towards a single-URL client, see RES-1156, RES-1028):
inference_localnow spawns avllm-routeronserver.port(default8000) fronting the engine onbackend_port(default8100). The router's lifecycle is tied to the inference process (torn down on exit; a router crash tears down the engine via a watchdog thread). The RL entrypoint auto-wiresorchestrator.model.client.admin_base_urlto the engine port so admin ops (pause/update_weights/resume) bypass the router, matching multi-node semantics.vllm-routerandllm-d).INFER_URLSis now a single URL;ADMIN_URLSstill enumerate every rank directly. llm-d endpoint discovery now enumerates all replicas (prefill nodes across replicas first, then decode nodes).routerandbackend_portmove from the deployment configs toInferenceConfigtop level — they describe the same client-facing layout in every deployment. The router listens onserver.port(the per-routerportfield is gone).router = "None"runs a bare engine; the SLURM launchers write that into per-rank engine configs.StaticInferencePool.wait_for_readynow health-checks the client-facing (router) endpoint in addition to the admin (engine) endpoints — the router only starts serving once its workers pass its own health check, so checking engines alone let rollouts race ahead of the router and fail with connection errors.Breaking
[inference.deployment.router]→[inference.router](standalone entrypoint:[deployment.router]→[router]).inference.deployment.backend_port→inference.backend_port.inference.deployment.router.portis removed — the router always bindsinference.server.port.--model.client.base-url.Verification
On a 2-GPU node:
uv run inference --model.name PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT: router comes up on:8000fronting the engine on:8100;/v1/models,/v1/chat/completions, and/inference/v1/generateall served through the router; SIGTERM tears down both processes and frees the GPUs.uv run rl @ configs/basic/reverse-text/rl.toml --max-steps 3 --weight-broadcast.type filesystem(1 trainer + 1 inference GPU): subconfigs getbase_url = :8000(router) andadmin_base_url = :8100(engine); 3 steps complete with 0% rollout errors through the router and weight updates via the admin URL; the launcher exits 0 and the router process is gone afterwards. SIGTERM mid-run also tears down the full tree (router included).bash -nchecked them; llm-d endpoint enumeration across outer replicas maps logical→physical nodes correctly.pytest tests/unit(389 passed).Note: with the default NCCL weight broadcast, the same 3-step run wedges at teardown — the trainer waits forever for
broadcasts/step_1/NCCL_READYafter the orchestrator has exited. This reproduces identically onmain(pre-existing tail race, the knownNCCL_READYtimeout follow-up from RES-1077) and is unrelated to this PR; the CI reverse-text config already pinsweight_broadcast.type = "filesystem"for the same reason.🤖 Generated with Claude Code
Note
Medium Risk
Touches core inference launch paths, SLURM templates, and orchestrator client URLs; breaking config renames and a single router URL for multi-replica runs require config and client updates.
Overview
Every deployment shape now exposes one client URL on
inference.server.port, with vLLM engines oninference.backend_port(+ rank offset). Config moves and breaking renames:[inference.deployment.router]→[inference.router],backend_portto top-levelInferenceConfig, and per-routerportremoved (alwaysserver.port).Local / single-node:
inference_localspawnsvllm-routeronserver.portand binds the engine tobackend_port, with lifecycle tied to the inference process. RL auto-setsorchestrator.model.client.admin_base_urlto the engine port so weight updates bypass the router.Multi-node / P/D SLURM: Per-replica routers are replaced by one global router on inference node 0;
INFER_URLSis a single URL whileADMIN_URLSstill list every rank. Per-rank engine TOMLs setrouter = None; the sbatch script starts the router. llm-d endpoint discovery enumerates all replicas’ prefill then decode nodes.Readiness:
StaticInferencePool.wait_for_readyalso health-checks the router whenadmin_base_urlis set, avoiding rollouts before the router is up.Validators require a router for multi-node/disaggregated deployments and restrict llm-d to SLURM multi-node/disaggregated (not single-node local).
Reviewed by Cursor Bugbot for commit 7f39bec. Bugbot is set up for automated code reviews on this repo. Configure here.