mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5017] [GUI] Monitor: show memory and expert placement, sampling, KV format and VRAM use; clear the recent requests #5286
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#5286
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/5017
Author: @elricdog
Created: 11/2/2026
Status: 🔄 Open
Base:
main← Head:main📝 Commits (1)
4619a07[GUI] Add Monitor insights and request clearing📊 Changes
20 files changed (+1833 additions, -12 deletions)
View changed files
➕
SMI2000-Changes.md(+1155 -0)📝
apps/host/server/index.mjs(+3 -0)📝
apps/host/server/monitor-dashboard.mjs(+1 -1)📝
apps/host/server/native-control.mjs(+3 -1)➕
apps/host/src/components/SmiMemoryPanel.tsx(+43 -0)➕
apps/host/src/components/SmiMonitorExtras.tsx(+82 -0)📝
apps/host/src/components/SnapshotDialog.tsx(+13 -1)📝
apps/host/src/lib/i18n.ts(+5 -2)📝
apps/host/src/lib/native-monitor.ts(+1 -1)➕
apps/host/src/lib/smi-expert-tiers.ts(+82 -0)📝
apps/host/src/lib/types.ts(+4 -1)➕
apps/host/src/locales/smi-en.json(+51 -0)➕
apps/host/src/locales/smi-es.json(+51 -0)📝
apps/host/src/main.tsx(+1 -0)📝
apps/host/src/screens/Monitor.tsx(+7 -3)➕
apps/host/src/styles/smi-monitor.css(+59 -0)📝
apps/host/tests/locale-gaps.test.mjs(+1 -1)➕
apps/host/tests/smi-monitor.test.mjs(+93 -0)📝
serve/server.py(+79 -1)➕
serve/test_smi_monitor.py(+99 -0)📄 Description
Quick Summary
Show RAM and expert placement, sampling defaults, KV cache details, VRAM breakdowns and prefill speeds. Add request-history clearing without resetting lifetime counters, plus PNG clipboard copying.
Include English and Spanish strings, host and server tests, and reapplication instructions for the local customization.
Problem and result
The Monitor did not show several things a user needs to tune a model that does not fit the GPU:
--kv) and what it costs in memory;There was also no way to start the request list and its averages again without restarting the model.
After this change the Monitor shows:
sampling→ Chat settings). A dot marks the values set in the model's config./metricsview only;/v1/statusand Prometheus keep counting from the server start. The model keeps running.On an RTX 3060 12 GB with 48 GB RAM, running Qwen3.8-Flash-Next UD-Q6_K_XL at 64K with
--kv k8v4and--resident-budget-gib 24, the card read the following. VRAM held 609 experts (2.5 GB). RAM held ≈5,796 experts (24.0 GB); the engine log says 5,791. NVMe held ≈18,171 experts (75.2 GB). The total was 24,576 experts (101.7 GB).Related discussion
None yet.
Approach
INFOline:expert_slots,expert_cache_mib,arena_mib,kv,context,kv_resident;ram_experts/cpu_expertson DeepSeek;serve/server.pyadds the following, all under anSMI2000comment:expertsandexpert_total_mib, read from the pack'snative_experts.txtheader.setdefaultkeeps any figure the engine reports itself.vram_parts(weights, draft, buffers in MiB), parsed from this start's log lines. A missing line leaves its part out.kv_mib_est, forqwen4exponly. It uses the same bytes per cell assetup.UD_FIT_KV_BYTESandstrata_control/vram_fit.py.samplingkey inGET /metrics.POST /metrics/reset. It sits behind the API key and_own_page()(JSON only, no foreign Origin), like/config. It clearshistoryand keeps a baseline oftotals, so only the/metricsview starts again.POST /api/native/instances/<id>/metrics/reset, which calls the server and re-reads/metrics?requests=all. Re-reading is needed because the host's poll merges older requests back in.SmiMemoryPanel.tsx,SmiMonitorExtras.tsx,smi-expert-tiers.ts(pure helpers, tested) andsmi-monitor.css. The hooks inMonitor.tsx,SnapshotDialog.tsx,native-monitor.ts,monitor-dashboard.mjsandtypes.tsare a few lines each.≈and nothing is guessed. The RAM expert count fromarena_miband the KV size are estimates. When a figure is missing, the part is left out or the card says so.smi-en.json/smi-es.jsoncatalog pair. Strings that already exist inen.jsonreuse their keys, so other languages keep their translations; the new strings fall back to English in the other seven languages.locale-gaps.test.mjsnow also readssmi-en./metricsonly gains keys. An older host ignores them, and a newer host with an older server shows the old Monitor plus a "Restart the model…" note. This is not opt-in: the new cards show by default. Per CONTRIBUTING this needs a maintainer decision.Validation
Revision
b99f1e35(onc62d5e3a). Windows, Node 22.4.1, the app's bundled Python. Strata 0.2.9 desktop app, engine 0.1.55 CUDA, RTX 3060 12 GB, 48 GB RAM.Passed:
node --test tests/smi-monitor.test.mjs tests/locale-gaps.test.mjs tests/native-monitor-projection.test.mjs tests/monitor-host-sensors.test.mjs tests/split-qa2-fields.test.mjsinapps/host: 27 pass, 0 fail.npx tsc --noEmitinapps/host: no errors.npm run buildinapps/host: built.python -m unittest serve.test_smi_monitor serve.test_vram: 13 tests OK.python -m unittest serve.test_server: 359 tests OK (3 skipped).scripts/preview-ui.mjsfixture with the figures above), checked by hand: all seven features render. Clear empties the list. Copy putsimage/pngon the clipboard.pack_expert_totalsgave 24,576 experts and 104,187 MiB.vram_parts_from_loggave weights 4,480, draft 1,152 and buffers 114 MiB.Failed:
npm test(full host suite): 4 failures, the same 4 as onc62d5e3awithout this change:engine-version.test.mjs;monitor-dashboard.test.mjs(cannot load.tson Node 22.4);timeskip-real.test.mjsfailed once in a full run and passed twice on its own.Not run:
Limits
VRAM_LOG_PARTSneeds updating; the test holds the 0.1.55 lines.arena_mib/ the average expert size (≈). The OS file cache may hold some "disk" experts; this is not measured, and the card says so.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.