-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
[Frontend] Fixes anthropic /v1/messages streaming not containing input_tokens on first chunk #29971
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
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.
Code Review
This pull request aims to add support for continuous_usage_stats to the Anthropic-compatible streaming endpoint. The implementation correctly enables the option when converting to an OpenAI request. However, there is a critical issue in how the message_start event is constructed. The usage information is placed at the top level of the event, whereas the Anthropic API specification requires it to be nested within the message object. I've provided a suggestion to correct this, ensuring API compliance.
|
Can you add a regression test? |
Signed-off-by: bbartels <benjamin@bartels.dev>
|
@DarkLight1337 added a test |
DarkLight1337
left a comment
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.
Thanks for fixing!
…t_tokens on first chunk (vllm-project#29971) Signed-off-by: bbartels <benjamin@bartels.dev>
…t_tokens on first chunk (vllm-project#29971) Signed-off-by: bbartels <benjamin@bartels.dev> Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
…t_tokens on first chunk (vllm-project#29971) Signed-off-by: bbartels <benjamin@bartels.dev>
Purpose
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.