[PR #3291] [CLOSED] [Engine] serve: report timings on /v1/responses #4552

Closed
opened 2026-11-07 15:37:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3291
Author: @pschaub
Created: 10/19/2026
Status: ❌ Closed

Base: main ← Head: serve-responses-timings


📝 Commits (1)

  • bc9c42e serve: report timings on /v1/responses like /v1/chat/completions

📊 Changes

2 files changed (+24 additions, -2 deletions)

View changed files

📝 serve/responses.py (+11 -2)
📝 serve/test_server.py (+13 -0)

📄 Description

Problem and result

/v1/chat/completions returns top-level timings (#107), but /v1/responses (#451) does not, although server.py already computes them for every request. Now the final response.completed / response.incomplete event and the non-streaming reply include the same timings object.

Follow-up to #107 (based on #83) for /v1/responses.

Approach

_with_timings in serve/responses.py copies done["timings"] onto the final event; collect() keeps it on the non-streaming reply. Nothing else changes.

Validation

Passed:

  • python -m unittest discover -s serve -t . -p "test_*.py" on this branch (one commit on main e88ee39), Windows 11, Python 3.12: 882 tests OK, 20 skipped. The same command on main e88ee39 without the change: 881 tests OK, 20 skipped.
  • The new UsageAndStatus.test_responses fails without the change.
  • Live check on main e88ee39 (Windows 11, CUDA): the final event of streamed /v1/responses requests carries timings; without the change it does not.

Failed:
none observed

Not run:

  • Linux and macOS.
  • The non-streaming /v1/responses reply was checked by the unit test only; the live check used streaming.
  • No CUDA, HIP, SYCL or Metal build: the change is Python only.

Limits

response.failed carries no timings.


Created with Claude Opus 5.5. The result was verified by a human (me) in llama-swap: prompt and decode speeds now show for /v1/responses requests.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3291 **Author:** [@pschaub](https://github.com/pschaub) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `serve-responses-timings` --- ### 📝 Commits (1) - [`bc9c42e`](https://github.com/Niko1221/Strata/commit/bc9c42e6ae312fbc32e53075db61b76b1f596afa) serve: report timings on /v1/responses like /v1/chat/completions ### 📊 Changes **2 files changed** (+24 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `serve/responses.py` (+11 -2) 📝 `serve/test_server.py` (+13 -0) </details> ### 📄 Description ## Problem and result /v1/chat/completions returns top-level `timings` (#107), but /v1/responses (#451) does not, although server.py already computes them for every request. Now the final `response.completed` / `response.incomplete` event and the non-streaming reply include the same `timings` object. ## Related discussion Follow-up to #107 (based on #83) for /v1/responses. ## Approach `_with_timings` in serve/responses.py copies `done["timings"]` onto the final event; `collect()` keeps it on the non-streaming reply. Nothing else changes. ## Validation **Passed:** - `python -m unittest discover -s serve -t . -p "test_*.py"` on this branch (one commit on main e88ee39), Windows 11, Python 3.12: 882 tests OK, 20 skipped. The same command on main e88ee39 without the change: 881 tests OK, 20 skipped. - The new `UsageAndStatus.test_responses` fails without the change. - Live check on main e88ee39 (Windows 11, CUDA): the final event of streamed /v1/responses requests carries timings; without the change it does not. **Failed:** none observed **Not run:** - Linux and macOS. - The non-streaming /v1/responses reply was checked by the unit test only; the live check used streaming. - No CUDA, HIP, SYCL or Metal build: the change is Python only. ## Limits `response.failed` carries no timings. --- Created with Claude Opus 5.5. The result was verified by a human (me) in llama-swap: prompt and decode speeds now show for /v1/responses requests. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:37:21 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4552
No description provided.