Back to home

NeverToEver

dsh-usage-cost-dashboard

LLM usage, cost analytics and Web UI panel plugin for DeepSeek Harness

Stars
1
Language
TypeScript
Created
Aug 15, 2026
Updated
Aug 15, 2026

Introduction

English | 简体中文

dsh-usage-cost-dashboard

A community plugin for DeepSeek Harness that tracks LLM token usage, estimates costs, and adds a lightweight Web UI indicator beside the composer.

License

Overview

DeepSeek Harness already provides low-level telemetry and token-meter primitives, but it does not ship a ready-to-use cost/usage panel for everyday users.

This plugin fills that gap by:

  • collecting token usage from session/event
  • exposing a /usage command with filtering and reporting options
  • rendering a compact, theme-aware usage indicator in the Web UI

Status: early development. The current version uses in-memory storage and estimated pricing.

Demo

Web UI indicator

Web UI indicator

Usage command

Usage command

Architecture

Architecture

Features

  • Collects provider/model, token counts, timing, and per-step usage from real Harness events
  • /usage command with:
    • current session or --all sessions
    • --session, --model, --from, --to, --limit
    • grouping by --by model or --by session
    • --json and --csv output
    • --export <path> to write JSON/CSV files
  • JSONL persistence when configured with storageFile
  • Web UI indicator:
    • outer ring shows context-window usage
    • inner hourglass with two triangles represents input/output tokens
    • hover shows total tokens
    • click to expand a detailed panel
    • follows the Harness light/dark theme
  • Smooth expand/collapse animation with reduced-motion support

Requirements

  • DeepSeek Harness with the dsh CLI
  • Node.js 22+ for local development
  • pnpm only required for the recommended dsh plugin installation path

Installation

Option A: install as a Harness bundle

From a directory that contains this plugin checkout:

dsh plugin --profile web add /path/to/dsh-usage-cost-dashboard

The dsh CLI will add the plugin to the profile's bundle layers.

Option B: manual link

If you prefer not to use pnpm:

cd /path/to/dsh-usage-cost-dashboard
npm install
npm run build

Link the package into your Harness profile:

mkdir -p ~/.dsh/profiles/node_modules/@dsh-community
ln -sfn /path/to/dsh-usage-cost-dashboard ~/.dsh/profiles/node_modules/@dsh-community/dsh-usage-cost-dashboard

Add the plugin to ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: usage-cost-dashboard
      name: '@dsh-community/dsh-usage-cost-dashboard'

Restart dsh web.

Deploy from this repository

1. Clone

git clone https://github.com/NeverToEver/dsh-usage-cost-dashboard.git
cd dsh-usage-cost-dashboard

2. Install and build

npm install
npm run build

3. Deploy to DeepSeek Harness

Recommended: via dsh plugin

If pnpm and dsh are available:

npm run deploy:web

This runs:

npm run build
dsh plugin --profile web add .

Alternative: manual link (no pnpm required)

npm run deploy:link

This builds the plugin, links this checkout into ~/.dsh/profiles/node_modules/@dsh-community/, and adds the required row to ~/.dsh/profiles/web/cordis.patch.yml.

You can also specify another profile:

bash scripts/deploy-link.sh headless

4. Restart

dsh web

After restart, the /usage command and the Web UI ring indicator will be available.

Configuration

Persistence

By default all usage records are kept in memory. To persist them as JSONL, set storageFile in the plugin config:

- id: usage-cost-dashboard
  name: '@dsh-community/dsh-usage-cost-dashboard'
  config:
    storageFile: '~/.dsh/usage-cost.jsonl'

After enabling persistence, records are appended on every new request and loaded again when the plugin starts.

Usage

Slash command

After installation, open the Harness Web UI and type:

/usage

Available options:

/usage
/usage --all
/usage --session <sessionId>
/usage --model deepseek-chat
/usage --from 1700000000000
/usage --to "2026-01-01"
/usage --limit 20
/usage --by model
/usage --by session
/usage --json
/usage --csv
/usage --export ./usage.json
/usage --export ./usage.csv
/usage --help

Web UI indicator

After restarting dsh web, a circular indicator appears on the left side of the composer:

  • The outer ring represents context-window usage and becomes deep blue as it fills.
  • The two triangles inside represent input and output tokens.
  • Hovering over the indicator shows total tokens.
  • Clicking it expands a detailed panel with context, steps/turns, input tokens, output tokens, and total tokens.

Development

npm install
npm run typecheck
npm run build
npm test

Run the minimal demo without a running Harness:

npm run demo

Run the real Harness integration demo:

npm run demo:harness

Project layout

src/
├── index.ts                # Cordis plugin entry
├── types.ts                # shared types
├── client/                 # browser-side Web UI indicator
├── collector/              # session/event -> UsageRecord
├── storage/                # in-memory UsageStore
├── pricing/                # price table and cost estimation
└── command/                # /usage command

Roadmap

  • v0.1 core: collection + /usage command
  • v0.2 persistence (JSONL) and file export
  • Web UI indicator (experimental)
  • v0.3 budgets and alerts
  • v0.4 full Web UI dashboard

Contributing

See CONTRIBUTING.md.

Changelog

See CHANGELOG.md.

License

MIT