Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change ChatCompletionChunk to align with "OpenAI Chat Completions str… #3003

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sywangyi
Copy link
Contributor

…eaming API"

When stream_options: {"include_usage": true} is included, choices is None only for the last chunk, and usage is always None except for the last chunk.

see https://cookbook.openai.com/examples/how_to_stream_completions#4-how-to-get-token-usage-data-for-streamed-chat-completion-response
@OlivierDehaene OR @Narsil

…eaming API"

When stream_options: {"include_usage": true} is included, choices is None only for the last chunk, and usage is always None except for the last chunk.

Signed-off-by: Wang, Yi A <[email protected]>
@sywangyi
Copy link
Contributor Author

details please refer discussion in vllm-project/vllm#12394

Signed-off-by: Wang, Yi A <[email protected]>
@drbh drbh mentioned this pull request Feb 10, 2025
@Narsil
Copy link
Collaborator

Narsil commented Feb 10, 2025

What's broken otherwise ?

Our baseline is if it breaks the OpenAI client we try to fix it (depending on how much it's tying to internals it's sometimes hard to be ISO compatible), and otherwise we try to minimize the amount of bits we send (that are not useful) and therefore we don't send what's not needed.

We don't look that much as the actual payload they send/receive as they tend to change them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants