Repository navigation
feat(server): report per-request timings in Anthropic /v1/messages responses - #966
Open
void-mckenzie wants to merge 1 commit into
Open
void-mckenzie wants to merge 1 commit into
void-mckenzie wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #965.
llama.cpp merged ggml-org/llama.cpp#30244 (2026-11-30): llama-server now attaches its stats block in
to_json_anthropic()and on the streamedmessage_delta. #814 excluded/v1/messagesprecisely because llama.cppemitted nothing there; that premise is gone upstream, so this re-follows llama-server rather than leading it.
timingsnext tousageon non-stream,timingson the terminalmessage_deltaon streams.GenResult/GenDone, shaped by the sharedtimings_block().--enable-timings-report, absent on errors and aborts, unrounded. Notimings_per_tokenfield:/v1/messagesstays terminal-only, as llama.cpp left it.docs/cli.mdand extend the--enable-timings-reporthelp.tests/server/test_anthropic_api.py, no new files or fixtures.Verified
python -m pytest tests/server/: 705 passed, incl. 2 new tests: block onmessage_delta+ flag gating, and block on the non-stream body + absence when the flag is off (fake engine acks, no GPU).timingsobject next tousageon a non-stream response and one on themessage_deltaevent when streaming, nothing without the flag:Restart without
--enable-timings-reportand both must show nothing.