Skip to main content

How to use dsh-token-usage

Persistent per-session Token usage records and a settings dashboard with provider/model breakdowns and a 52-week activity heatmap.

This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.

This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.

Quick start

Persistent per-session Token usage records and a settings dashboard with provider/model breakdowns and a 52-week activity heatmap.

— source: plugins.ai_summary

Install & verify

dsh plugin --profile web add dsh-token-usage

Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.

— source: plugins.install

Key points

  • 被动账本,不拦截请求:Host 侧观察普通模型请求、重试和压缩事件,构建可恢复的会话统计 projection;预算、异常和建议只展示证据,不会阻止模型调用或改写路由。
  • 按需 AI,不是后台画像:聚合用量分析和单会话轨迹报告都必须由用户显式启动;前者只发送有界聚合 DTO,后者只发送白名单事件元数据。提示词、回复、标题、路径、工具参数和原始 provider/model 不会进入模型证据。
  • 估算不等于账单或合规结论:USD 数字只按本地静态公开费率计算,报告中的审批统计也只陈述观测到的事件与证据缺口;两者都不替代 provider 账单、策略执行或认证审计。
  • 需要挂载完整 Client 服务的 DSH Web profile,并依赖 DSH 0.1.0-rc.6 系列的 session、LLM、settings、projection 和 Web UI 服务;CLI 或非 Web profile 不提供仪表盘。
  • 数据分为三层:Host 的会话 projection 聚合统计、DSH settings 中的滚动 30 日预算(token-usage.rolling30DayBudget),以及当前浏览器 localStorage 中最多 24 条的轨迹报告(dsh-token-usage.trajectory-history.v1)。聚合 AI 用量报告不会持久化。

— source: plugin_wiki.readme_en (fallback readme_raw)

Pitfalls

Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.

— source: general rule