fix: OpenAI SDK compat (ResponseTextConfig)#23126
fix: OpenAI SDK compat (ResponseTextConfig)#23126simon-mo merged 7 commits intovllm-project:mainfrom
Conversation
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
There was a problem hiding this comment.
Code Review
This pull request introduces a compatibility shim to handle a type rename in the OpenAI Python SDK, ensuring that vLLM works with both older and newer versions of the SDK. The logic correctly handles the different import paths. However, the comments explaining the version compatibility are inverted, which could cause confusion for future maintenance. I've suggested corrections for the comments to accurately reflect the logic.
4f9d4a9 to
ef65852
Compare
ef65852 to
371d4dd
Compare
vllm/entrypoints/openai/protocol.py
Outdated
There was a problem hiding this comment.
we have a PR that lock openai<1.100
but I think this is still worth doing?
There was a problem hiding this comment.
Okay, I think this fix is acceptable
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: breno.skuk <breno.skuk@hcompany.ai>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: breno.skuk <breno.skuk@hcompany.ai>
Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: breno.skuk <breno.skuk@hcompany.ai>
)" This reverts commit bf75632. Signed-off-by: breno.skuk <breno.skuk@hcompany.ai>
827f112 to
106b00c
Compare
|
This PR still didn't include the reversal of the pin. Can you do the revert again? |
)" This reverts commit bf75632. Signed-off-by: breno.skuk <breno.skuk@hcompany.ai>
|
thx. Will force merge once a test involving this code path pass |
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Signed-off-by: Duncan Moss <djm.moss@gmail.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com> Signed-off-by: Xiao Yu <xiao.yu@amd.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
Purpose
Fix ReadTheDocs/MkDocs build failures caused by a recent OpenAI Python SDK type rename.
vllm/entrypoints/openai/protocol.py imported ResponseTextConfig, which is present in openai==1.99.x but renamed to ResponseFormatTextConfig in newer releases (e.g., >=1.100.0).
This PR adds a backward/forward compatible import shim so both SDK lines work.
No functional/runtime behavior change in vLLM.
No public API changes.
Keeps docs builds deterministic without requiring a docs-only dependency pin.
Test Plan
openai update resulted in failing https://app.readthedocs.org/projects/vllm/builds/29240829/
Test result
This PR should pass the CI test.