mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #177] [CLOSED] Web UI: prefill speeds, request timings, a context gauge, chat compaction #2492
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2492
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
26c6506Surface prefill speeds: a Monitor card, the live reading rate, per-request history6d810bdChat: 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_stelemetry series, andprompt_tok_sper request in/metricshistory. In the Monitor: a Prefill card, the rate on the "Reading prompt"line,
read N @ X tok/son the last-request line, a Read t/s column in the requeststable.
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/200Kwith a fill bar next to the sampling button. Amber at 70%of the window, red at 90%. Updates from
usageafter each reply. Passive - it does nottrigger 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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.