yoggu/dsh-token-cost ↗★ 0

dsh-token-cost

在输入框中显示当前会话的预估 Token 成本 适合需要根据本地价格表实时监控会话开销估算的用户。

套件
dsh-token-cost
相容性
待驗證
版本
0.2.0
授權
MIT
最近更新
2026年9月28日

同名套件的其他儲存庫

安裝

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

dsh-token-cost

Shows an estimated token cost for the current DSH Web session in the composer. Prices come from the installed pi-ai model catalogs; this is not a bill. Subscription routes show (sub), and usage without a matching catalog entry remains unpriced rather than being treated as free.

Install

Install the tagged GitHub release into your DSH Web profile:

dsh plugin --profile web add 'https://github.com/yoggu/dsh-token-cost.git#v0.2.0'

Or download the source and link the local checkout:

git clone --branch v0.2.0 --depth 1 https://github.com/yoggu/dsh-token-cost.git
cd dsh-token-cost
dsh plugin --profile web add "link:$(pwd)"

Keep a linked checkout in place while the plugin is installed. Use the profile you actually run if it is not web.

Restart DSH Web if necessary and reload the page. No external price API or separate credentials are needed: the host publishes the estimate as a Session projection and the readout renders it, so the plugin requests nothing and polls nothing. An idle session produces no traffic at all. If catalog discovery fails, DSH_PI_AI_DATA can point to the local pi-ai catalog directory.

To uninstall: dsh plugin --profile web remove dsh-token-cost.

Limitations

List prices and actual charges can differ, especially for subscriptions. Routes with custom provider names need a matching catalog-provider mapping in the plugin or remain unpriced.

License

MIT; see LICENSE.