Skip to content

Conversation

@bbartels
Copy link
Contributor

@bbartels bbartels commented Dec 3, 2025

Purpose

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@bbartels bbartels changed the title [Frontend] Add continuous_usage_stats to stream options [Frontend] FIxes anthropic /v1/messages streaming not containing input_tokens on first chunk Dec 3, 2025
@mergify mergify bot added the frontend label Dec 3, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Signed-off-by: bbartels <benjamin@bartels.dev>
@bbartels bbartels changed the title [Frontend] FIxes anthropic /v1/messages streaming not containing input_tokens on first chunk [Frontend] Fixes anthropic /v1/messages streaming not containing input_tokens on first chunk Dec 3, 2025
@DarkLight1337
Copy link
Member

Can you add a regression test?

Signed-off-by: bbartels <benjamin@bartels.dev>
@bbartels
Copy link
Contributor Author

bbartels commented Dec 4, 2025

@DarkLight1337 added a test

Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) December 4, 2025 03:18
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 4, 2025
@DarkLight1337 DarkLight1337 merged commit fca3f46 into vllm-project:main Dec 4, 2025
48 checks passed
PatrykSaffer pushed a commit to PatrykSaffer/vllm that referenced this pull request Dec 4, 2025
…t_tokens on first chunk (vllm-project#29971)

Signed-off-by: bbartels <benjamin@bartels.dev>
charlotte12l pushed a commit to charlotte12l/vllm that referenced this pull request Dec 5, 2025
…t_tokens on first chunk (vllm-project#29971)

Signed-off-by: bbartels <benjamin@bartels.dev>
Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
charlotte12l pushed a commit to charlotte12l/vllm that referenced this pull request Dec 9, 2025
…t_tokens on first chunk (vllm-project#29971)

Signed-off-by: bbartels <benjamin@bartels.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants