- Accueil
- Plugins
- Utilisation et facturation
- dsh-context-hud
dsh-context-hud
nixoa/dsh-context-hud
Composer pill showing the wallet balance of the model actually running, plus a card with context occupancy, TTFT, tokens per second, cache hit rate and switchable per-channel quota tabs; other providers are added by editing one JSON file. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Installer
dsh plugin --profile web add github:nixoa/dsh-context-hudREADME
dsh-context-hud
输入框下方的一个小胶囊,显示当前模型正在花谁的钱、还剩多少;点开是上下文窗口、当前模型和额度明细。
它解决什么
平时用多个渠道跑同一个会话(官方 API、订阅套餐、第三方中转),最常问的一句是「我这个月还剩多少」。这个插件把答案放在输入框下面:
- 胶囊上的数字跟着当前模型走——模型属于哪个 provider,就显示那个钱包的余额,不会显示这个会话根本花不到的钱包。
- 点开卡片能看到上下文占用(已用/剩余/窗口大小)、TTFT、TPS、缓存命中、当前模型与推理档位,以及按渠道切换的额度明细。
内置渠道
| 渠道 | 数据来源 | 胶囊显示 |
|---|---|---|
| DeepSeek 官网 | api.deepseek.com/user/balance,优先用账号登录凭据,回落到 DEEPSEEK_API_KEY | 人民币余额 |
| OpenCode | opencode.ai/zen/go/v1/usage,用 OPENCODE_GO_API_KEY | 5h 窗口剩余百分比 |
| WorkBuddy | 读 dsh-connect-workbuddy 自己的回环路由 | 积分余额 |
渠道是按需出现的:没装 WorkBuddy 连接器就不出现那一页;缺 key 的渠道会显示出来并告诉你缺什么,而不是消失。
加自己的渠道
不用改代码。写一个 ~/.dsh/context-hud-channels.json,描述「请求怎么发、数字在哪里」,卡片里就多一个渠道标签:
{
"channels": [
{
"id": "moonshot",
"label": "Moonshot",
"kind": "balance",
"url": "https://api.moonshot.cn/v1/users/me/balance",
"headers": { "authorization": "Bearer ${MOONSHOT_API_KEY}" },
"rows": [{ "label": "余额", "value": "data.available_balance", "prefix": "¥" }]
}
]
}
改完不用重启。取数用点路径(accounts.0.credits 这种数组下标也行),两种行:{"percent": "..."} 画进度条,{"value": "..."} 显示金额或积分。要接管胶囊就写上 "providers": ["moonshot"]。
完整字段、各家参考路径、错误怎么读,见 CHANNELS.md。
安装
dsh plugin --profile web add github:NIXOA/dsh-context-hud
或从界面:插件页 → Add plugin → 选本地目录。
装完 重启 DeepSeek Harness。宿主半(读额度的路由)不会热重载,桌面端的组合没有热重载入口。
细节见 INSTALL.md。
隐私
- 额度全部在宿主进程里读取,凭据由 DSH 的 credentials 服务解析,不进浏览器。
- 唯一的 HTTP 路由
/plugins/dsh-context-hud/quota只接受 GET/HEAD,且只响应本机回环请求,非 loopback 一律 403。 - 插件不写任何文件。自定义渠道文件是你自己的,里面用
${环境变量名}而不是明文 key。
License
MIT
An ambient pill under the composer that shows which wallet the running model is spending and how much is left. Click it for context occupancy (used / free / window), TTFT, tokens per second, cache hit rate, the active model with its reasoning effort, and per-channel quota details behind switchable tabs.
Three channels ship built in (DeepSeek Platform balance, OpenCode subscription usage, WorkBuddy credits), and any other provider can be added by describing its endpoint in ~/.dsh/context-hud-channels.json — no code change, no restart. Credentials stay in the Host process and never reach the browser.
Plugins associés
DeepSeek-Balance-Whale-Widget
meteornox/deepseek-balance-whale-widget
dsh-context
bowenliang123/dsh-context
dsh-cost-meter
han-1413141/dsh-cost-meter
dsh-damage-pulse
wssfk12138/dsh-damage-pulse