Repository navigation
[Frontend] Gate scale-out endpoints behind opt-in flag #54579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chaunceyjiang
merged 4 commits into
vllm-project:main
from
franciscojavierarceo:codex/render-endpoint-gate
Sep 2, 2026
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8c1c47b
[Frontend] Gate render endpoints behind opt-in flag
franciscojavierarceo 70cd679
[Frontend] Gate all scale-out endpoints
franciscojavierarceo c581690
refactor: distinguish unset scale-out endpoint flag
franciscojavierarceo 061a468
fix: address scale-out endpoint review feedback
franciscojavierarceo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
|
|
||
| from argparse import Namespace | ||
|
|
||
| import pytest | ||
| from fastapi import FastAPI | ||
|
|
||
| from vllm.entrypoints.launchers.api_server.routers import register_api_routers | ||
| from vllm.tasks import SupportedTask | ||
|
|
||
| RENDER_PATHS = { | ||
| "/v1/chat/completions/render", | ||
| "/v1/chat/completions/derender", | ||
| "/v1/completions/render", | ||
| "/v1/completions/derender", | ||
| "/v1/messages/render", | ||
| } | ||
| GENERATE_PATH = "/inference/v1/generate" | ||
| SCALE_OUT_PATHS = RENDER_PATHS | {GENERATE_PATH} | ||
|
|
||
|
|
||
| def registered_paths(supported_tasks: tuple[SupportedTask, ...]) -> set[str]: | ||
| app = FastAPI() | ||
| args = Namespace(tokens_only=False, enable_fault_tolerance=False) | ||
| app.state.args = args | ||
| register_api_routers(args, app, supported_tasks) | ||
| return {route.path for route in app.routes} | ||
|
|
||
|
|
||
| def test_scale_out_routes_are_disabled_by_default(monkeypatch): | ||
| monkeypatch.delenv("VLLM_ENABLE_SCALE_OUT_ENDPOINTS", raising=False) | ||
|
|
||
| paths = registered_paths(("generate",)) | ||
|
|
||
| assert SCALE_OUT_PATHS.isdisjoint(paths) | ||
|
|
||
|
|
||
| def test_scale_out_routes_can_be_enabled_for_generate_server(monkeypatch): | ||
| monkeypatch.setenv("VLLM_ENABLE_SCALE_OUT_ENDPOINTS", "1") | ||
|
|
||
| paths = registered_paths(("generate",)) | ||
|
|
||
| assert paths >= SCALE_OUT_PATHS | ||
|
|
||
|
|
||
| def test_render_routes_remain_enabled_for_render_server(monkeypatch): | ||
| monkeypatch.delenv("VLLM_ENABLE_SCALE_OUT_ENDPOINTS", raising=False) | ||
|
|
||
| paths = registered_paths(("render",)) | ||
|
|
||
| assert paths >= RENDER_PATHS | ||
| assert GENERATE_PATH not in paths | ||
|
|
||
|
|
||
| def test_render_server_rejects_explicitly_disabled_scale_out_routes(monkeypatch): | ||
| monkeypatch.setenv("VLLM_ENABLE_SCALE_OUT_ENDPOINTS", "0") | ||
|
|
||
| with pytest.raises(ValueError, match="VLLM_ENABLE_SCALE_OUT_ENDPOINTS=0"): | ||
| registered_paths(("render",)) |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.