[PR #177] [CLOSED] Web UI: prefill speeds, request timings, a context gauge, chat compaction #2492

Closed
opened 2026-11-04 02:00:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/177
Author: @orangeswim
Created: 9/29/2026
Status: ❌ Closed

Base: main ← Head: prefill-metrics


📝 Commits (2)

  • 26c6506 Surface prefill speeds: a Monitor card, the live reading rate, per-request history
  • 6d810bd Chat: compact older turns into a summary - the page keeps every message

📊 Changes

9 files changed (+534 additions, -23 deletions)

View changed files

📝 docs/DETAILS.md (+6 -3)
📝 serve/server.py (+42 -3)
📝 serve/telemetry.py (+3 -1)
➕ serve/test_web_fold.py (+30 -0)
📝 serve/web/app.css (+44 -0)
📝 serve/web/app.js (+261 -14)
➕ serve/web/fold.js (+40 -0)
📝 serve/web/index.html (+10 -2)
➕ serve/web/test_fold.mjs (+98 -0)

📄 Description

Web UI: prefill speeds, request timings, a context gauge, chat compaction

No engine changes. This UI change exposes some metrics already tracked.

Prefill speeds. _prompt_tok_s() in server.py (the cumulative mean, not a window -
the engine reports prompt progress per 8k chunk, so a window rate swings between 0 and
the burst rate), a prompt_tok_s telemetry series, and prompt_tok_s per request in
/metrics history. In the Monitor: a Prefill card, the rate on the "Reading prompt"
line, read N @ X tok/s on the last-request line, a Read t/s column in the requests
table.

Request details in chat. A chevron on each reply opens one line:
read 25,838 @ 2,165 tok/s · 1,850 reused · TTFT 12.4 s · drafts 214 of 240 accepted.
It's the response's timings (llama.cpp names), kept in localStorage with the message.

Tokens in/out. A Monitor card from the server's running totals: everything read vs
written since the server started (1.2M / 340k, cache reuse excluded from the in side),
with the request count and reused tokens as its sub-line.

Context gauge. 2.4k/200K with a fill bar next to the sampling button. Amber at 70%
of the window, red at 90%. Updates from usage after each reply. Passive - it does not
trigger anything.

Compaction. The layers button folds the older turns into a summary; the newest turns stay verbatim up to a ~5k-token budget, the API payload becomes the summary plus everything after the cut, and the page keeps every message (older turns muted above the cut). The summary is one hidden non-streaming request (thinking off, temp 0, 1600 tokens max) with a structured prompt: intent, facts and decisions, verbatim code, all user messages, errors and fixes, open items, current thread. The fold marker lands at the end of the chat with its stats; only the newest marker carries a "put back into the context" undo (an earlier one could not restore anything - a later fold still stands over it), and unfolding peels
one layer at a time. Chained folds merge. Long user messages (>10 lines / 800 chars) clamp with a Show-all toggle - display only, the API gets the full text.

All 38 serve tests pass unchanged. Tested on a 3090 against 0.1.26 (k8v4 and int8).

AI Tools

Created and reviewed with the help of Claude-Code using GLM-5.3, Strata qwen3.8-flash-next-coder-iq1_m and Codex.

image image image

🔄 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/177 **Author:** [@orangeswim](https://github.com/orangeswim) **Created:** 9/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `prefill-metrics` --- ### 📝 Commits (2) - [`26c6506`](https://github.com/Niko1221/Strata/commit/26c650658d8d5fd24ae4ee799c5f8e4a513bbd79) Surface prefill speeds: a Monitor card, the live reading rate, per-request history - [`6d810bd`](https://github.com/Niko1221/Strata/commit/6d810bddc22b76cfb5658045985e2b077734af46) Chat: compact older turns into a summary - the page keeps every message ### 📊 Changes **9 files changed** (+534 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+6 -3) 📝 `serve/server.py` (+42 -3) 📝 `serve/telemetry.py` (+3 -1) ➕ `serve/test_web_fold.py` (+30 -0) 📝 `serve/web/app.css` (+44 -0) 📝 `serve/web/app.js` (+261 -14) ➕ `serve/web/fold.js` (+40 -0) 📝 `serve/web/index.html` (+10 -2) ➕ `serve/web/test_fold.mjs` (+98 -0) </details> ### 📄 Description # Web UI: prefill speeds, request timings, a context gauge, chat compaction No engine changes. This UI change exposes some metrics already tracked. **Prefill speeds.** `_prompt_tok_s()` in server.py (the cumulative mean, not a window - the engine reports prompt progress per 8k chunk, so a window rate swings between 0 and the burst rate), a `prompt_tok_s` telemetry series, and `prompt_tok_s` per request in `/metrics` history. In the Monitor: a Prefill card, the rate on the "Reading prompt" line, `read N @ X tok/s` on the last-request line, a Read t/s column in the requests table. **Request details in chat.** A chevron on each reply opens one line: `read 25,838 @ 2,165 tok/s · 1,850 reused · TTFT 12.4 s · drafts 214 of 240 accepted`. It's the response's `timings` (llama.cpp names), kept in localStorage with the message. **Tokens in/out.** A Monitor card from the server's running totals: everything read vs written since the server started (`1.2M / 340k`, cache reuse excluded from the in side), with the request count and reused tokens as its sub-line. **Context gauge.** `2.4k/200K` with a fill bar next to the sampling button. Amber at 70% of the window, red at 90%. Updates from `usage` after each reply. Passive - it does not trigger anything. **Compaction.** The layers button folds the older turns into a summary; the newest turns stay verbatim up to a ~5k-token budget, the API payload becomes the summary plus everything after the cut, and the page keeps every message (older turns muted above the cut). The summary is one hidden non-streaming request (thinking off, temp 0, 1600 tokens max) with a structured prompt: intent, facts and decisions, verbatim code, all user messages, errors and fixes, open items, current thread. The fold marker lands at the end of the chat with its stats; only the newest marker carries a "put back into the context" undo (an earlier one could not restore anything - a later fold still stands over it), and unfolding peels one layer at a time. Chained folds merge. Long user messages (>10 lines / 800 chars) clamp with a Show-all toggle - display only, the API gets the full text. All 38 serve tests pass unchanged. Tested on a 3090 against 0.1.26 (k8v4 and int8). ### AI Tools Created and reviewed with the help of Claude-Code using GLM-5.3, Strata qwen3.8-flash-next-coder-iq1_m and Codex. <img width="1288" height="848" alt="image" src="https://github.com/user-attachments/assets/16e9a7a2-1781-4973-b2e4-cd80b8d76658" /> <img width="917" height="852" alt="image" src="https://github.com/user-attachments/assets/616a75b4-22d6-450b-afae-cec2055101f4" /> <img width="1010" height="716" alt="image" src="https://github.com/user-attachments/assets/6fced703-f2c8-406f-bd1b-32aa48cf8ad4" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:00:41 +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#2492
No description provided.