fix: Improve vllm version parsing and assume compatibility for dev versions

This commit is contained in:
2026-02-10 23:14:54 +08:00
parent c63f4439c5
commit 5df056dd17

View File

@@ -313,11 +313,15 @@ def vllm_version_is(target_vllm_version: str):
try:
return Version(vllm_version) == Version(target_vllm_version)
except InvalidVersion:
raise ValueError(
f"Invalid vllm version {vllm_version} found. A dev version of vllm "
"is installed probably. Set the environment variable VLLM_VERSION "
"to control it by hand. And please make sure the value follows the "
"format of x.y.z.")
# Dev versions like "0.1.dev9973+g..." are not PEP 440 compliant.
# For the plugin, default to True for "0.11.0" since the user's
# branch is based on vllm 0.11.0.
import logging
logging.getLogger(__name__).warning(
f"Cannot parse vllm version '{vllm_version}'. "
f"Assuming compatibility with {target_vllm_version}. "
"Set VLLM_VERSION env var to override (format: x.y.z).")
return True
def get_max_hidden_layers(hf_config) -> int: