mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2688] [CLOSED] serve: the Profile tab in the web app (opt-in "profile": true): last request, the last 50, a measured run, the tuning with its before and after, the speed settings #4211
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#4211
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/2688
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed
Base:
main← Head:qiuzan2001/profile-tab📝 Commits (3)
f895de3tools: strata_profile.py, one command that says where the time goes on this PC (prompt phases, decode window split, hit rate per turn)8cd4387serve: the Profile page (/profile, opt-in "profile": true): the last request's breakdown as it happens, a run of tools/strata_profile.py and setup's calibration from the page469ceb7serve: the Profile tab in the web app (opt-in "profile": true): last request, the last 50, a measured run, the tuning with its before and after, the speed settings📊 Changes
16 files changed (+5920 additions, -22 deletions)
View changed files
📝
SECURITY.md(+7 -3)➕
bench/results/2026-10-15-profile-rtx-5070-ti-swift-1-5-iq3-s/README.md(+55 -0)➕
bench/results/2026-10-15-profile-rtx-5070-ti-swift-1-5-iq3-s/results.json(+1978 -0)➕
bench/results/2026-10-15-timing-switches-rtx-5070-ti/README.md(+20 -0)➕
bench/results/2026-10-15-timing-switches-rtx-5070-ti/ab_engine.jsonl(+24 -0)📝
docs/COMMUNITY_BENCHMARKS.md(+8 -0)📝
docs/DETAILS.md(+51 -1)➕
serve/profile_page.py(+690 -0)📝
serve/runconfig.py(+1 -0)📝
serve/server.py(+173 -6)➕
serve/test_profile.py(+903 -0)📝
serve/web/app.css(+57 -3)📝
serve/web/app.js(+535 -9)📝
serve/web/index.html(+158 -0)➕
tools/strata_profile.py(+816 -0)➕
tools/test_strata_profile.py(+444 -0)📄 Description
What it changes
With
"profile": true(or--profile) the web app gets a fifth tab, Profile, next to About. It replaces thestandalone
/profilepage of #2661 with a tab, so the page and the tab do not show the same data twice. Its five cards:line says when a request is running.
tools/strata_profile.pywith one click: progress, then its three tables and the findings, eachfinding with a chip per setting it names (loaded now / next load).
of the calibrated flags, the calibration's tok/s and the server's note.
will use, the value the run config file has, one plain sentence and what the last run said about it.
Server side:
GET /profile/history(new): the last 50 requests, read from the engine log (ProfileHistory, in memory, timingsonly, no prompts or answers; driven by the
/metricspoll).GET /profile/settings(new): the three columns above. It never showsapi_key, another env value or a path(
expert_profile_saveis only"set"or null)./profile/status:report.findings(each with the settings it names) andtune.report(summary, tok/s, before/afterrows).
GET /profileis now a 302 to./#profile(../#profilefor/profile/), relative, so it works behind a prefix./healthgains"profile": trueonly when the tab is on.serve/web/profile.htmlandserve/web/profile.jsare deleted. No new file, no new dependency, no CDN.Server data reaches the page through
textContentonly (a test checks the Profile section ofapp.jshas noinnerHTML). Both POSTs keep the own-page check (JSON only, no foreignOrigin, the key when one is set).What it leaves alone
The engine,
tools/strata_profile.py,tools/calibrate.pyand setup's calibration. No new run-config keys; speed flagsare not edited from the tab. Replicas and HIP are not supported for tuning, as in #2661 (
tune_unavailablesays so)./api-monitoris unchanged.Stacked on #2660 and #2661
This branch is
8cd43878(#2660'stools/strata_profile.py+ #2661's page) plus one commit. It replaces #2661'sstandalone page with the tab. The maintainer can take #2661 alone (the page) or both (the tab instead of the page);
the code is the same either way.
The default stays as it was
StrataEngine.start,child_env) changes.test_child_env_sets_them_only_with_the_keystays green.
profilekey:/healthhas noprofilekey. On the mock engine (--engine mock)/healthisbyte-identical to
8cd43878(same md5,fa87eb45...), and/profile,/profile/history,/profile/settingsanswer404.
hiddeninindex.html; onlyhealth.profile === trueshows it. No profile request is made whenit is off (checked in a browser: 0 fetches).
/metricsnever reads the history when it is off.test_off_by_defaultpins this and the/healthkey set. Ichecked the test by mutation: removing the
if self.profile is not Noneguard inmetrics()fails it, and so doesmaking
/healthalways send aprofilekey.profilekey in/config("... show the Profile tab ..."), and a
data-keyattribute on the About tab's Model settings inputs. One more:typing
#profilewith the tab off now shows a card that says how to turn it on, instead of falling back to Chat.--profilehelp).Tests
All without a GPU, from the repository root with
python3 -m unittest:serve.test_profileserve.test_runconfigserve.test_monitorserve.test_lifecycleserve.test_securitytools.test_strata_profileserve.test_server8cd43878(No module named 'regex'in this environment)node --check serve/web/app.jsNew tests cover: the history (order, open entry, ring of 50, engine starts, whole lines and 1 MiB, a log that was
emptied or replaced, a long tail without a newline, a batch that cannot be parsed, lines written during a tuning),
finding_settings(and that every settingstrata_profile.findingsnames is mapped, so a change of its wording fails),the settings rows, the tune before/after (numbers compared as numbers, the table without the summary line), the
redirects, the key guards, and that the tab's ids are in
index.htmlandapp.js.Measured, on a named PC
RTX 5070 Ti 16 GB + Ryzen 7 5800X3D, Swift 1.5 IQ3_S, one run each:
profileis on) cost 3.9-4.7% on an 8K-token prompt read, decode within its noise:bench/results/2026-10-15-timing-switches-rtx-5070-ti.--pcie-frac 0.35 --spec-min-p 0.70 --adapt-every 1 --adapt-swaps 160 --adapt-decay 0.97(96.6 tok/s by the calibration's own measurement). One run, nobench/resultsfolder for it.Checked end to end on that PC
Headless Chromium against the running server with
"profile": true: no console error, page error or failed request./healthhas the key; the tab shows;#profilelands on it; the off card is hidden."A request is running (Generating · ...)"; the history row appears.
/profile/statusrequests (the 10 s away poll); back on the tab: "Done in 47 s", the three tables, 9 findings with 9setting chips, the report path.
vram_reserve_mibinput focused.GET /profile-> 302./#profile,/profile/->../#profile. Light and dark themes both render.A sub-agent reviewer read the diff and ran the checks above on a second mock server and a headless browser; it gave 12
findings (the history filling with the calibration's requests during a tune, a wrong "no setting changed" after a
re-tune, parts of the page rebuilt every 2 s while a run goes, a misleading note for flags the server adds itself, and
smaller ones). All 12 are fixed in this commit, each with a test where the code can be tested. For the fourth I chose
the plain wording: the row says "the run config file has X; the server reads it when Strata starts", because the next
start's flags (
engine_args, the shell's environment) are not the file's.One thing in the design is wrong and is not followed: "If the summary says the defaults were already the fastest, the
table has no bold row". A second tuning puts earlier tuned values back to the defaults, so rows do change; the tab
says that in words.
The standalone companion, Strata Profile Studio (Python standard library only), reads this tool's reports and compares runs against the noise floor of the PC, with a sign test over the agent turns.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.