[GH-ISSUE #4297] [GUI] Monitor: show cached, reading and generated tokens in the Context card #1899

Closed
opened 2026-11-04 01:55:09 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @thisisspartan on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4297

Summary

Propose replacing the single-figure "Context fill" gauge on the Monitor tab
with a four-segment context donut: Cached (prefix) | Reading (prefill) |
Generating (decode) | Free — each segment in the ring and as a legend
row with its percent and token count; the center keeps the exact usage figure.

Context usage donut preview

Why this matters

The current gauge shows one number: used / window. When a prompt reuses a
cached prefix, none of it is visible during the request:

  1. how much of the prompt was served instantly from the cache;
  2. how many new tokens are being read right now;
  3. how much headroom is left before truncation.

The reuse only appears after the request finishes, in the Reused column. Your
own 0.2.3 release notes advertise this behavior ("91% of the prompt was reused
instead of 0%") — during such a request the Monitor shows none of it.

Proposed behavior

  • Cached (prefix): prompt tokens taken from the prefix cache.
  • Reading (prefill): tokens being read now, from the first token after the
    cached prefix.
  • Generating (decode): tokens generated in the answer.
  • Free: remaining headroom in the context window.
  • Center: exact used figure and percent; the percent goes to the warning
    tone at 85%+, the danger tone only on a real overflow.
  • All parts draw from data already in /metrics (prompt_tokens,
    prompt_read, generated; the cached part from the request's reused
    record — the same source the Reused column uses). One additive line in
    serve/server.py exposes that counter while the request runs, so the cached
    arc appears live; without it it appears when the request completes.
  • The native basement bars (Experts in VRAM / System RAM / GPU temperature)
    stay as a separate card below, unchanged.

Scope

  • Frontend only: one render function plus two small helpers in app.js, one
    card markup block in index.html, one rule block and two theme-scoped token
    lines in app.css (no existing theme token redefined; the donut adds one
    local --kv-cached, a color-mix over existing tokens).
  • Zero changes to the engine (C++ core, kernels).
  • One additive field in the /metrics live payload, as above.
  • The change ships with its own tests; the existing test files are untouched.

A working prototype is ready (screenshots and the diff can be provided on
request). Would you take this as one PR (donut + the one server line), or
prefer it split?

Originally created by @thisisspartan on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4297 ### Summary Propose replacing the single-figure "Context fill" gauge on the Monitor tab with a four-segment context donut: **Cached (prefix)** | **Reading (prefill)** | **Generating (decode)** | **Free** — each segment in the ring and as a legend row with its percent and token count; the center keeps the exact usage figure. <img width="308" height="397" alt="Context usage donut preview" src="https://github.com/user-attachments/assets/00db7a9a-1a0e-4e0d-ba27-0e17930cebe5" /> ### Why this matters The current gauge shows one number: used / window. When a prompt reuses a cached prefix, none of it is visible during the request: 1. how much of the prompt was served instantly from the cache; 2. how many new tokens are being read right now; 3. how much headroom is left before truncation. The reuse only appears after the request finishes, in the Reused column. Your own 0.2.3 release notes advertise this behavior ("91% of the prompt was reused instead of 0%") — during such a request the Monitor shows none of it. ### Proposed behavior - **Cached (prefix):** prompt tokens taken from the prefix cache. - **Reading (prefill):** tokens being read now, from the first token after the cached prefix. - **Generating (decode):** tokens generated in the answer. - **Free:** remaining headroom in the context window. - **Center:** exact used figure and percent; the percent goes to the warning tone at 85%+, the danger tone only on a real overflow. - All parts draw from data already in `/metrics` (`prompt_tokens`, `prompt_read`, `generated`; the cached part from the request's `reused` record — the same source the Reused column uses). One additive line in `serve/server.py` exposes that counter while the request runs, so the cached arc appears live; without it it appears when the request completes. - The native basement bars (Experts in VRAM / System RAM / GPU temperature) stay as a separate card below, unchanged. ### Scope - Frontend only: one render function plus two small helpers in `app.js`, one card markup block in `index.html`, one rule block and two theme-scoped token lines in `app.css` (no existing theme token redefined; the donut adds one local `--kv-cached`, a color-mix over existing tokens). - Zero changes to the engine (C++ core, kernels). - One additive field in the `/metrics` live payload, as above. - The change ships with its own tests; the existing test files are untouched. A working prototype is ready (screenshots and the diff can be provided on request). Would you take this as one PR (donut + the one server line), or prefer it split?
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660229151 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1899
No description provided.