Skip to content

feat: add Models dashboard tab with rich per-model analytics#17745

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-35078751
Apr 30, 2026
Merged

feat: add Models dashboard tab with rich per-model analytics#17745
teknium1 merged 2 commits into
mainfrom
hermes/hermes-35078751

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #17733 from @yatesjalex onto current main, plus two follow-up fixes.

What this ships

A new "Models" tab in the web dashboard with per-model analytics cards:
token distribution bar (cache / reasoning / input / output), capability
badges (tools / vision / reasoning + family), context window + max
output from models.dev, cost, sessions, API calls, tool calls,
time-since-last-use. Backed by a new /api/analytics/models endpoint.

Follow-up fixes on top of @yatesjalex's commit

  • Hide empty-string-model ghost cards. The endpoint's SQL used
    WHERE model IS NOT NULL but pre-existing sessions with
    model = '' (data integrity quirk, ~100+ rows in practice) passed
    that check and rendered as blank-header cards on the page. Added
    AND model != '' on both the per-model and totals queries.
  • Drop the fragile slashIdx < 20 heuristic in shortModelName /
    modelProvider and split on the first / unconditionally. The
    length gate was guessing; a real slash always separates vendor from
    model regardless of prefix length. Renamed modelProvider
    modelVendor to disambiguate from the billing-provider column that
    already exists on ModelCard.
  • Added yatesjalex to scripts/release.py AUTHOR_MAP.

Validation

  • Built web/ cleanly (tsc + vite).
  • Ran dashboard against real ~/.hermes/hermes_state.db.
  • Before: /models showed 23 models / 3374 sessions / 1 blank-header
    card at rank Nous Portal subscription integration #25 (112 ghost sessions with empty model string).
  • After: 22 models / 3267 sessions / 0 blank cards. curl … | jq
    confirms zero empty-string rows in both models[] and totals.
  • Filter switching (7d / 30d / 90d) re-fetches and updates totals
    header correctly.

Closes #17733.
Credit to @yatesjalex — his commit is preserved via rebase-merge.

yatesjalex and others added 2 commits April 29, 2026 21:02
- New /models page in left nav (after Analytics)
- New /api/analytics/models endpoint with per-model token/cost/session
  breakdown, cache read/reasoning tokens, tool calls, avg tokens/session,
  and capabilities from models.dev (vision/tools/reasoning/context window)
- Model cards with stacked token distribution bar, capability badges,
  provider badges, cost info, and relative time
- Summary stats bar (models used, total tokens, est. cost, sessions)
- Period selector (7d/30d/90d) with refresh
- i18n support (en + zh)
…or split

- SQL: add `model != ''` to both queries in /api/analytics/models so
  sessions with empty-string model (pre-existing data integrity,
  confirmed in production DB: ~107 sessions) no longer render as
  blank-header cards.
- ModelsPage: drop the arbitrary slashIdx < 20 length gate in
  shortModelName / modelProvider. The gate was fragile for longer
  vendor prefixes (e.g. `deepseek-ai/...`). Strip on the first /
  unconditionally. Rename modelProvider -> modelVendor to avoid
  confusion with the billing provider column.
- scripts/release.py: add AUTHOR_MAP entry for yatesjalex.
@teknium1 teknium1 merged commit 113239f into main Apr 30, 2026
11 of 12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-35078751 branch April 30, 2026 04:07
@alt-glitch alt-glitch added comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request labels Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants