Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
f3237f3f
Unverified
Commit
f3237f3f
authored
Dec 12, 2025
by
Benjamin Bartels
Committed by
GitHub
Dec 12, 2025
Browse files
[Frontend] Fixes anthropic streaming message_start usage nesting (#30266)
Signed-off-by:
bbartels
<
benjamin@bartels.dev
>
parent
9c0ee995
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
tests/entrypoints/openai/test_messages.py
tests/entrypoints/openai/test_messages.py
+6
-3
vllm/entrypoints/anthropic/serving_messages.py
vllm/entrypoints/anthropic/serving_messages.py
+6
-6
No files found.
tests/entrypoints/openai/test_messages.py
View file @
f3237f3f
...
...
@@ -79,9 +79,12 @@ async def test_anthropic_streaming(client: anthropic.AsyncAnthropic):
assert
chunk_count
>
0
assert
first_chunk
is
not
None
,
"message_start chunk was never observed"
assert
first_chunk
.
usage
is
not
None
,
"first chunk should include usage stats"
assert
first_chunk
.
usage
[
"output_tokens"
]
==
0
assert
first_chunk
.
usage
[
"input_tokens"
]
>
5
assert
first_chunk
.
message
is
not
None
,
"first chunk should include message"
assert
first_chunk
.
message
.
usage
is
not
None
,
(
"first chunk should include usage stats"
)
assert
first_chunk
.
message
.
usage
.
output_tokens
==
0
assert
first_chunk
.
message
.
usage
.
input_tokens
>
5
@
pytest
.
mark
.
asyncio
...
...
vllm/entrypoints/anthropic/serving_messages.py
View file @
f3237f3f
...
...
@@ -324,13 +324,13 @@ class AnthropicServingMessages(OpenAIServingChat):
id
=
origin_chunk
.
id
,
content
=
[],
model
=
origin_chunk
.
model
,
),
usage
=
AnthropicUsage
(
input_tokens
=
origin_chunk
.
usage
.
prompt_tokens
if
origin_chunk
.
usage
else
0
,
output_tokens
=
0
,
),
),
)
first_item
=
False
data
=
chunk
.
model_dump_json
(
exclude_unset
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment