Introduction¶
In the DSH (DeepSeek Harness) environment, using the official API directly during peak hours often leads to billing spikes or request blocking. The deepseek-peak-blocker plugin is designed to intelligently manage requests sent to api.deepseek.com. Through a hybrid architecture (Host process interception and counting, browser-rendered UI), it intercepts, counts, and alerts about requests during peak hours (Beijing time, UTC+8). This plugin is maintained by zisekongling and follows the MIT License.
Core Features¶
This plugin provides the following core capabilities:
- Peak-hour interception: Within predefined peak windows, new requests are blocked. A modal appears in the browser, displaying the time-window attributes and remaining time, and offering actions such as “Continue,” “Cancel Request,” and “Allow this session.”
- Proactive top notification: When a time window switches from off-peak to peak and active requests exist, a banner slides in at the top and automatically fades out after 10 seconds.
- Bottom-right status panel: The panel refreshes in real time, showing the time-window indicator, interception status, remaining time, and the number of active requests. It supports dragging by the title bar, collapsing into a capsule, resizing, and adjusting opacity.
- Slash commands:
/bypass: Obtain a one-time exemption token for the current session. The token becomes invalid after use (in-memory only)./status: Reply in the chat window with the real-time status from the panel.
- Long-task determination and precise counting: Interception is based on a snapshot at the moment the request is initiated; SDK network retries are treated as independent new requests. Counting logic is maintained as paired
llm/streamentry/exit events, with no leaks.
Installation and Configuration¶
This plugin is a DSH bundle plugin and can be installed via the official command. After installation, you must restart DSH to load the bundle.
Installation command:
dsh plugin --profile web add "github:zisekongling/deepseek-peak-blocker#main"
Update or uninstall:
# Update
dsh plugin --profile web update deepseek-peak-blocker
# Uninstall
dsh plugin --profile web remove deepseek-peak-blocker
Configuration parameters (located in settings.yaml or the settings UI):
| Parameter | Type | Default | Description |
|---|---|---|---|
peakHours |
string[] | ["09:00-12:00", "14:00-18:00"] |
Peak hours in Beijing time (UTC+8) |
bufferMinutes |
number | 0 |
Buffer minutes before and after peak hours; 0 means disabled |
blockMessage |
string | Current time is DeepSeek API peak hours. Do you want to continue the request? |
Modal message body |
cancelMessage |
string | The request was canceled by the user. |
Error message when canceled |
peakNotification |
string | ⏰ The API is now in peak hours. A conversation is currently ongoing; please be aware that response speed may be affected. |
Top banner text |
Usage Instructions¶
- View status: Enter
/statusto view four real-time statuses from the panel. - Bypass a request: Enter
/bypassto obtain a token and bypass the modal during peak hours. - Panel settings: Drag the status panel by its title bar; click the gear icon to open a separate settings overlay and adjust the panel size (60%-160%) and opacity (30%-100%).
- Activation rules: The plugin takes effect only during UTC+8 hours on weekdays (Monday through Friday). Saturdays and Sundays are treated as off-peak all day and are fully allowed.
Notes¶
- In-memory storage:
/bypasstokens and status records are stored only in process memory. Tokens are cleared after the plugin restarts. - Proxy detection: If you reverse-proxy
api.deepseek.comand register it as a new provider, the plugin cannot detect or intercept it. Only changing thebaseURLenvironment variable of the official adapter does not change the route identifier, so it will still be intercepted. - Timeout handling: If no one responds to the modal for 30 minutes (
decisionTimeoutMs), the request is automatically canceled. - Architecture limitation: All API requests are initiated by the Host process. The browser does not call
api.deepseek.comdirectly.
Conclusion¶
deepseek-peak-blocker provides DSH users with fine-grained control over official API peak hours. Through interception, counting, and user-friendly UI interactions, it helps developers plan API calls more reasonably on weekdays.
- Directory page: deepseek-peak-blocker
- GitHub repository: zisekongling/deepseek-peak-blocker