AI Agent Hub
Back to plugins
🤖

dsh-switch-cost

Model Inference Updated 2026.08.25

Run the following command in DeepSeek Harness:

dsh plugin install xyzs996/dsh-switch-cost

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install xyzs996/dsh-switch-cost to install the plugin (source: https://github.com/xyzs996/dsh-switch-cost), which registers the switch_cost tool for time-of-use pricing on the actual route and a cheapest-first comparison against every other route in the table.

About this plugin

Every inference run tells you what you paid, but it rarely answers the more pressing question: what would the exact same traffic have cost on a different route? dsh-switch-cost turns that question into a single zero-parameter tool call. It reads the token usage already recorded for the current session, prices it against the route that actually executed, then prices the same buckets against every other route in the bundled price table, returns a cheapest-first ranking, and reports the signed percentage delta for each alternative.

The core differentiator is precise time-of-use handling. Usage is folded into token buckets keyed by route and UTC hour, split across input, cache-read, cache-write, and output. When a provider bills different rates for peak and off-peak windows, each hour is priced at its own tariff rather than at whichever rate happened to be active when the tool was called. The price table has two layers: vendor pages take priority over the models.dev community catalog, because the catalog schema has no field for peak, off-peak, or time-of-use pricing. Routes with no price on file are reported under an unpriced section and excluded from the total, never silently priced as zero.

It is best suited to teams and independent developers who rotate across multiple providers and want a quantified cost comparison before switching. The plugin is entirely read-only: it prices usage that has already been logged, never assembles or sends a provider request, injects nothing into the system prompt, and has zero effect on KV cache or context length.

Use Cases

  • Compare the token cost of the same session across different model routes
  • Estimate savings before switching to a cheaper provider
  • Quantify how peak and off-peak tariffs shift the per-inference bill

Best For

  • Teams that rotate inference across multiple LLM providers
  • Developers who need cross-route cost data for budget approvals
  • Platform engineers building multi-route pipelines with live cost visibility