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

@ -73,6 +73,7 @@ export const zh: Translations = {
documentation: "文档",
keys: "密钥",
logs: "日志",
models: "模型",
sessions: "会话",
skills: "技能",
},
@ -170,6 +171,18 @@ export const zh: Translations = {
inOut: "输入 {input} / 输出 {output}",
},
models: {
modelsUsed: "使用模型数",
estimatedCost: "预估费用",
tokens: "Token",
sessions: "会话",
avgPerSession: "平均/会话",
apiCalls: "API 调用",
toolCalls: "工具调用",
noModelsData: "该时间段暂无模型使用数据",
startSession: "开始会话后将在此显示模型数据",
},
logs: {
title: "日志",
autoRefresh: "自动刷新",