Skip to content

feat(server): report per-request timings in Anthropic /v1/messages responses - #966

Open
void-mckenzie wants to merge 1 commit into
FlashML-org:mainfrom
void-mckenzie:feat/anthropic-timings
Open

void-mckenzie wants to merge 1 commit into
FlashML-org:mainfrom
void-mckenzie:feat/anthropic-timings

Conversation

@void-mckenzie

@void-mckenzie void-mckenzie commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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 streamed message_delta. #814 excluded /v1/messages precisely because llama.cpp
emitted nothing there; that premise is gone upstream, so this re-follows llama-server rather than leading it.

Verified

  • python -m pytest tests/server/: 705 passed, incl. 2 new tests: block on message_delta + flag gating, and block on the non-stream body + absence when the flag is off (fake engine acks, no GPU).
  • Live serving: not run yet, I would appreciate a test run here (my PC is busy with other research items). The wire shape should be one timings object next to usage on a non-stream response and one on the message_delta event when streaming, nothing without the flag:
ft serve <checkpoint> --enable-timings-report --port 10021
curl -s localhost:10021/v1/messages -H 'content-type: application/json' \
  -d '{"model":"<id>","max_tokens":32,"messages":[{"role":"user","content":"say hi"}]}' | jq '.timings'
curl -sN localhost:10021/v1/messages -H 'content-type: application/json' \
  -d '{"model":"<id>","max_tokens":32,"stream":true,"messages":[{"role":"user","content":"say hi"}]}' | grep -o '"timings":{[^}]*}'

Restart without --enable-timings-report and both must show nothing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report per-request timings in Anthropic /v1/messages responses (llama.cpp ggml-org/llama.cpp#30244 now emits them)

1 participant