Creakono/dsh-cost-meter ↗★ 1

dsh-cost-meter

Per-step token cost ledger with optional peak/off-peak pricing for the DeepSeek Harness Web GUI (cache hit / miss / output, per 1M tokens, ¥ or $) 适合需要精确统计每轮对话Token花费并支持自定义价格表的用户。

패키지
dsh-cost-meter
호환성
미검증
버전
0.2.0
최근 업데이트
2026. 8. 15.

같은 패키지 이름의 다른 저장소

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Creakono/dsh-cost-meter

使用

安装并重启服务端后:

  1. 打开 设置 → 预估花费价格表,修改币种、默认价格或按模型价格;
  2. 勾选某模型的「峰谷定价」并添加时段、设置峰时价格;
  3. 点击 保存;之后的新轮次按新价格表逐轮记账;
  4. 点击 恢复默认 可清空用户价格配置,回到上表的出厂价格。

无可用用量、无已计费条目、或价格表尚未加载时,花费行自动隐藏,不占用布局。

配置结构

$DSH_HOME/settings.yaml 中的用户价格配置结构:

dsh-cost-meter:
  currency: CNY          # CNY 或 USD
  default:               # 未匹配模型的兜底价格
    cacheHitPrice: 0.025
    cacheMissPrice: 3
    outputPrice: 6
    peakWindows: []
  models:                # 按模型覆盖
    deepseek-v4-flash:
      cacheHitPrice: 0.02
      cacheMissPrice: 1
      outputPrice: 2
      peakWindows:       # 可多个;start > end 表示跨午夜
        - id: peak-9
          start: 09:00
          end: 12:00
          cacheHitPrice: 0.1
          cacheMissPrice: 3
          outputPrice: 9

schema 默认值只在用户未写入 models 时生效,因此把 models 清空后保存即可真正移除全部模型条目。