hccccc01333/dsh-analytics ↗★ 0
dsh-analytics
面向 DeepSeek Harness 的 Agent FinOps / 令牌分析:用量收集、时间感知成本引擎、缓存分析和会话下钻
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hccccc01333/dsh-analytics说明文档
阅读完整 README ↗dsh-analytics
English | 中文
面向 DeepSeek Harness 的 Agent FinOps / token 分析:从会话事件采集用量写入本地 SQLite 账本,用时间感知的定价表(绝不硬编码进逻辑)计费,并通过服务、agent 工具与 JSON API 路由查询。
这是设计中的 v1 范围:总览 + 会话下钻 + 成本引擎 + 缓存分析,并按 dsh-plugin 生态的 bundle 打包方式发布(带 dsh.bundle 的 npm 包 → cordis.patch.yml)。
安装
dsh plugin --profile web add dsh-analytics
从 git 安装(需要 prepare 构建授权):
dsh plugin --profile web add github:you/dsh-analytics#
从本地检出安装:
dsh plugin --profile web add /path/to/dsh-analytics
本地开发时挂载源码 overlay:
dsh --profile web --patch ./cordis.yml
配置
插件行的 config(形状见 cordis.yml):
| Key | 类型 | 默认值 | 说明 |
|---|---|---|---|
dbPath | string | —(必填) | SQLite 数据库文件;缺失的目录会自动创建。 |
currency | string | — | 摘要中优先排序的首选币种(每行自带币种)。 |
peakHours | [startHour, endHour][] | [[1,4],[6,10]] | UTC 半开区间高峰窗口;其余小时为低谷。 |
pricing | PricingRow[] | 随附 DeepSeek V4 表 | 替换随附默认值的定价行。 |
pricingFile | string(绝对路径) | — | PricingRow[] 的 JSON 文件;与 pricing 互斥。 |
budget.daily | number | — | 以 budget.currency 计的每日支出上限(UTC 日)。 |
budget.monthly | number | — | 每月上限;总览还会预测月末支出。 |
budget.currency | string | currency 或 USD | 限额计量币种。 |