wangziyi863/tokbal-pkg-of-ds-harness

wangziyi863★ 0JavaScript最后同步: 2026-08-16

在 GitHub 打开

README 摘要

dsh-token-balance A tiny token-usage & account-balance monitor for DeepSeek Harness (DSH), rendered right inside the web UI. tokbal shows you live LLM token consumption and your DeepSeek account balance without leaving the conversation: - A sidebar badge — compact ⚡ 1.2k · ¥23.45 ; click it to force a balance refresh. - A stats row above the input box — per-session ↑input ↓output 💾cache 🧠reasoning tokens, cumulative totals, and the current balance, refreshed every 3 seconds. - Works across all sessions : counting is process-wide, with a per-session breakdown kept separately. How it works Two halves, both tiny: Half File What it does Host lib/index.js Subscribes to llm/stream events and accumulates usage chunks (input / output / cache-read / reasoning tokens) per session and globally; queries the official DeepSeek balance endpoint from the host process; exposes two same-origin JSON routes. Client lib/client.js A handwritten browser bundle served as-is by client-modules ; polls /tokbal/state and renders the badge + stats row into sidebar/composer slots. The API key never leaves the host process, and the only outbound call is to your configured DeepSeek API base URL. Requirements - …

在 GitHub 查看完整 README →
工具/开发dsh-pluginweb uisidebar

分类