Introduction¶
DeepSeek Harness (dsh) is a plugin-based intelligent agent development framework. When using third-party gateways (such as TokensForce), manual management of API keys and configuration is usually required. The dsh-tokensforce plugin aims to solve this cumbersome configuration and login problem through automated workflows.
Plugin Positioning¶
dsh-tokensforce is a plugin for DeepSeek Harness, maintained by spirits001. It integrates the TokensForce token gateway and supports one-click login, automatic provider configuration, and usage dashboard integration. Its core value is to enable “log in once, use models immediately” without manually entering keys or editing configuration files.
Core Features¶
The plugin provides the following core capabilities:
- One-click login and auto-injection: On first launch, a login window automatically appears; after selecting an enterprise or group, the API key and gateway address are automatically written.
- Multi-enterprise/group support: New groups can be added on the settings page. The login state is retained for 7 days, so no re-login is required during that period.
- Usage dashboard: A “TokensForce” tab is added to the session view, where usage, cost, and rankings can be viewed, consistent with the web version.
- 7-day session retention: The browser retains only the JWT session state, which is valid for 7 days.
- Secure storage: Group keys are stored in the local credentials file (
~/.dsh/.credentials.yaml); the browser does not store keys.
Installation and Activation¶
Use the official installation command to add the plugin:
dsh plugin --profile web add dsh-tokensforce
After installation, start the service:
dsh web
Open a browser and visit http://127.0.0.1:3080; the login wizard will appear automatically.
Typical Usage¶
- First launch: When dsh starts and no model has been configured yet, the TokensForce login window appears automatically. The login method is consistent with the web version (email verification code).
- Organization selection: If the account belongs to multiple enterprises or groups, a selection screen appears; if there is only one, it is skipped automatically.
- Automatic configuration: After selection is complete, the API key and gateway address of the selected group are configured automatically. The model context is set to 1M by default (unless the gateway discloses the actual value).
- Add a new group: Later, on the settings page, click the “Connect TokensForce” button in the upper-right corner to add a new group (the login state is valid for 7 days).
- View usage: In the session view, click the “TokensForce” tab to view the usage and cost dashboard.
Notes¶
- Disable official onboarding: The plugin disables the official DeepSeek provider onboarding flow to avoid two login prompts appearing at startup. The model engine still uses dsh’s built-in OpenAI-compatible channel.
- Custom deployment: If your company has internally deployed the TokensForce gateway, modify
SITE_ORIGINinnode_modules/dsh-tokensforce/lib/client.jsto your site address, and then restart dsh. The site must allow embedding of the login page. - Key security: Keys are stored locally, and the browser retains only the JWT session state. Model requests are sent directly from the dsh host process to the gateway, bypassing the browser.
- Applicable scenarios: Suitable for users who need to uniformly manage multiple enterprise/group API keys and who need to view real-time TokensForce usage data.
Summary¶
dsh-tokensforce simplifies the TokensForce integration process through a plugin-based approach. It integrates authentication, configuration, and monitoring into the DSH ecosystem, making it suitable for developers who need to switch organizations frequently or who care about gateway usage statistics.
- Plugin directory: https://www.skillhub.cn/plugins/spirits001/dsh-tokensforce
- GitHub repository: https://github.com/spirits001/dsh-tokensforce