dsh-token-burner: A Controllable Token Consumption and Stress Testing Plugin

Preface

When developing or tuning an agent, you often need to verify an endpoint’s throughput, check token consumption at different tiers, or simply test whether billing is accurate. These scenarios call for “controllable, stoppable, rate-observable” token consumption—not a long-running background script that hammers the API.

DSH (DeepSeek Harness) embraces a “everything is a plugin” philosophy. The community already has a few plugins that can do similar things, but they tend to be either CLI tools or require an extra service process. dsh-token-burner, as a DSH-native plugin, slots this capability directly into DSH’s host and settings page. With minimal code, it delivers the core function: burn tokens at a chosen tier within the DSH process, with the toggle and rate visible in the settings page, and stopping means an immediate halt.

What It Is

dsh-token-burner is a DSH plugin that deliberately consumes tokens, authored by maintainer LiuLi-Kuang and categorized under “Model Inference.”

Its core behavior consists of two parts:
- The host side (entry.js) spins up N concurrent streams via ctx.llm.stream(), discards all returned content, and only records the token counts from usage fragments;
- The client side (client.js) hooks a section into DSH’s “Settings” page, displaying the rate and providing Start/Stop buttons.

Unlike common “auto-start on boot” scripts, dsh-token-burner does not burn tokens automatically by default. Installing it, restarting, or reorganizing profiles will not trigger it. You must go to the settings page and click “Start” to begin. Once stopped, it immediately calls abort()—there is no queue, so stopped means truly stopped.

Core Features

Loading Does Not Mean Burning

After installation, the plugin merely enters DSH’s composition tree and does not consume any tokens. Only by navigating to the “Token Burner” section in settings and clicking “Start” will it actually begin. If it is deactivated mid-run (by clicking “Stop” or by deactivating the plugin), all in-flight streams will terminate within a few hundred milliseconds, leaving no stray background requests.

Tiers and Concurrency

The plugin provides four preset tiers, switchable via a set of buttons in the settings page. Switching immediately rebuilds all streams and resets the counter to zero:

  • high: 8 lanes × 32 KB
  • max: 16 lanes × 64 KB (default)
  • ultra: 64 lanes × 128 KB
  • extreme: 128 lanes × 256 KB

Beyond these four presets, you can define a custom tier via workers and fillerKb (effective when preset is omitted).

Model Follows the Host

Neither the provider nor the model is hardcoded. Leaving them empty by default means following the profile’s default model (agent-default-model). The settings page lists the providers and models currently available to the host, fetched dynamically via ctx.llm.listProviders() and ctx.llm.listModels(provider). When switching models, ctx.llm.resolveModelInfo(provider, model) is called first to validate the model’s existence; invalid values are rejected outright. If a previously saved routing becomes invalid (e.g., after changing machines or a provider being removed), burning will automatically fall back to the profile’s default model.

Language and Configuration

The UI supports three language modes: auto, zh, and en. The default is auto, which follows the system locale (Chinese-family locales display Chinese; all others display English). These choices are persisted to ~/.dsh/token-burner.json. Deleting that file reverts to the defaults defined in cordis.patch.yml.

Data and Details

The “Data” block on the settings page displays four metrics:
- Total tokens
- Rate
- Input / Output
- Rounds / Duration

The “Details” block shows concurrency count, output cap, input filler, auto-start, and error/stop reasons.

Installation and Activation

The plugin must be installed into the profile as a link: dependency. File changes take effect immediately—no reinstall needed.

First, clone the repository:

git clone https://github.com/LiuLi-Kuang/dsh-token-burner.git
cd ~/.dsh/profiles/desktop
pnpm add "link:C:/path/to/dsh-token-burner"

Then add dsh-token-burner to the dsh.profile.bundles array in that profile’s package.json:

"bundles": ["@deepseek-ai/dsh-base", "...", "dsh-token-burner"]

The plugin package ships with a dsh.bundle.patch (cordis.patch.yml) that inserts the config line into the composition tree, so you do not need to manually modify the profile’s patch. The desktop Host performs hot reorganization: after editing the profile, you will see “ignite” / “shutdown” in the logs within tens of milliseconds, and any already-open pages will automatically attach the settings section.

After installation, locate the “Token Burner” settings section in DSH and click “Start” to begin consuming tokens.

Typical Usage

Tier-Based Load Testing

In the settings page, select a “Tier” (e.g., max — 16 lanes × 64 KB), then click “Start.” Within a few seconds, the “Data” block will begin showing rate, total tokens, and other metrics. To switch tiers, click the new tier button; the current run will stop immediately and restart with the new parameters.

Switching Models

Click the “Provider” button in the settings page, select a provider, then choose a model from the dropdown. If the model does not exist or has been invalidated, burning will automatically fall back to the profile’s default model.

Switching Language

Click the “Language” block and select 中文, English, or Follow system. Switching only affects the wording on this page and is written to ~/.dsh/token-burner.json.

Stopping

Click the “Stop” button, or directly deactivate the plugin from DSH’s plugin list. Either way, the current run terminates immediately with no lingering incomplete requests.

Applicable Scenarios and Cautions

Applicable Scenarios

  • Check how a given provider performs under high concurrency; observe error rates and latency;
  • Verify whether token consumption at different tiers matches expectations;
  • Test billing logic accuracy (the plugin only records usage; it does not generate fake invoices);
  • Learn the two common DSH plugin patterns: the host uses ctx.llm.stream() + AbortSignal, and the client uses settings.section.

Cautions

  • This is a real bill. There is no dry-run, no fake model, and no quota cap. The default tier measures approximately 6.5 M tokens/minute in practice—nearly 400 million per hour. Do not use this on accounts you do not own, shared gateways, or production environments.
  • Sustained high-rate consumption is very likely to trigger a provider’s rate limiting or risk controls, and may violate terms of service. You are solely responsible for the consequences.
  • The purpose of this repository is “a working example,” not “a token-burning tool.”
  • 16 lanes is the empirically tested upper limit (92 seconds, 9.97 M tokens, zero failures). ultra (64 lanes) and extreme (128 lanes) have not been verified with real tokens; they were only confirmed to start and stop correctly under a mock model.
  • If a provider does not return usage fragments, the token count on the settings page will remain at 0 (but the bill still accrues).
  • Failures use exponential backoff based on “how many consecutive failures on this lane.” Full auto-stop only triggers when no lane has succeeded at all and the cumulative failure count reaches twice the concurrency (minimum 12). Quota/credential errors trigger an immediate full stop.

Short Closing

dsh-token-burner turns “controllable token consumption” into a DSH-native plugin: install it into your profile, and the toggle and rate are visible in the settings page; stopping means an immediate halt. If you need to verify endpoint throughput, check billing logic, or look for a complete DSH plugin example, this plugin is a suitable choice.

Directory: https://www.skillhub.cn/plugins/LiuLi-Kuang/dsh-token-burner
GitHub: https://github.com/LiuLi-Kuang/dsh-token-burner

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye