Introduction

After configuring multiple model providers in DSH, usage, quotas, and reset times are often scattered across different provider consoles. During development or debugging, switching to external pages to check balances and limits interrupts the current workflow.

dsh-provider-usage is a DSH Web plugin: it displays the real-time usage/quota of all configured model providers as a small bubble in the bottom right corner of the page. The bubble supports hovering to expand provider details, follows the application theme, displays the device’s local time, and allows querying usage via the provider_usage tool within the conversation.

What is this

dsh-provider-usage is maintained by Lwc-LiuWenCheng with an MIT license.

It addresses the problem of directly viewing the usage/quota of configured model providers within the DSH Web page, reducing the steps of jumping to external consoles. The plugin’s current package.json declares version 0.2.2 and requires node >=20.

Core Features

Bottom Right Bubble

  • Displays a concise usage summary as a small bubble in the bottom right corner of the page.
  • Supports hovering to expand provider details.
  • Follows the application theme, uses design tokens for coloring, and automatically adapts to light/dark themes.
  • Displays the device’s local time; reset times are shown only as month and day.

Provider Discovery

The plugin automatically discovers providers, supporting OpenCodeGo, OpenRouter, OpenAI, DeepSeek, and automatically detecting unknown providers.

Update Strategy

The plugin supports configurable update strategies:

on-request
steps
interval
reset
hover

Among them, on-request and the “every N steps” strategy do not directly poll the provider API, but are based on message event counts in session/event.

Settings & Tools

  • Provides a settings page where strategies and parameters can be selected, with changes taking effect immediately.
  • Registers a provider-usage namespace dictionary via the locale service, supporting zh / en.
  • Registers the provider_usage model tool, allowing direct query of usage within the conversation.

Installation and Activation

If using a published version, you can run:

dsh plugin --profile web add dsh-provider-usage@latest

If installing from local source code, you can use the installation script provided by the repository.

Windows PowerShell:

powershell -ExecutionPolicy Bypass -File scripts\install.ps1

macOS / Linux:

./scripts/install.sh

After installation, DSH needs to be restarted for the new bundle layer to take effect. If a dynamic development copy is still running in the same session, two bubbles may appear before the restart; the dynamic copy disappears after restart.

Configuration

Parameters can be overridden in the cordis.patch.yml configuration line of the profile, or modified in the application’s internal settings page:

- id: provider-usage
  name: 'dsh-provider-usage'
  config:
    updatePolicy: on-request   # on-request | steps | interval | reset | hover
    updateIntervalSeconds: 60
    updateEverySteps: 1

Where:

  • updatePolicy: Select the update strategy.
  • updateIntervalSeconds: Used for interval-based parameters.
  • updateEverySteps: Used for step-counting strategies.

Typical Usage

  1. Install the plugin.
dsh plugin --profile web add dsh-provider-usage@latest
  1. Restart DSH.

  2. Check the usage bubble in the bottom right corner of the page; move the mouse over the bubble to view provider details.

  3. In the application’s settings page, select parameters like updatePolicy, updateIntervalSeconds, updateEverySteps, etc.

  4. Use the provider_usage tool in the conversation to query usage.

Applicable Scenarios and Notes

Suitable for developers or operations personnel who maintain multiple model providers in DSH and need to quickly check usage/quotas within the interface.

Pre-use precautions:

  • The plugin runs with the current DSH process permissions; source code and license should be checked before installation.
  • Provider keys are parsed via the credentials service.
  • The node -e helper runs under the sandbox policy of the calling session.
  • The pwsh-local executor uses single quotes only when passing the command string to pwsh -Command.
  • Dependency constraints declared in package.json are as follows:
node >=20

peerDependencies:
@deepseek-ai/cordis ^4.0.1
@deepseek-ai/dsh-llm ^0.1.0-rc.6
@deepseek-ai/dsh-settings ^0.1.0-rc.6
@deepseek-ai/dsh-tools ^0.1.0-rc.6
react ^18.2.0

Conclusion

dsh-provider-usage aggregates provider usage into the DSH page, reduces the steps of jumping to consoles, and facilitates querying usage directly in the conversation.

Repository address:

https://github.com/Lwc-LiuWenCheng/dsh-provider-usage