Repository navigation
Studio: per-request perf stats and slot usage in the API monitor - #8045
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56a1fd1b8d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be13ddb26f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f00d860de6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d12d1162d8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # studio/backend/routes/inference.py
…rds from decode timing for PR unslothai#8045
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The relay filter ran a full json.loads on every SSE line of every proxied stream. A usage chunk always spells the key literally, so a substring test rejects content deltas 16x cheaper and leaves the parse to decide the rest.
|
Ran a performance check on this against Setup: two isolated Studios from the same commit pair ( Microbenchmark, per streamed chunk (best of 7, 20k iterations each):
So roughly 0.6 to 0.8 us added per chunk. At 500 tok/s that is under 0.05% of the per-token budget. The one item worth changing was the relay filter. End to end, interleaved pre/post request by request, both llama-servers warm and on the same GPU, 40 pairs at 1000 max_tokens: No slowdown. Two earlier runs did show a difference and both turned out to be the harness, not the diff: a sequential A/B put +11% on this branch purely because the two Studios sat on GPUs with different tenant load, and a same-GPU rerun put -51% on it because one llama-server had a warm prompt cache and the other had just restarted. The per-pair trace converged to zero by pair 25. Only the warm steady-state number above is meaningful, and it is a wash. Also confirmed the new readouts against a live server rather than only in tests. Polling |
|
Screenshots for the before/after, since the change is mostly a UI one. Two isolated Studios from the same commit pair, Request detail. Six fields before, nine after: FIRST TOKEN, SPEED and STOP REASON are the new ones. Mid-generation. Both headers say "Serving requests", but only the branch shows the live slot readout ( Settled. Whole run side by side, left Same thing from the API rather than from pixels. Polling and the finished row: Performance numbers behind the comment above are in the same folder: pre.json, post.json for the per-chunk microbenchmark, and e2e_interleaved.json for the interleaved end-to-end A/B. |




Adds tok/s, time-to-first-token and stop reason to each request in the API monitor, plus a live slots readout (busy/queued) in the status strip, sourced from the existing admission queue. Engine timings are used when llama.cpp reports them (streaming and non-streaming), with a measured fallback for other backends. Old backends degrade gracefully.