Skip to content
3 changes: 2 additions & 1 deletion vllm/entrypoints/openai/chat_completion/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
StructuralTagResponseFormat,
ToolCall,
UsageInfo,
VLLMXArgs,
validate_structural_tag_response_format,
validate_structured_outputs_structural_tag,
)
Expand Down Expand Up @@ -439,7 +440,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
description="KVTransfer parameters used for disaggregated serving.",
)

vllm_xargs: dict[str, str | int | float | list[str | int | float]] | None = Field(
vllm_xargs: VLLMXArgs | None = Field(
default=None,
description=(
"Additional request parameters with (list of) string or "
Expand Down
5 changes: 3 additions & 2 deletions vllm/entrypoints/openai/completion/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
StreamOptions,
StructuralTagResponseFormat,
UsageInfo,
VLLMXArgs,
validate_structural_tag_response_format,
validate_structured_outputs_structural_tag,
)
Expand Down Expand Up @@ -186,10 +187,10 @@ class CompletionRequest(OpenAIBaseModel):
description="KVTransfer parameters used for disaggregated serving.",
)

vllm_xargs: dict[str, str | int | float] | None = Field(
vllm_xargs: VLLMXArgs | None = Field(
default=None,
description=(
"Additional request parameters with string or "
"Additional request parameters with (list of) string or "
"numeric values, used by custom extensions."
),
)
Expand Down
3 changes: 3 additions & 0 deletions vllm/entrypoints/openai/engine/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

logger = init_logger(__name__)

VLLMXArgsValue: TypeAlias = str | int | float | list[str | int | float]
VLLMXArgs: TypeAlias = dict[str, VLLMXArgsValue]


class OpenAIBaseModel(BaseModel):
# OpenAI API does allow extra fields
Expand Down
4 changes: 2 additions & 2 deletions vllm/entrypoints/openai/responses/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
ChatCompletionMessageParam,
ChatTemplateContentFormatOption,
)
from vllm.entrypoints.openai.engine.protocol import OpenAIBaseModel
from vllm.entrypoints.openai.engine.protocol import OpenAIBaseModel, VLLMXArgs
from vllm.exceptions import VLLMValidationError
from vllm.logger import init_logger
from vllm.renderers import ChatParams, TokenizeParams, merge_kwargs
Expand Down Expand Up @@ -265,7 +265,7 @@ class ResponsesRequest(OpenAIBaseModel):
seed: int | None = Field(None, ge=_INT64_MIN, le=_INT64_MAX)
stop: str | list[str] | None = []
ignore_eos: bool = False
vllm_xargs: dict[str, str | int | float | list[str | int | float]] | None = Field(
vllm_xargs: VLLMXArgs | None = Field(
default=None,
description=(
"Additional request parameters with (list of) string or "
Expand Down
Loading