dsh-cost-ledger

可核对的 token 成本账:包住 llm/stream waterfall,逐次记录 provider、model、输入/输出/缓存命中/缓存写入 token、用量来源,以及按显式价目表算出的整数 nano-CNY 费用;按小时/日/会话聚合,支持 JSON/CSV 导出与不落盘的 dry-run 预览;手填官方平台账单与本地估算并列,给出 actual − estimated 差异。未知 provider/model 保持显式未定价。零运行时依赖;不查余额、不发通知、不做动画。

插件介绍

可核对的 token 成本账:包住 llm/stream waterfall,逐次记录 provider、model、输入/输出/缓存命中/缓存写入 token、用量来源,以及按显式价目表算出的整数 nano-CNY 费用;按小时/日/会话聚合,支持 JSON/CSV 导出与不落盘的 dry-run 预览;手填官方平台账单与本地估算并列,给出 actual − estimated 差异。未知 provider/model 保持显式未定价。零运行时依赖;不查余额、不发通知、不做动画。

安装方式

从 GitHub 安装

dsh plugin --profile web add github:dingchenhui0618-arch/dsh-cost-ledger

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

版本兼容情况

兼容性待确认。可前往项目文档查看支持版本。