Reduce validation to a warning (#28749)

Signed-off-by: Alec Solder <alecs@fb.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Alec Solder <alecs@fb.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Alec S 2025-12-05 09:02:49 -05:00 committed by GitHub
parent 0d8a7d8a26
commit 2c174420f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 17 deletions

View File

@ -65,22 +65,6 @@ class StructuredOutputsConfig:
@model_validator(mode="after")
def _validate_structured_output_config(self) -> Self:
# Import here to avoid circular import
from vllm.reasoning.abs_reasoning_parsers import ReasoningParserManager
if self.reasoning_parser_plugin and len(self.reasoning_parser_plugin) > 3:
ReasoningParserManager.import_reasoning_parser(self.reasoning_parser_plugin)
valid_reasoning_parsers = ReasoningParserManager.list_registered()
if (
self.reasoning_parser != ""
and self.reasoning_parser not in valid_reasoning_parsers
):
raise ValueError(
f"invalid reasoning parser: {self.reasoning_parser} "
f"(chose from {{ {','.join(valid_reasoning_parsers)} }})"
)
if self.disable_any_whitespace and self.backend not in ("xgrammar", "guidance"):
raise ValueError(
"disable_any_whitespace is only supported for "

View File

@ -160,7 +160,10 @@ class ReasoningParserManager:
if name in cls.lazy_parsers:
return cls._load_lazy_parser(name)
raise KeyError(f"Reasoning parser '{name}' not found.")
registered = ", ".join(cls.list_registered())
raise KeyError(
f"Reasoning parser '{name}' not found. Available parsers: {registered}"
)
@classmethod
def list_registered(cls) -> list[str]: