dsh-usage-cost: Lightweight API Cost Statistics Plugin for DeepSeek Harness

`dsh-usage-cost` is a lightweight plugin for DeepSeek Harness developed by fflow2023, used to calculate API costs. It follows the "everything is a plugin" philosophy, providing read-only cost estimates by replaying persistent session logs. It does not inject any content into the model, ensuring zero impact on token consumption and KV Cache. The plugin supports displaying the current session cost at the bottom of the session and shows a statistics list of global cumulative totals, peak/off-peak splits, and breakdowns by model (V4 Pro/Flash) and session in the settings page. Billing is based on peak/off-peak prices effective on 2026-08-17, with unpriced models counted in `unpricedTokens`. Its implementation is pure JavaScript with zero build steps and zero runtime dependencies, and the Host side event handling complexity is O(1). Users can access it via GitHu...

Read More
dsh-cost-guard: DSH Cost Plugin for DeepSeek Pure API

dsh-cost-guard is a DSH cost plugin for DeepSeek API usage, licensed under MIT. It focuses on cost control with distinct responsibilities from routing and persona plugins, providing session cost accounting, cache hit rate statistics, and budget hard caps. Core features include: intercepting new requests via `llm/stream` to stop billing after setting a budget (excluding in-flight requests); providing session-level convergence switches to optimize expression; implementing automatic cost routing based on complexity, peak-valley loads, and budget surplus; and supporting peak-valley awareness and off-peak task queues to leverage idle time for automatic task execution. Additionally, the plugin includes a client monitoring dashboard, multi-level budget scope management, and the `dsh-optab` subpackage (for prefix thinning and output compression). The plugin is zero-dependency and does not touch internal state, aiming to help API-only users with unified cost monitoring.

Read More