Skip to content

[serve] update to support latest vLLM#58945

Merged
ruisearch42 merged 3 commits intoray-project:masterfrom
soodoshll:fix-vllm-args
Dec 3, 2025
Merged

[serve] update to support latest vLLM#58945
ruisearch42 merged 3 commits intoray-project:masterfrom
soodoshll:fix-vllm-args

Conversation

@soodoshll
Copy link
Copy Markdown
Contributor

Description

vLLM's interface of launching an OpenAI-compatible server has changed. This PR makes necessary changes to make ray-serve work with latest vLLM.

Related issues

#58937

@soodoshll soodoshll requested a review from a team as a code owner November 24, 2025 20:03
Signed-off-by: Qidong Su <qidongs@nvidia.com>
Signed-off-by: Qidong Su <qidongs@nvidia.com>
Signed-off-by: Qidong Su <qidongs@nvidia.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates ray-serve to support the latest version of vLLM, which has a modified API for its OpenAI-compatible server. The changes introduce backward compatibility by inspecting the signature of vLLM's init_app_state function at runtime and calling it with the appropriate arguments. My review focuses on improving the maintainability of this new compatibility logic. I've suggested a refactoring to reduce code duplication, making the code cleaner and easier to maintain.

Comment on lines +202 to +214
if "vllm_config" in inspect.signature(init_app_state).parameters:
await init_app_state(
self._engine_client,
vllm_config=vllm_engine_config,
state=state,
args=args,
)
else:
await init_app_state(
self._engine_client,
state=state,
args=args,
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and reduce code duplication, you can refactor this logic to build a dictionary of keyword arguments and then call init_app_state once. This avoids repeating the call and makes the code more concise and easier to read.

        init_kwargs = {
            "engine_client": self._engine_client,
            "state": state,
            "args": args,
        }
        if "vllm_config" in inspect.signature(init_app_state).parameters:
            init_kwargs["vllm_config"] = vllm_engine_config

        await init_app_state(**init_kwargs)

@eicherseiji
Copy link
Copy Markdown
Contributor

Hi @soodoshll, thanks for the PR! We're tracking the upgrade work here: #58026.

I see that this PR maintains some backward compatibility with the previous version of vLLM. Is this a requirement on your end?

@soodoshll
Copy link
Copy Markdown
Contributor Author

soodoshll commented Nov 24, 2025

Hi @eicherseiji. Thanks for pointing me to the right PR!

We currently don't have a requirement for back compatibility.

@ray-gardener ray-gardener bot added serve Ray Serve Related Issue llm community-contribution Contributed by the community labels Nov 25, 2025
@eicherseiji eicherseiji added the go add ONLY when ready to merge, run all tests label Dec 3, 2025
Copy link
Copy Markdown
Contributor

@eicherseiji eicherseiji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving forward with this one while #58026 is pending

@ruisearch42 ruisearch42 merged commit d4955c9 into ray-project:master Dec 3, 2025
7 checks passed
peterxcli pushed a commit to peterxcli/ray that referenced this pull request Feb 25, 2026
## Description

vLLM's interface of launching an OpenAI-compatible server has changed.
This PR makes necessary changes to make ray-serve work with latest vLLM.

## Related issues

ray-project#58937

---------

Signed-off-by: Qidong Su <qidongs@nvidia.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community go add ONLY when ready to merge, run all tests llm serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants