DSH Hub

null5069/dsh-better-stats

dsh-better-stats

UIWeb UI2 GitHub stars· updated 2026-08-25

DSH Web composer stats strip: official CNY pricing with auto-synced peak/off-peak tiers, per-model accounting, live LLM/tool timers, agent-team tree merge, DeepSeek balance, budget alerts, streaming cost estimates

Install

npx @deepseek-ai/dsh plugin --profile web add github:null5069/dsh-better-stats

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-better-stats DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/dsh-better-stats.svg)](https://dshhub.dev/plugins/dsh-better-stats)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from null5069/dsh-better-stats, cleaned of badges and images.

<p align="right"><a href="./README.zh-CN.md">简体中文</a></p>

dsh-better-stats

A richer stats strip for the DeepSeek Harness (DSH) Web UI, sitting right below the composer: official CNY pricing (peak/off-peak tiers, auto-synced from the official pricing page), per-model accounting, live timers, subagent-tree merging, direct account balance, budget alerts, and streaming cost estimation.

DeepSeek Official | Balance ¥8.67 | Turn ¥0.1676 · Session ¥29.49 | 20 turns · 345 steps | LLM 1h 12m · Tool 5m 6s | TTFT avg 3.88s · 111.72tok/s | Cache 103.98M · hit 98.64% | In 1.44M · Out 336.53K

Features

  • Balance: host queries api.deepseek.com/user/balance directly (the DEEPSEEK_API_KEY credential goes through the DSH credentials seam, never the browser), 15s cache; click the balance group to force a fresh query (after switching models/API the balance would otherwise only update on the next poll; the host has a 2s anti-flood cooldown). The hover popover shows the granted / topped-up split (degrades to the total when fields are missing), a days-left estimate (EWMA-smoothed from today's spend and the trailing daily history), and a recharge link from the warn tier down.
  • Pricing: official CNY price table (api-docs.deepseek.com/zh-cn/quick_start/pricing), re-synced by the host every 6h by mapping the official model-header columns, with a builtin fallback; the popover shows a "Prices" row with the source and fetch time (e.g. DeepSeek Official 2026-08-18 14:16). Peak/off-peak tiers (peak = Monday–Friday, Beijing 09:00–12:00 / 14:00–18:00, ×2 price; weekends are off-peak) apply per event timestamp; the strip shows the current tier and the popover the next switch with a countdown that skips weekends.
  • Per-model accounting: each message is priced with the model that produced it (deepseek-v4-flash / deepseek-v4-pro / deepseek-v4-flash-vision-exp each use their official table). Unknown models are explicit: their tokens still total up but price at 0, the popover's Model group shows Unpriced, and the spend row notes the unpriced step count instead of silently pricing at a default.
  • Cache buckets: uncached input, cache-read and cache-write are billed separately (cache-read at the much lower hit price), and the cache-hit rate is shown.
  • Turn: the current turn is settled from the settled steps' event-level fold (each step priced at its own event time/model), plus a streaming character-level estimate for the in-flight step (densities self-calibrate via EMA from settled steps; priced at the current tier). The estimate × estAccuracy is ONE corrected value driving the amount, the Tok figures and the rate alike. The number grows continuously within the turn, keeps its final value after the turn ends, and resets only when the next turn starts.
  • Session / live Agent Team tree: every second the host /live route publishes one coherent tree cut keyed by session id and event revision. Exact usage, CNY and model rows from the root, direct children and nested children reach the selected parent panel immediately; active children also contribute their streaming output estimate, turn/step, TTFT and tok/s without waiting for the 10s /cost baseline or requiring a browser binding for the child. A usage chunk replaces the estimate in place. Turn remains the selected session's current turn; Session accounting, usage and output represen

Related plugins