Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/entrypoints/launchers/test_cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ def test_config_arg_parsing(serve_parser, cli_config_file):
assert args.port == 9000


@pytest.mark.parametrize(
("cli_args", "expected"),
[([], "auto"), (["--http", "h11"], "h11"), (["--http", "httptools"], "httptools")],
)
def test_http_implementation_arg(serve_parser, cli_args, expected):
assert serve_parser.parse_args(cli_args).http == expected


def test_http_implementation_rejects_unknown_value(serve_parser):
with pytest.raises(SystemExit):
serve_parser.parse_args(["--http", "unknown"])


### Tests for LoRA module parsing
def test_valid_key_value_format(serve_parser):
# Test old format: name=path
Expand Down
5 changes: 4 additions & 1 deletion tests/entrypoints/launchers/test_dp_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def _make_unit_args(**overrides) -> argparse.Namespace:
"tensor_parallel_size": 1,
"pipeline_parallel_size": 1,
"uvicorn_log_level": "info",
"http": "auto",
"shutdown_timeout": 5.0,
"disable_uvicorn_access_log": False,
"disable_access_log_for_endpoints": None,
Expand Down Expand Up @@ -122,6 +123,7 @@ def _make_args(**overrides) -> argparse.Namespace:
tensor_parallel_size=1,
pipeline_parallel_size=1,
uvicorn_log_level="warning",
http="auto",
shutdown_timeout=0.0,
disable_uvicorn_access_log=False,
disable_access_log_for_endpoints=None,
Expand Down Expand Up @@ -446,14 +448,15 @@ async def serve(self):

monkeypatch.setattr(dp_sup, "NoSignalServer", FakeServer)

args = _make_unit_args(host="127.0.0.1")
args = _make_unit_args(host="127.0.0.1", http="h11")
supervisor = DPSupervisor(args)
await supervisor._start_server()

assert len(captured_config) == 1
config = captured_config[0]
assert config.log_config == uvicorn.Config(app=None).log_config
assert config.access_log is True
assert config.http == "h11"


# ---------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions vllm/entrypoints/launchers/api_server/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ async def build_and_serve(
log_config = get_uvicorn_log_config(args)
if log_config is not None:
uvicorn_kwargs["log_config"] = log_config
uvicorn_kwargs.setdefault("http", args.http)

supported_tasks = await engine_client.get_supported_tasks()
model_config = engine_client.model_config
Expand Down
3 changes: 3 additions & 0 deletions vllm/entrypoints/launchers/cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ class FrontendArgs(BaseFrontendArgs):
"critical", "error", "warning", "info", "debug", "trace"
] = "info"
"""Log level for uvicorn."""
http: Literal["auto", "h11", "httptools"] = "auto"
"""Uvicorn HTTP/1.1 implementation. Use h11 for clients that send h2c
upgrade requests. This does not enable HTTP/2."""
disable_uvicorn_access_log: bool = False
"""Disable uvicorn access log."""
disable_access_log_for_endpoints: str | None = None
Expand Down
1 change: 1 addition & 0 deletions vllm/entrypoints/launchers/dp_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ async def _start_server(self) -> tuple[uvicorn.Server, asyncio.Task[None]]:
host=host,
port=self.supervisor_port,
log_level=self.args.uvicorn_log_level,
http=self.args.http,
access_log=not self.args.disable_uvicorn_access_log,
ssl_keyfile=self.args.ssl_keyfile,
ssl_certfile=self.args.ssl_certfile,
Expand Down
1 change: 1 addition & 0 deletions vllm/entrypoints/launchers/render/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async def build_and_serve_renderer(
log_config = get_uvicorn_log_config(args)
if log_config is not None:
uvicorn_kwargs["log_config"] = log_config
uvicorn_kwargs.setdefault("http", args.http)

app = build_app(args, ("render",))
await init_render_app_state(vllm_config, app.state, args)
Expand Down
Loading