-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Add support for usage in the OpenAI frontend vLLM backend
#8264
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
Conversation
usage in the OpenAI frontend vLLM backendusage in the OpenAI frontend vLLM backend
Co-authored-by: richardhuo-nv <[email protected]>
|
NVIDIA/TensorRT-LLM#5445 |
|
Does the change include reporting each streaming chunk's usage? If not, have we verified with the requestor that if per chunk usage is needed? |
For streaming, it reports the https://platform.openai.com/docs/api-reference/chat/create#chat-create-stream_options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job! Thanks!

What does the PR do?
usagesupport by default for non-streaming requestsstreaming optionsandusagein streaming requestsChecklist
<commit_type>: <Title>Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
Where should the reviewer start?
Test plan:
Caveats:
Background
By default, the OpenAI API supports
usagefor non-streaming requests. For streaming requests, we need to enablestream_options: {"include_usage": true}.https://platform.openai.com/docs/api-reference/chat/create
https://platform.openai.com/docs/api-reference/chat-streaming
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)