[Frontend] expose stream_interval as req sampling param (#49754)
Signed-off-by: walterbm <walter.beller.morales@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
bf4f633b4c
commit
8040ef2426
@@ -476,6 +476,16 @@ class ChatCompletionRequest(OpenAIBaseModel):
|
||||
"can detect such behavior and terminate early, saving time and tokens.",
|
||||
)
|
||||
|
||||
stream_interval: Annotated[int, Field(ge=1)] | None = Field(
|
||||
default=None,
|
||||
description=(
|
||||
"Number of tokens to batch into each streamed chunk. Raises the "
|
||||
"server's `--stream-interval` for this request. Values below the "
|
||||
"server setting are clamped up to it. The first and last chunks "
|
||||
"are always sent immediately. Ignored for non-streaming requests."
|
||||
),
|
||||
)
|
||||
|
||||
# --8<-- [end:chat-completion-extra-params]
|
||||
|
||||
@model_validator(mode="before")
|
||||
@@ -690,6 +700,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
|
||||
output_kind=(
|
||||
RequestOutputKind.DELTA if self.stream else RequestOutputKind.FINAL_ONLY
|
||||
),
|
||||
stream_interval=self.stream_interval,
|
||||
structured_outputs=self.extract_structured_outputs(),
|
||||
logit_bias=self.logit_bias,
|
||||
bad_words=self.bad_words,
|
||||
|
||||
Reference in New Issue
Block a user