Zenjibad/llmtrim-stats-plugin
llmtrim-stats-plugin
Live llmtrim savings dashboard inside the DeepSeek Harness (DSH) Web UI: a settings dashboard plus a rotating carousel stats strip under the composer.
Install
npx @deepseek-ai/dsh plugin --profile web add ./llmtrim-stats-pluginRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/llmtrim-stats-plugin)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from Zenjibad/llmtrim-stats-plugin, cleaned of badges and images.
llmtrim-stats-plugin · Live llmtrim Savings Dashboard for DeepSeek Harness (DSH)
Show real-time llmtrim savings inside the DeepSeek Harness (DSH) Web UI: a full dashboard in Settings plus a rotating carousel stats strip under the composer. 在 DSH 内实时展示 llmtrim 压节省统计:设置页完整仪表盘 + 输入区轮播统计条。
中文文档: README.zh.md · LLM index: llms.txt · Agent guide: AGENTS.md
Keywords: dsh-plugin · deepseek-harness-plugin · llmtrim · compression · tokens · savings · stats · dashboard · carousel
📑 Table of Contents
- ✨ Features
- 🏗️ How it works
- 🚀 Quick start
- ⚙️ Configuration
- ❓ FAQ
- ⚠️ Security notes
- 📦 Project structure
- 🙏 Credits
✨ Features
| Feature | Description |
|---|---|
| 📊 Settings dashboard | Settings → llmtrim Stats: KPI cards (You paid / Would have cost / Saved today / Saved this week + tokens trimmed, requests, net saved re-priced), daemon health badge + version, per-model table (model / requests / saved % / USD) |
| 🎠 Configurable carousel | Composer strip under the chat input: choose Rotating (cycle one stat at a time) or Static (show every selected stat at once, fixed) — pick exactly which stats appear; refreshed every 5s |
| 💵 Four money cards | You paid (money.paid_usd), Would have cost (money.would_have_usd), Saved today (money.saved_today_usd), Saved this week (prorated: current-week (Monday-start) token share × lifetime money.saved_usd — llmtrim reports no weekly USD) |
| 🔗 Lives off the real CLI | The host runs llmtrim status --json (the same command as llmtrim status) via the subprocess service — no ledger-file parsing, always consistent with the CLI |
| 🩺 Daemon health at a glance | The dashboard shows a green/amber badge (daemon healthy / stopped) plus the binary version |
| 🌗 Theme-aware | All colors use --dsw-alias-* design tokens; follows light/dark automatically |
| ♨️ Survives restarts | Real profile-bundled plugin: install once with dsh plugin add, auto-loads on every DSH boot — no per-session define, no cordis_define |
🏗️ How it works
llmtrim interceptor (daemon :43117) ──writes──> ~/.local/share/llmtrim/tracking.db
│
Host half (DSH process) ▼
└─ subprocess service: resolveExecutable('llmtrim') → spawn llmtrim status --json
└─ reshape → { daemon, totals, money, cost, byModel }
└─ settings namespace `llmtrim-stats` { mode, staticStats } (carousel config)
└─ webServer routes: GET /llmtrim-stats/api (snapshot incl. config)
PUT /llmtrim-stats/config (persist carousel choice)
│
Client bundle (browser) ▼
└─ single 5s poller → fetch(/llmtrim-stats/api) → snapshot fan-out to two seats
├─ settings.section (id llmtrim-stats) → full dashboard + carousel config
└─ conversation.composer.dock (id llmtrim-carousel) → rotating or static strip
…

