[Frontend] Support bad_words in the /v1/completions endpoint (#46793)

Signed-off-by: sungbin1015 <sbin@solbox.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
sungbin1015
2026-07-08 09:51:17 +00:00
committed by GitHub
co-authored by Claude
parent bd3bb4eb26
commit 04a703e397
2 changed files with 39 additions and 0 deletions
@@ -95,6 +95,7 @@ class CompletionRequest(OpenAIBaseModel):
)
allowed_token_ids: list[int] | None = None
prompt_logprobs: int | None = None
bad_words: list[str] = Field(default_factory=list)
# --8<-- [end:completion-sampling-params]
# --8<-- [start:completion-extra-params]
@@ -371,6 +372,7 @@ class CompletionRequest(OpenAIBaseModel):
structured_outputs=self.structured_outputs,
logit_bias=self.logit_bias,
allowed_token_ids=self.allowed_token_ids,
bad_words=self.bad_words,
extra_args=extra_args or None,
skip_clone=True, # Created fresh per request, safe to skip clone
repetition_detection=self.repetition_detection,