跳到正文

yflmq001/dsh-cost-tracker

30最近提交 2026年8月14日

dsh-cost-tracker DSH 插件

dsh-cost-tracker 根据你配置的每模型价格表对每次 LLM 调用进行计费,并向 Web UI 发布每次会话的成本投影,同时标记处于峰时窗口的调用。

如何安装 dsh-cost-tracker DSH 插件

dsh plugin --profile web add github:yflmq001/dsh-cost-tracker

复制不会执行命令。安装 dsh-cost-tracker DSH 插件前请核对仓库和版本。

dsh-cost-tracker DSH 插件数据来源

dsh-cost-tracker DSH 插件快照日期:2026年8月16日

discovered

dsh-cost-tracker DSH 插件能做什么

  • 按模型配置缓存未命中/命中输入、输出以及可选的峰时费率
  • 向 Web UI 提供每次会话的成本投影(总成本、峰时成本、谷时成本、按模型细分)
  • 标记处于配置的峰时窗口内的调用,并显示峰/谷时明细
  • 将未定价的模型显示为'未配置'并带占位符,避免静默低估成本
  • 缓存写入按未命中费率计费(而非命中费率),确保计费准确

dsh-cost-tracker DSH 插件适合哪些场景

  • 在 DeepSeek Harness Web UI 中可视化每次会话的 Token 成本
  • 为不同时段配置峰/谷时价格,与提供商计费方式匹配
  • 识别缺少定价配置的模型,手动添加价格
  • 通过 `/cost` 命令跟踪跨会话的全局成本
  • 按正确的缓存未命中费率计费,确保成本核算准确

dsh-cost-tracker DSH 插件适合谁

  • 需要按会话精确追踪成本的 DeepSeek Harness 用户
  • 希望为多种模型和峰谷时段自定义定价的开发者

dsh-cost-tracker DSH 插件的限制

  • 每会话成本是从持久日志重放得到的投影;跨会话账单仅通过 `/cost` 命令可用
  • 非 DeepSeek 模型需要手动填写价格,不支持自动价格查询
  • 开发者预览版:当适配器未报告计费时,`assistant/message.usage` 可能缺失
  • 会话格式无兼容性承诺,未来 Harness 更新可能破坏兼容性

dsh-cost-tracker DSH 插件的仓库 README 摘录

以下文字摘自 dsh-cost-tracker DSH 插件的上游仓库 yflmq001/dsh-cost-tracker 的 README,版权归原作者,仅作引用。

> 🇨🇳 [中文说明](README.zh.md) [![awesome · DSH plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com) Token cost tracking for DeepSeek Harness, with per-model configurable pricing and peak/off-peak rates. ![dsh-cost-tracker: per-session cost bar and the /cost command](assets/screenshot.jpg) ## What it does - Prices every finalized LLM call (`assistant/message` usage) against a per-model pricing table you configure — cache-hit / cache-miss input, output, and optional peak-window rates. - Publishes a per-session `cost` projection (total / peak / off-peak / per-model), consumed by the Web UI to show a live session cost readout. - Flags calls that land in a configured peak window. - Models without a pricing entry are surfaced as "unconfigured" with a placeholder, so you know to add them. ## Installation Install into a dsh profile straight from GitHub — the plugin ships a `dsh.bundle` layer, so `dsh plugin add` enables it automatically: ```sh dsh plugin --profile web add github:yflmq001/dsh-cost-tracker ``` Pricing starts empty (`models: {}`); fill in your models under the plugin's `config` (see below). To override defaults, add a `cost-tracker

阅读完整 README仓库许可: MIT

dsh-cost-tracker DSH 插件常见问题

如何安装 dsh-cost-tracker?

在终端中运行 `dsh plugin --profile web add github:yflmq001/dsh-cost-tracker`。该插件自带 `dsh.bundle` 层,安装后会自动启用。你需要先在插件配置中填写价格,它才会开始追踪成本。

需要为每个模型手动输入价格吗?

是的,你必须在插件 `config.models` 部分为每个你想追踪的模型配置价格。没有自动价格抓取功能。未定价的模型会显示为“未配置”,提醒你添加价格。

插件如何处理峰时和谷时定价?

你可以定义峰时时段(例如北京时间 09:00-12:00、14:00-18:00),并为这些时段设置单独的输入/输出费率。峰时调用按峰时费率计费,谷时调用使用基础费率。你也可以将 `enabled: false` 完全禁用峰时计费。

插件能跨多个会话追踪成本吗?

是的,跨会话账单通过 dsh 的存储域持久化。你可以使用 `/cost` 命令查看全局账单。但如果你的配置文件没有存储后端,账单仅保存在内存中,会话结束后会丢失。

如果 LLM 适配器没有报告使用数据怎么办?

插件依赖适配器的 `assistant/message.usage` 字段。如果该字段缺失,插件可能无法计算该次调用的成本。README 指出这是开发者预览版的限制。