feat(insights): add daily token trends and model usage costs#1668
Closed
Michaelyklam wants to merge 1 commit into
Closed
feat(insights): add daily token trends and model usage costs#1668Michaelyklam wants to merge 1 commit into
Michaelyklam wants to merge 1 commit into
Conversation
Collaborator
|
Closed by the v0.51.1 release in PR #1681 (merged at e23ba59). Massive thanks @Michaelyklam — this is now 19 merged PRs across the v0.50.292–v0.51.1 release window, an extraordinary contribution rate. Each PR was per-claim-vs-diff verified against your description and every security-relevant code path checked under independent review (Opus advisor, 6/6 questions clean). Your Live on production: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.1 🚀 |
nesquena-hermes
pushed a commit
to Michaelyklam/hermes-webui
that referenced
this pull request
May 5, 2026
…and model usage costs by @Michaelyklam
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.
Thinking Path
/api/insightsendpoint and vanilla-JS Insights panel, so the useful path is an endpoint/UI extension rather than a new chart dependency.What Changed
api/routes.py::_handle_insights()with safe usage/cost parsing, calendar-window filtering,daily_tokens, and richer per-modelmodelsrows.static/panels.jsandstatic/style.cssto render a stacked daily token chart plus per-model Sessions / Tokens / Cost / Share columns with empty states.tests/test_insights.pycoverage for zero-filled daily series, cost parsing, model token/cost/share sorting, UI hooks, and range switching.docs/pr-media/1456/.Closes #1456
Why It Matters
The old Insights tab could show aggregate tokens and session counts, but it could not answer “when did token usage spike?” or “which model is driving this month’s usage/cost?” This PR exposes those two analytics views without changing the no-build-step frontend architecture.
Verification
Result:
Manual verification:
/api/insights?days=7and renders 7 daily bars plus 3 model rows.UI media:
Risks / Follow-ups
Model Used
AI assisted.
gpt-5.5