Skip to content

Conversation

@h-brenoskuk
Copy link
Contributor

@h-brenoskuk h-brenoskuk commented Aug 18, 2025

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/


python -m mkdocs build --clean --site-dir $READTHEDOCS_OUTPUT/html --config-file mkdocs.yaml
--
  | WARNING 08-18 17:18:33 [__init__.py:26] The vLLM package was not found, so its version could not be inspected. This may cause platform detection to fail.
  | INFO 08-18 17:18:33 [__init__.py:245] No platform detected, vLLM is running on UnspecifiedPlatform
  | Traceback (most recent call last):
  | File "<frozen runpy>", line 198, in _run_module_as_main
  | File "<frozen runpy>", line 88, in _run_code
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/mkdocs/__main__.py", line 370, in <module>
  | cli()
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/click/core.py", line 1442, in __call__
  | return self.main(*args, **kwargs)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/click/core.py", line 1363, in main
  | rv = self.invoke(ctx)
  | ^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/click/core.py", line 1830, in invoke
  | return _process_result(sub_ctx.command.invoke(sub_ctx))
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/click/core.py", line 1226, in invoke
  | return ctx.invoke(self.callback, **ctx.params)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/click/core.py", line 794, in invoke
  | return callback(*args, **kwargs)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/mkdocs/__main__.py", line 285, in build_command
  | cfg = config.load_config(**kwargs)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/mkdocs/config/base.py", line 374, in load_config
  | errors, warnings = cfg.validate()
  | ^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/mkdocs/config/base.py", line 231, in validate
  | run_failed, run_warnings = self._validate()
  | ^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/mkdocs/config/base.py", line 188, in _validate
  | self[key] = config_option.validate(value)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/mkdocs/config/base.py", line 55, in validate
  | return self.run_validation(value)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/mkdocs/config/config_options.py", line 1187, in run_validation
  | hooks[name] = self._load_hook(name, path)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/mkdocs/config/config_options.py", line 1205, in _load_hook
  | spec.loader.exec_module(module)
  | File "<frozen importlib._bootstrap_external>", line 999, in exec_module
  | File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/checkouts/23119/docs/mkdocs/hooks/generate_argparse.py", line 18, in <module>
  | from vllm.benchmarks import latency  # noqa: E402
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/checkouts/23119/vllm/benchmarks/latency.py", line 18, in <module>
  | from vllm.engine.arg_utils import EngineArgs
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/checkouts/23119/vllm/engine/arg_utils.py", line 40, in <module>
  | from vllm.reasoning import ReasoningParserManager
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/checkouts/23119/vllm/reasoning/__init__.py", line 5, in <module>
  | from .deepseek_r1_reasoning_parser import DeepSeekR1ReasoningParser
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/checkouts/23119/vllm/reasoning/deepseek_r1_reasoning_parser.py", line 9, in <module>
  | from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,
  | File "/home/docs/checkouts/readthedocs.org/user_builds/vllm/checkouts/23119/vllm/entrypoints/openai/protocol.py", line 20, in <module>
  | from openai.types.responses import (ResponseFunctionToolCall,
  | ImportError: cannot import name 'ResponseTextConfig' from 'openai.types.responses' (/home/docs/checkouts/readthedocs.org/user_builds/vllm/envs/23119/lib/python3.12/site-packages/openai/types/responses/__init__.py). Did you mean: 'ResponseFormatTextConfig'?


Test result

This PR should pass the CI test.

@h-brenoskuk h-brenoskuk requested a review from aarnphm as a code owner August 18, 2025 18:32
@github-actions
Copy link

👋 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 fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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 ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the frontend label Aug 18, 2025
Copy link
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 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.

@h-brenoskuk h-brenoskuk force-pushed the fix/rtd-openai-compat branch 2 times, most recently from 4f9d4a9 to ef65852 Compare August 18, 2025 18:57
@mergify mergify bot added the performance Performance-related issues label Aug 18, 2025
@h-brenoskuk h-brenoskuk force-pushed the fix/rtd-openai-compat branch from ef65852 to 371d4dd Compare August 18, 2025 18:59
Comment on lines +25 to +30
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have a PR that lock openai<1.100

#23118

but I think this is still worth doing?

cc @mgoin @DarkLight1337

Copy link
Member

Choose a reason for hiding this comment

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

Okay, I think this fix is acceptable

@simon-mo
Copy link
Collaborator

Can you merge main, the revert the commit that pin the version bf75632 from @mgoin

@mergify mergify bot added the ci/build label Aug 18, 2025
h-brenoskuk and others added 5 commits August 18, 2025 21:25
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>
@h-brenoskuk h-brenoskuk force-pushed the fix/rtd-openai-compat branch from 827f112 to 106b00c Compare August 18, 2025 19:29
Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

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

Thank you for helping!

@simon-mo
Copy link
Collaborator

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>
@h-brenoskuk h-brenoskuk requested a review from simon-mo August 18, 2025 20:46
@simon-mo simon-mo enabled auto-merge (squash) August 18, 2025 20:47
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 18, 2025
@simon-mo
Copy link
Collaborator

thx. Will force merge once a test involving this code path pass

@simon-mo simon-mo disabled auto-merge August 18, 2025 22:22
@simon-mo simon-mo merged commit ac6eb49 into vllm-project:main Aug 18, 2025
65 of 81 checks passed
simon-mo pushed a commit that referenced this pull request Aug 18, 2025
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>
princepride pushed a commit to princepride/vllm that referenced this pull request Aug 20, 2025
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>
divakar-amd pushed a commit to divakar-amd/vllm_upstream that referenced this pull request Aug 20, 2025
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>
cyang49 pushed a commit to cyang49/vllm that referenced this pull request Aug 20, 2025
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>
djmmoss pushed a commit to djmmoss/vllm that referenced this pull request Aug 21, 2025
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>
epwalsh pushed a commit to epwalsh/vllm that referenced this pull request Aug 28, 2025
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>
xiao-llm pushed a commit to xiao-llm/vllm that referenced this pull request Aug 28, 2025
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>
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Aug 28, 2025
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>
mengxingkongzhouhan pushed a commit to mengxingkongzhouhan/vllm that referenced this pull request Aug 30, 2025
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>
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Sep 3, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build frontend performance Performance-related issues ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants