Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vllm/entrypoints/openai/completion/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,14 @@ def to_sampling_params(
thinking_token_budget=self.thinking_token_budget,
)

@model_validator(mode="before")
@classmethod
def normalize_null_max_tokens(cls, data):
if isinstance(data, dict) and data.get("max_tokens") is None:
data = data.copy()
data["max_tokens"] = cls.model_fields["max_tokens"].default
return data

@model_validator(mode="before")
@classmethod
def validate_response_format(cls, data):
Expand Down
Loading