dsh-localhost-cost
DeepSeek cost projection plugin for local-model developers
- Stars
- 3
- Language
- TypeScript
- Created
- Aug 24, 2026
- Updated
- Aug 24, 2026
Introduction
dsh-localhost-cost
English | 中文
dsh-localhost-cost adds an estimated session cost view to DeepSeek Harness for people running local models. It shows what a session would have cost under the official DeepSeek pricing tables, and it includes a Settings page for mapping local model ids to those billing tiers. It ships as a DSH bundle, so you can install it directly into a profile. When a model id already matches an official tier name, no mapping is needed.
Screenshots
Estimated cost view:

Settings mapping view:

Install
dsh plugin --profile web add dsh-localhost-cost
dsh --profile web --dump-config
This is the native DSH install path. If you only want the npm package as a dependency, npm install dsh-localhost-cost also works, but that does not add the bundle to a profile by itself.
If your profile is different, replace web with that profile name.
After the bundle is installed into a profile, use the Settings page to map local model ids if needed.
The Settings page reads the model catalog already configured in Harness, so you can usually choose a provider first and then pick one of its models from a dropdown. The page writes the mapping for you and refreshes the current session after save, so the cost view updates without a manual browser reload.
What it calculates
The plugin folds logged usage samples into a CNY estimate using the official DeepSeek rates for deepseek-v4-flash and deepseek-v4-pro.
totalNanoyuaninputCacheHitNanoyuaninputCacheMissNanoyuanoutputNanoyuan
It only prices sessions that already contain usage samples. If a local deployment does not log those samples, the plugin cannot infer billable tokens from the session log alone.
Configuration
type SessionCostConfig = {
aliases?: Record<string, 'deepseek-v4-flash' | 'deepseek-v4-pro'>
}
aliases maps a local or legacy request model id to one of the official DeepSeek billing tiers. The Settings page writes the same mapping for you through the UI, so most users never need to edit JSON by hand.
Supported billing tiers
The plugin currently supports these official tiers:
deepseek-v4-flashdeepseek-v4-pro
If you want to price a local model against one of those tiers, pick the tier in Settings and save the mapping. The plugin will then recompute the current session from the existing log.
How to use it
- Install
dsh-localhost-cost. - Open the session cost page to see the estimated cost.
- Open Settings to map local model ids to an official billing tier.
- Save once. The UI refreshes the current session automatically.
Model Experience
None, as the plugin only computes a client-facing read model of already-logged session events and touches no prompt, message, schema, stream, or tool result.
KV Cache effect
None; the plugin never assembles or sends provider requests.
Known Limitations and Deferred Work
- It only prices sessions that carry usage samples — when a local deployment does not log
assistant/chunkorassistant/messageusage, the projection cannot infer billable tokens from the session log alone. - Only two official tiers are supported today — the plugin currently knows
deepseek-v4-flashanddeepseek-v4-pro; more billing tiers can be added later. - Unknown model ids still need a mapping — the UI makes this a dropdown workflow, but a local model must still be mapped to one of the supported official tiers before the plugin can price it.
- Peak/off-peak is decided from the request header timestamp — the pricing bucket is based on when the request started, not when the answer finished.