fix: accept max_completion_tokens + reasoning_effort + n=2
Sub655 replay log shows 881 requests, majority failing with: 'Extra inputs are not permitted', 'input': 8192 (max_completion_tokens) 'Extra inputs are not permitted', 'input': 'low' (reasoning_effort) Root cause: protocol.py OpenAIBaseModel has extra='forbid', and ChatCompletionRequest lacks these two OpenAI API fields. Sub168 has the SAME bug — both reject max_completion_tokens. Fixes: 1. protocol.py: add max_completion_tokens (Optional[int]) field 2. protocol.py: add reasoning_effort (Optional[str]) field 3. serving_chat.py: merge max_completion_tokens into max_tokens 4. computility-run.yaml: max_num_seqs=2 (fixes t2_n_2 HTTP 400)
This commit is contained in:
@@ -15,7 +15,7 @@ command:
|
|||||||
- -tp
|
- -tp
|
||||||
- '4'
|
- '4'
|
||||||
- --max-num-seqs
|
- --max-num-seqs
|
||||||
- '1'
|
- '2'
|
||||||
- --disable-log-requests
|
- --disable-log-requests
|
||||||
- --disable-frontend-multiprocessing
|
- --disable-frontend-multiprocessing
|
||||||
- --max-num-batched-tokens
|
- --max-num-batched-tokens
|
||||||
|
|||||||
@@ -180,6 +180,8 @@ class ChatCompletionRequest(OpenAIBaseModel):
|
|||||||
logprobs: Optional[bool] = False
|
logprobs: Optional[bool] = False
|
||||||
top_logprobs: Optional[int] = 0
|
top_logprobs: Optional[int] = 0
|
||||||
max_tokens: Optional[int] = None
|
max_tokens: Optional[int] = None
|
||||||
|
# OpenAI newer API field — treat as alias for max_tokens
|
||||||
|
max_completion_tokens: Optional[int] = None
|
||||||
n: Optional[int] = 1
|
n: Optional[int] = 1
|
||||||
presence_penalty: Optional[float] = 0.0
|
presence_penalty: Optional[float] = 0.0
|
||||||
response_format: Optional[ResponseFormat] = None
|
response_format: Optional[ResponseFormat] = None
|
||||||
@@ -193,6 +195,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
|
|||||||
tool_choice: Optional[Union[Literal["none"], Literal["auto"],
|
tool_choice: Optional[Union[Literal["none"], Literal["auto"],
|
||||||
ChatCompletionNamedToolChoiceParam]] = "none"
|
ChatCompletionNamedToolChoiceParam]] = "none"
|
||||||
thinking: Optional[Union[bool, str, Dict[str, Any]]] = None
|
thinking: Optional[Union[bool, str, Dict[str, Any]]] = None
|
||||||
|
reasoning_effort: Optional[str] = None
|
||||||
|
|
||||||
# NOTE this will be ignored by VLLM -- the model determines the behavior
|
# NOTE this will be ignored by VLLM -- the model determines the behavior
|
||||||
parallel_tool_calls: Optional[bool] = False
|
parallel_tool_calls: Optional[bool] = False
|
||||||
|
|||||||
@@ -394,6 +394,9 @@ class OpenAIServingChat(OpenAIServing):
|
|||||||
assert prompt_inputs is not None
|
assert prompt_inputs is not None
|
||||||
|
|
||||||
sampling_params: Union[SamplingParams, BeamSearchParams]
|
sampling_params: Union[SamplingParams, BeamSearchParams]
|
||||||
|
# OpenAI API: max_completion_tokens takes precedence over max_tokens
|
||||||
|
if request.max_completion_tokens is not None and request.max_tokens is None:
|
||||||
|
request.max_tokens = request.max_completion_tokens
|
||||||
default_max_tokens = self.max_model_len - len(
|
default_max_tokens = self.max_model_len - len(
|
||||||
prompt_inputs["prompt_token_ids"])
|
prompt_inputs["prompt_token_ids"])
|
||||||
if request.use_beam_search:
|
if request.use_beam_search:
|
||||||
|
|||||||
Reference in New Issue
Block a user