Common: No default add_bos_token value for chat completion requests

This commit is contained in:
turboderp 2025-05-04 05:25:58 +02:00
parent 92ea7ee7cd
commit 036af02bf6

View file

@ -82,10 +82,13 @@ class ChatCompletionRequest(CommonCompletionRequest):
tool_call_end: SkipJsonSchema[Optional[str]] = None
tool_call_schema: SkipJsonSchema[Optional[dict]] = tool_call_schema
# Chat completions requests do not have a BOS token preference. Backend
# respects the tokenization config for the individual model.
add_bos_token: Optional[bool] = Field(default = None)
@field_validator("add_bos_token", mode="after")
def force_bos_token(cls, v):
"""Always disable add_bos_token with chat completions."""
return None