Repository navigation
Conversation
tensorfold serve --dashboard samples the numbers the live line already computes once a second and serves them at /stats, with the page at /dashboard: the decode/prefill dial, context used and window, cached tokens, MLX memory against the budget, the 5-minute decode min/max, and the average prefill rate. One static file, one sampler thread, no new dependencies; the routes 404 without the flag. The CUDA server says so plainly rather than serving an empty page.
The memory tile gains the context tile's bar, scaled against the process budget. A new tile shows the live streams' speculative state (drafts accepted of drafted). Below the tiles, the page lists finished requests newest first: total/prefill/decode seconds, the request's own tok/s plus the burst range its last rounds reached, prompt and reply tokens, cache hit or miss, rounds, and per-request acceptance — fed by the scheduler's retire path, 32 kept.
cli.py: upstream moved the serve parser into cli_args.build_parser; the --dashboard flag lives there now and the collector hooks ride on the new function layout. prompt_fill.py: keep upstream's fed/left/passed fill accounting and record the same fed count into the dashboard collector.
context_snapshot and stream_spec_snapshot walked the single _filling job the 0.4.0 scheduler kept; fills are a PromptFill._fills list now, whose jobs the upstream Scheduler.filling property already returns.
The page loaded fine from a repo checkout (tests run against src/) but a pip install served 404s: package-data had no entry for tensorfold.server.
The 5-minute RollingRate history the sampler already records now renders as a strip chart under the dial: a cyan line over the sparse timestamped points (idle seconds leave gaps, so x follows the timestamp), a sliding 5-minute window, a dashed peak guide and a fill under the line. The section hides until the first poll delivers points.
- 'totals': lifetime prompt/generated tokens, request count, mean TTFT and cumulative draft acceptance from the finished-request metrics /metrics publishes, shown as a strip under the tiles (hidden until one finishes) - 'kv_pool': the fullest live stream's cache occupancy against the context window — the TUI's KV peak pool — under the context bar
8 tasks done
ashhart
added a commit
that referenced
this pull request
Oct 6, 2026
…400) With --dashboard (off by default) the native server serves a small self-contained page at /dashboard and the JSON snapshot it polls at /stats: running and waiting requests, decode and prefill rates, tokens in flight and finished, decode rounds, the draft totals, and memory where the engine reports it. Without the flag both paths are unknown routes (404). With API keys set, both need a key like the rest of the API, so the page suits keyless, usually local, servers. Successful /stats reads stay out of the access log, so the page's once-a-second polls do not flood it. The Python CLI hands the flag to the native engine only. Tests check the page's fields and the /stats snapshot's keys, with memory left out when unknown. Co-authored-by: heitke <[email protected]>
Owner
|
Thank you, @heitke. A first version landed in the Zig engine as 96dc312, with your credit. The Zig page is smaller than yours so far, with live cards for running and waiting requests, tokens in flight and finished, decode and prefill rates, rounds, and peak memory where the engine reports it. Your decode-rate history, recent-requests table and prefill ETA aren't carried yet. The Python engine is frozen (#286), so this PR closes with that. Thanks for building the page you wanted and sharing it. |
Closed
BlivionIaG
pushed a commit
to BlivionIaG/TensorFold
that referenced
this pull request
Oct 20, 2026
…shhart#400) With --dashboard (off by default) the native server serves a small self-contained page at /dashboard and the JSON snapshot it polls at /stats: running and waiting requests, decode and prefill rates, tokens in flight and finished, decode rounds, the draft totals, and memory where the engine reports it. Without the flag both paths are unknown routes (404). With API keys set, both need a key like the rest of the API, so the page suits keyless, usually local, servers. Successful /stats reads stay out of the access log, so the page's once-a-second polls do not flood it. The Python CLI hands the flag to the native engine only. Tests check the page's fields and the /stats snapshot's keys, with memory left out when unknown. Co-authored-by: heitke <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was 100% vibe-coded by GLM 5.3 Flash 4bit on my Mac M3 Ultra 256gb. I wanted a dashboard like this so I built one. It seems like others might find it useful as well, so I created this PR. Below is all AI generated:
--dashboard: a live stats page for the Mac serverCloses nothing; proposes a feature for the 0.7.0 milestone.
What it is
tensorfold serve --dashboardstarts one sampler thread and serves a self-contained stats page at/dashboard, fed by a JSON snapshot at/stats. No new dependencies, one static HTML file, no build step. The routes 404 unless the flag is set, and the page's own 1 Hz polls stay out of the access log (a poll would otherwise drown the terminal inGET /stats 200lines).Why
The terminal live line shows one instant in time; a dashboard shows the shape of a serving session — what the rate did over a reply, how close memory is to its budget, what a failing request looked like. This runs on the same Mac as the server, needs no monitoring stack, and reads only what the scheduler already computes: the sampler never takes engine state or locks, so a dashboard tab costs a decode of a few hundred bytes, never a stall.
The page
/metricspublishes, from finished requests.Dark and light follow the OS; the layout folds to a single column on a narrow window.
Design constraints kept
--dashboard, andTENSORFOLD_NO_LIVEstill silences the terminal line._fillslengths, job stamps) between rounds, the same contractcontext_snapshot()documents./dashboardwith a plain "not wired yet" message rather than an empty page; its metrics route is untouched.Tests
tests/test_stats_dashboard.pycovers the rolling rate's min/max/mean and window eviction, the prefill average ring, the snapshot's tiles against the scheduler's own accounting, both routes' 404-without-the-flag behavior, the access-log quieting, and the request-history rows. Full suite on this branch: 4522 passed, 929 skipped (the same MLX/CUDA-gated skips asmain).Notes for reviewers
scheduler.stats(the same path the live line uses);fill_progressis a read overFilling.left, no locks beyond the store's own.connections.fillingisbool(scheduler.filling)— on the 0.6 schedulerfillingis a list, andis not Nonewould always be true.time.time()for the page's relative labels but keep durations onperf_counter()readings; the two clocks never mix in one subtraction.