Skip to content

[Misc] Warn When vLLM / vLLM-Omni Have Mismatched Versions#2691

Merged
hsliuustc0106 merged 1 commit into
vllm-project:mainfrom
alex-jw-brooks:warn_mismatched_versions
Apr 17, 2026
Merged

[Misc] Warn When vLLM / vLLM-Omni Have Mismatched Versions#2691
hsliuustc0106 merged 1 commit into
vllm-project:mainfrom
alex-jw-brooks:warn_mismatched_versions

Conversation

@alex-jw-brooks
Copy link
Copy Markdown
Contributor

@alex-jw-brooks alex-jw-brooks commented Apr 10, 2026

Purpose

Mismatched vLLM Omni / vLLM versions are a very common source of errors for users. This PR adds a warning if the major / minor version for vLLM Omni & vLLM aren't the fallback for _version not being created (0.0) and are mismatched. This runs on import of the version module, which is now done before running monkeypatching on vLLM, because the imports in monkey patch will frequently break with incompatible versions.

Example (with my current omni build and vLLM 0.18 instead of 0.19), where it will warn before crashing due to patch issues:

>>> import vllm_omni

/home/alex-jw-brooks/vllm-omni/vllm_omni/version.py:55: RuntimeWarning: vLLM and vLLM-Omni appear to have mismatched major/minor versions:
 --> vLLM-Omni version 0.19.0rc2.dev21+gb30172916.d20260406
 --> vLLM version 0.18.0
This will likely cause compatibility issues.
  warn_if_misaligned_vllm_version()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/alex-jw-brooks/vllm-omni/vllm_omni/__init__.py", line 22, in <module>
    from . import patch  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^
  File "/home/alex-jw-brooks/vllm-omni/vllm_omni/patch.py", line 16, in <module>
    from vllm_omni.inputs.data import OmniTokensPrompt
  File "/home/alex-jw-brooks/vllm-omni/vllm_omni/inputs/data.py", line 19, in <module>
    from vllm.inputs import EmbedsPrompt, TextPrompt, TokensInput, TokensPrompt
ImportError: cannot import name 'TokensInput' from 'vllm.inputs' (/home/alex-jw-brooks/vllm-omni/.venv/lib/python3.12/site-packages/vllm/inputs/__init__.py). Did you mean: 'TokenInputs'?

This is a joint contribution with @lengrongfu

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@hsliuustc0106 hsliuustc0106 requested a review from tzhouam April 10, 2026 23:16
Copy link
Copy Markdown
Collaborator

@hsliuustc0106 hsliuustc0106 left a comment

Choose a reason for hiding this comment

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

Nice utility. Two things:

  1. No test for the warning logic — consider adding a quick unit test with mocked vllm.__version__ covering the three cases (match, mismatch, dev/0.0). Low effort, high value for a safety check that runs on every import.

  2. The import order change in __init__.py (version before patch) — the comment explains why, but have you verified this doesn't break any existing import path where version.py might depend on monkeypatched vLLM? Looks safe from the diff since version.py only imports vllm.__version__, but worth confirming on a clean install.

@hsliuustc0106
Copy link
Copy Markdown
Collaborator

Clean utility. One suggestion: consider adding a test that verifies the warning fires when versions mismatch (mock __version_tuple__ to return different major.minor). Currently no test coverage for the core warn_if_misaligned_vllm_version logic.

@alex-jw-brooks
Copy link
Copy Markdown
Contributor Author

Thank you for the reviews @lishunyang12 @hsliuustc0106 🙂

Added some small tests for when the warnings will fire. Also yes, moving the version check should be fine since the versioning of vllm omni / vllm are independent and shouldn't depend on any monkey patching.

For testing against a new install, you can do something like this as a quick check.

uv pip install vllm==0.18.0
uv pip install -e .
python3 -c "import vllm_omni"
/home/alex-jw-brooks/vllm-omni/vllm_omni/version.py:55: RuntimeWarning: vLLM and vLLM-Omni appear to have mismatched major/minor versions:
 --> vLLM-Omni version 0.19.0rc2.dev90+gecf2b451e
 --> vLLM version 0.18.0
This will likely cause compatibility issues.

@hsliuustc0106 hsliuustc0106 added the ready label to trigger buildkite CI label Apr 11, 2026
@lengrongfu
Copy link
Copy Markdown
Contributor

maybe we can look this pr #1941

@alex-jw-brooks alex-jw-brooks force-pushed the warn_mismatched_versions branch from 18b77aa to fb0d874 Compare April 15, 2026 18:50
- Warn if mismatched versions
- Remove redundant check
- Add tests for version compat
- Add more tests for local identifiers

Signed-off-by: Alex Brooks <albrooks@redhat.com>
Co-authored-by: lengrongfu <lenronfu@gmail.com>
@alex-jw-brooks alex-jw-brooks force-pushed the warn_mismatched_versions branch from fb0d874 to 0e8ba1e Compare April 15, 2026 18:57
@alex-jw-brooks
Copy link
Copy Markdown
Contributor Author

Hi @hsliuustc0106, @lengrongfu and I chatted and have decided to move forward with this PR. We have added some of the additional tests from the other PR that were not covered explicitly in this one, and went ahead and squashed it to a coauthored commit. It's ready for another look when you have time, thanks 🙂

@hsliuustc0106
Copy link
Copy Markdown
Collaborator

Hi @hsliuustc0106, @lengrongfu and I chatted and have decided to move forward with this PR. We have added some of the additional tests from the other PR that were not covered explicitly in this one, and went ahead and squashed it to a coauthored commit. It's ready for another look when you have time, thanks 🙂

lgtm, I also met this problem before, thanks anyway

@hsliuustc0106 hsliuustc0106 merged commit 6c57ab7 into vllm-project:main Apr 17, 2026
8 checks passed
lvliang-intel pushed a commit to lvliang-intel/vllm-omni that referenced this pull request Apr 20, 2026
…ect#2691)

Signed-off-by: Alex Brooks <albrooks@redhat.com>
Co-authored-by: lengrongfu <lenronfu@gmail.com>
lengrongfu added a commit to lengrongfu/vllm-omni that referenced this pull request May 1, 2026
…ect#2691)

Signed-off-by: Alex Brooks <albrooks@redhat.com>
Co-authored-by: lengrongfu <lenronfu@gmail.com>
clodaghwalsh17 pushed a commit to clodaghwalsh17/nm-vllm-omni-ent that referenced this pull request May 12, 2026
…ect#2691)

Signed-off-by: Alex Brooks <albrooks@redhat.com>
Co-authored-by: lengrongfu <lenronfu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready label to trigger buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants