Add system_fingerprint field to OpenAI-compatible API responses (#40537)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Simon Mo
2026-04-27 16:17:52 +08:00
committed by GitHub
co-authored by Claude
parent 8d8062d0a7
commit ebf862c351
10 changed files with 225 additions and 2 deletions
@@ -129,6 +129,9 @@ class ChatCompletionStreamResponse(OpenAIBaseModel):
model: str
choices: list[ChatCompletionResponseStreamChoice]
usage: UsageInfo | None = Field(default=None)
# Set only on the final chunk of a stream to mirror non-streaming responses
# without the per-chunk serialization overhead.
system_fingerprint: str | None = None
# not part of the OpenAI spec but for tracing the tokens
prompt_token_ids: list[int] | None = None