AKS1st/model-usage-plugin 预览 preview

AKS1st/model-usage-plugin

Plugin插件 Native原生 ⭐ 7 MIT Usage & Cost用量与计费Data & Analysis数据与分析

DSH 的模型 token 使用统计与费用估算,并显示账户余额

Project Overview项目介绍

This is a native plugin built exclusively for the DeepSeek Harness (DSH) web settings panel. It tracks token usage across all model calls, estimates associated costs, displays usage trends, a GitHub-style activity heatmap, and can fetch your current DeepSeek API account balance. To install the plugin, you can run the command dsh plugin --profile web add model-usage-plugin then restart your DSH web instance to activate it. All usage data is stored locally on your machine, and no data is ever reported to external servers. It supports custom pricing rules and peak/off-peak scheduling for third-party models as well.

After installation and restart, you can access the plugin from the Settings > Model Usage menu. The plugin automatically backfills historical usage data from your existing DSH session logs, so you do not need to manually import any old data. There are three tabs: Overview for a high-level summary of costs, Model Details for per-model breakdowns, and Configuration for custom pricing and currency settings. It even sorts models by total cost to help you quickly spot your biggest expenses. This plugin is intended for DSH users who want to track and optimize their LLM API spending over time.

This plugin requires Node.js version ^22.19 or >=24, which matches the Node.js requirement for DSH itself. It is released under the permissive open-source MIT license. Uninstalling via the DSH plugin command does not remove your saved usage statistics. The cost calculations provided by the plugin are estimates only, as they do not account for official discounts, promotional credits, tiered pricing, or taxes. You should always refer to your official API provider bill for accurate final costs. To uninstall completely, run the remove command and manually delete the stats file.

这是一个专为 DeepSeek Harness(DSH)Web 设置面板开发的原生插件,核心功能是统计各模型的 Token 消耗并估算调用费用,同时展示用量趋势、年度开发活跃度热力图与 DeepSeek API 账户余额。所有统计数据均存储在用户本地,不会向外网上报任何个人会话信息,仅在汇率换算和主动查询余额时发起必要的联网请求。

安装完成重启 DSH Web 后,可在设置的「模型消耗」入口查看统计,插件会自动从历史会话日志回填缺失的用量数据,无需用户手动导入整理。插件分总览、模型明细、配置三个页签,分别展示整体花费概览、单个模型的详细消耗统计和自定义计费配置项,适合需要管控大语言模型 API 调用成本的 DSH 用户与开发者使用。

本插件要求 Node.js 版本为 ^22.19 或 >=24,和 DSH 本身的版本要求一致,采用 MIT 开源许可。插件给出的费用是估算值,不包含官方折扣、赠送额度、阶梯价与税费,实际费用请以官方账单为准。可通过 DSH 插件命令直接安装,卸载后统计文件会保留,如需完全清理需手动删除。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 7 stars - very few users, little community feedback星标只有 7,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add model-usage-plugin

把 AKS1st/model-usage-plugin 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

模型消耗统计(model-usage-plugin)

DeepSeek Harness(DSH)Web 设置面板插件:统计各模型的 token 消耗与估算费用,展示用量趋势、开发活跃度与 API 账户余额。

npm 安装 · MIT License · Node ^22.19 || >=24(与 DSH 一致)

模型消耗总览页

它回答什么

  • 花了多少钱 —— 按模型估算费用,并换算到你关心的货币
  • 钱花在哪个模型上 —— 费用占比(不是 token 占比:调用少但单价高的模型才是优化点)
  • 什么时候贵 —— 按天 / 按小时的堆叠柱,可在费用、Tokens、工具调用三种口径间切换
  • 最近是不是一直在干活 —— GitHub 风格的一年活跃度热力图
  • 花得值不值 —— 工具调用数、失败率、每调用均价、每调用 Token、高频工具
  • 账户还剩多少 —— 直接查询 DeepSeek 账户余额

数据全部来自你自己的会话记录,不联网上报。

安装

需要 DSH 的 Web profile(dsh web 能正常启动)。

npm(推荐)

dsh plugin --profile web add model-usage-plugin
dsh web          # 重启使插件生效

dsh plugin 会把包装进 profile 并自动登记为 bundle 层;本包含 dsh.bundle.patch 声明,无需手改配置。

从 GitHub

dsh plugin --profile web add github:AKS1st/model-usage-plugin
dsh web

从源码(本地开发)

git clone https://github.com/AKS1st/model-usage-plugin.git
dsh plugin --profile web add /path/to/model-usage-plugin
dsh web

卸载

dsh plugin --profile web remove model-usage-plugin
dsh web

统计文件 $DSH_HOME/musage-stats.json 会保留,需要一并清理时手动删除即可。

使用

打开 设置 → 模型消耗,共三个页签:

页签 内容
总览 花费 / 总 Token / 账户余额 → 用量趋势 → 活跃度热力图 → 效率指标 → 花费去向
模型明细 全部模型(按费用降序),可展开查看 token 构成、修改单价、启用峰谷定价
配置 目标货币与汇率、余额查询、手动添加模型

装好后不需要任何配置:用量从插件运行起自动累积,历史用量也会自动补齐(插件的台账原先不存在的那部分,会从会话日志里回填,热力图卡上会显示"已回填 N 天历史")。

另外两个页面的截图

模型明细(按"提供服务的模型"分组,同一模型的历史 id 合并成一张卡):

模型明细

配置页:

配置

深色主题下同一套设计令牌,配色自动跟随:

深色总览

费用怎么算

费用 = Σ(各类 token × 对应单价),按你设置的目标货币与汇率换算。缓存命中、缓存未命中、 缓存写入、输出分开计价——它们的单价差一两个数量级,合在一起算会差出好几倍。

这是估算,不是账单。 它不含官方折扣、赠送额度、阶梯价与税费;请以官方账单为准。

内置默认价

首次使用自动套用,可在"模型明细"里逐个修改,或点"重置"回到内置默认。

DeepSeek 模型 缓存命中 缓存未命中 输出
deepseek-flash(V4.1-Flash)空闲 ¥0.02 ¥1 ¥4
deepseek-flash(V4.1-Flash)高峰 ¥0.04 ¥2 ¥8
deepseek-v4-pro(V4-Pro-0813)空闲 ¥0.15 ¥4.5 ¥13.5
deepseek-v4-pro(V4-Pro-0813)高峰 ¥0.30 ¥9.0 ¥27.0

单位:人民币 / 百万 tokens。高峰 = 空闲两倍,窗口为 UTC 周一至周五 01:00–04:00 与 06:00–10:00,其余时间按空闲价。

价目按官方页刷新(2026-09-14):DeepSeek 模型 & 价格、 Z.AI Pricing、OpenAI Pricing。 本次修正了三处会把钱算错的问题:GPT-5.6 三档(luna/terra/sol)此前只记了官方价的一半、 GPT-6 Astra 与 GLM-5.2/5.3 漏了"缓存命中"价(读缓存被当成未命中 → 高估);另外官方已明确 DeepSeek V4 Pro 继续提供且计费不变,因此删掉了此前"9/14 之后改按 Flash 价计费"的规则 (留着会把 V4-Pro 的用量低估约 5 倍)。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-sticky-notes 下一个 Next ser2mcp →