@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 020732800c
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 10, 10:15 UTC

[Bugfix] Fix OpenAPI schema test failures (#31921)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>

Andreas Karatzas committed Jan 9, 2026 at 04:56 UTC 020732800caf3ba1eae62098c4264dac7ef35611
2 files changed +11 -3
tests/entrypoints/openai/test_openai_schema.py
+5 -1
@@ -90,7 +90,10 @@ def before_generate_case(context: schemathesis.hooks.HookContext, strategy):
90 if (
91 isinstance(content, list)
92 and len(content) > 0
93 - and any(item.get("type") == "file" for item in content)
93 + and any(
94 + isinstance(item, dict) and item.get("type") == "file"
95 + for item in content
96 + )
97 ):
98 return False
99
@@ -139,6 +142,7 @@ def test_openapi_stateless(case: schemathesis.Case):
142 timeout = {
143 # requires a longer timeout
144 ("POST", "/v1/chat/completions"): LONG_TIMEOUT_SECONDS,
145 + ("POST", "/v1/completions"): LONG_TIMEOUT_SECONDS,
146 }.get(key, DEFAULT_TIMEOUT_SECONDS)
147
148 # No need to verify SSL certificate for localhost
vllm/entrypoints/openai/protocol.py
+6 -2
@@ -577,7 +577,9 @@ class ChatCompletionRequest(OpenAIBaseModel):
577 min_tokens: int = 0
578 skip_special_tokens: bool = True
579 spaces_between_special_tokens: bool = True
580 - truncate_prompt_tokens: Annotated[int, Field(ge=-1)] | None = None
580 + truncate_prompt_tokens: Annotated[int, Field(ge=-1, le=_LONG_INFO.max)] | None = (
581 + None
582 + )
583 prompt_logprobs: int | None = None
584 allowed_token_ids: list[int] | None = None
585 bad_words: list[str] = Field(default_factory=list)
@@ -1058,7 +1060,9 @@ class CompletionRequest(OpenAIBaseModel):
1060 min_tokens: int = 0
1061 skip_special_tokens: bool = True
1062 spaces_between_special_tokens: bool = True
1061 - truncate_prompt_tokens: Annotated[int, Field(ge=-1)] | None = None
1063 + truncate_prompt_tokens: Annotated[int, Field(ge=-1, le=_LONG_INFO.max)] | None = (
1064 + None
1065 + )
1066 allowed_token_ids: list[int] | None = None
1067 prompt_logprobs: int | None = None
1068 # --8<-- [end:completion-sampling-params]