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

- 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)
This commit is contained in:
Alex Yates 2026-04-29 20:34:22 -07:00 committed by Teknium
parent 289cc47631
commit e6b05eaf63
7 changed files with 579 additions and 0 deletions

View file

@ -74,6 +74,7 @@ export const en: Translations = {
documentation: "Documentation",
keys: "Keys",
logs: "Logs",
models: "Models",
sessions: "Sessions",
skills: "Skills",
},
@ -172,6 +173,18 @@ export const en: Translations = {
inOut: "{input} in / {output} out",
},
models: {
modelsUsed: "Models Used",
estimatedCost: "Est. Cost",
tokens: "tokens",
sessions: "sessions",
avgPerSession: "avg/session",
apiCalls: "API calls",
toolCalls: "tool calls",
noModelsData: "No model usage data for this period",
startSession: "Start a session to see model data here",
},
logs: {
title: "Logs",
autoRefresh: "Auto-refresh",