Skip to content

feat: LLM panel tok/s & TTFT trend chart with busy-sample averages - #75

Open
unsaltedbutter-ai wants to merge 3 commits into
MiaAI-Lab:mainfrom
unsaltedbutter-ai:tok-history
Open

feat: LLM panel tok/s & TTFT trend chart with busy-sample averages#75
unsaltedbutter-ai wants to merge 3 commits into
MiaAI-Lab:mainfrom
unsaltedbutter-ai:tok-history

Conversation

@unsaltedbutter-ai

Copy link
Copy Markdown
  • Add a ~1h in-memory trend chart for generation/prefill tok/s and TTFT
  • Show per-phase averages over busy (>0) samples only
  • Server: report live mean TTFT (seconds) from vLLM histogram sum/count
longer-averages

@vincenzopalazzo

Copy link
Copy Markdown
Collaborator

Concept ACK — tok/s & TTFT trend chart

Production Readiness: NO-GO

Focused feature PR. Busy-sample averages and vLLM live mean TTFT look sound.

Critical: TTFT history only pushes when ttftSeconds != null, while gen/prefill always append. Idle gaps desync the TTFT polyline vs the others. Push a sentinel every ingest tick (or do not overlay on the same SVG).

— Vincent

@unsaltedbutter-ai

unsaltedbutter-ai commented Sep 6, 2026

Copy link
Copy Markdown
Author

Concept ACK — tok/s & TTFT trend chart

Production Readiness: NO-GO

Good callout. I've reworked the PR in 3 ways (separate commits).

  1. remove the ttft line as it wasn't adding much value over the prefill tok/s number
  2. I made the graph show a static 30 minute duration (env configurable) rather than drawing all samples scaled to fit the horizontal area.
  3. I made the average numbers longer than 1 hour (env configurable) defaulting to 8h
Screenshot 2026-09-06 at 12 47 37 PM

@unsaltedbutter-ai

Copy link
Copy Markdown
Author

i'm working on the conflicts

- Add a ~1h in-memory trend chart for generation/prefill tok/s and TTFT
- Show per-phase averages over busy (>0) samples only
- Server: report live mean TTFT (seconds) from vLLM histogram sum/count
TTFT history only appends while vLLM is serving, so the series is sparse
while tps/prefill are tick-dense. The chart's x-axis normalises by array
index, so after any idle gap the TTFT polyline was stretched across the
full width and mis-placed in time vs the other series.

Take the reviewer's second option: no overlay. The busy-sample TTFT
average badge is kept — it reads the sparse series directly (no x-axis)
and is the non-redundant signal; the line itself tracked the prefill
spikes it sat under.
…tion

The trend chart's x-axis was normalised by the current sample count, so
every new tick re-stretched the whole polyline leftward — the chart
visibly rewrote its own history as it filled. Anchor x to a constant
DISPLAY_WINDOW (900 samples = 30 min at the 2 s poll) instead: the line
grows left-to-right while filling, then scrolls with the newest sample
pinned at the right edge. Only the window is drawn; y-max is computed
over the window so an old spike can't permanently squash recent detail.

Retention is raised and configurable via VITE_HISTORY_HOURS (default 8,
wired through the Dockerfile ARG + compose build arg). The extra hours
feed the busy-sample average badges below the chart (and future
long-horizon views); the chart itself stays at 30 min. Memory cost is
~112 KB per series per hour of Float64 samples — ~10 MB worst case at
8 h for the whole tab. Header label now states both windows:
'chart ~30m · avgs ~8h · 2s samples'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants