Introduction¶
In DeepSeek Harness (DSH), once an agent is running, model calls are issued continuously according to the task rhythm. DeepSeek’s official routing charges at peak rates during certain periods; if you continue to make calls during these periods, billing will be settled at peak prices. While manually timing requests, modifying cron jobs, or wrapping a scheduling layer externally can help stagger peaks, these methods require maintaining your own schedule and struggle to guarantee that “requests are intercepted before being sent and automatically resumed after the window closes.”
The following introduces the community plugin dsh-offpeak (maintainer: TetraSsky, Category: Workflow). Under the DSH web profile, it intercepts model calls according to your configured pause windows. Requests during the window are not sent to the adapter and do not incur charges; the plugin automatically resumes after the window ends. Optional capabilities include reading account balance and recent spend charts. The plugin is a standalone package that only reads and writes files related to itself and does not depend on other DSH plugins.
What is this¶
dsh-offpeak is a DeepSeek Harness plugin: it holds DeepSeek model calls during peak pricing periods and sends them during non-peak times, allowing billing at off-peak rates. While the window is open, requests are not sent, the agent waits, and execution automatically resumes after the window ends.
- Repository: TetraSky/dsh-offpeak
- Community Directory: skillhub.cn Plugin Page
- Current package version (in documentation): 0.1.2, License: MIT
The DSH ecosystem philosophy is “everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek or High-Flyer.
Core Features¶
The “Pause” consists of three parts¶
| Mechanism | Function |
|---|---|
| Request gate | All model calls flow through the llm/stream waterfall; calls within the window are parked before reaching the adapter, so they are neither sent nor billed. |
| Goal freeze | Goals in the active phase are suspended and no longer progress; the interface displays them as paused rather than busy. Goals paused manually by the user are not modified. |
| Status tool | Provides a read-only tool offpeak_status for the model to explain why it is waiting; it cannot change the schedule. |
There are no per-request overrides and no per-window skips; the schedule is the sole determinant of when to hold. To end a pause early, you must modify the schedule or disable the plugin.
Held requests are released when the window ends, the request is aborted, a schedule change no longer holds them, or the plugin is uninstalled. Upon restart, the plugin restores only the goals it previously paused, based on records in $DSH_HOME/offpeak-paused.json.
Schedule and Timezones¶
Peak pricing is defined in Beijing Time. The plugin distinguishes between:
- Schedule time zone: The timezone in which pause windows are written; it is part of the schedule’s identity.
- Show times in: The timezone used for display only; changing this only re-labels the times and does not alter the windows themselves.
The state machine is evaluated in the schedule timezone, ensuring consistency between the browser and the host.
The settings page offers Apply DeepSeek peak hours: this converts Beijing Time weekday peaks (09:00–12:00, 14:00–18:00, with a two-minute margin) into your selected schedule timezone and appends them. It does not change your timezone or discard existing windows. If the schedule timezone observes Daylight Saving Time (DST), the converted windows will drift relative to Beijing peaks twice a year; the settings page notes that you can use Beijing Time as the schedule timezone to avoid this drift.
Balance and Spend Charts (Optional)¶
When Show API balance is enabled and DEEPSEEK_API_KEY has been saved on the Models page, the host reads the DeepSeek account balance and displays it in the header. Hovering allows you to see the spend breakdown, and clicking reveals a bar chart of the last eight hours with ten-minute granularity. Pause windows depend strictly on the API Key.
- The Key does not leave the host; the browser retrieves derived numbers via an authenticated route.
- Spend represents the sum of balance decreases; top-ups do not offset real spend.
- When the plugin is enabled, it samples every five minutes (not limited to when balance is displayed) and writes to
$DSH_HOME/offpeak-history.json(288 samples, approximately 24 hours). - History starts from plugin activation; usage prior to installation cannot be restored.
The balance API returns the account’s native currency (possibly USD or CNY). Balance currency can override the symbol, and if a fixed symbol is selected, CNY per USD can be configured for conversion.
UI Indicators¶
When a window is about to open or is currently open, the header displays a notification with a Dismiss button. Dismiss only silences that specific occurrence within the current page session; switching chats will not trigger a repeat, but refreshing the page will restore the prompt. Different windows are treated as distinct occurrences, and each will trigger an announcement.
Installation and Activation¶
Requirements: DeepSeek Harness with the web profile. Balance and spend charts require DEEPSEEK_API_KEY configured on the Models page; the pausing function itself does not.
Install from GitHub:
dsh plugin --profile web add github:TetraSsky/dsh-offpeak
Install from a local checkout:
dsh plugin --profile web add <path-to-this-package>
Then, add dsh-offpeak to dsh.profile.bundles in $DSH_HOME/profiles/web/package.json and restart. The package’s cordis.patch.yml will insert the corresponding line.
Configuration is placed under the offpeak namespace in $DSH_HOME/settings.yaml. The plugin also writes offpeak-history.json (balance sampling) and offpeak-paused.json (records of goals paused by this plugin) to $DSH_HOME.
Typical Usage¶
- Install and add to the bundle, then restart the DSH web profile.
- Turn on Enable off-peak pause in the plugin settings.
- Select the Schedule time zone, configure Pause windows (
pauseAt–resumeAtand their respective weekdays) and Days that pause (weekends are typically off-peak and usually not included). - To align with official peak hours, use Apply DeepSeek peak hours to append windows, then fine-tune as needed.
- Applies to defaults to DeepSeek official routes only (peak pricing exists only on official routes); you may also choose to apply to all calls.
- Optional: Enable Show API balance, configure Balance currency; use Warn before pause to control how early the header notification appears.
The language follows the Harness’s zh / en switch; the plugin has no separate language setting.
Use Cases and Notes¶
Suitable for: Users who run agents on the DSH web profile long-term, primarily use DeepSeek official routing, and wish to automatically halt requests during known peak periods to be billed at off-peak rates.
Notes:
- Tasks will wait during the window, making this unsuitable for online interactions that are extremely latency-sensitive and cannot shift away from peaks.
- There are no per-request skips; if you need to send a request temporarily, you must modify the schedule or disable the plugin.
- The plugin runs with the permissions of the current DSH process. Before installing, please review the source code and the MIT license yourself to ensure you accept its behavior and scope of file access.
- In timezones with Daylight Saving Time, if using “Apply DeepSeek peak hours” to convert windows, drift relative to Beijing peaks may occur; refer to the README to switch the schedule timezone to Beijing Time.
Summary¶
dsh-offpeak turns “no sending during peaks, automatic resumption during lows” into a built-in workflow for DSH. The request gate, goal freeze, and offpeak_status collectively define the pause semantics. The schedule follows the schedule timezone, and DeepSeek official peak segments can be appended with a single click. For cost visibility, balance and spend charts can be layered on top.
- Community Directory: https://www.skillhub.cn/plugins/TetraSsky/dsh-offpeak
- GitHub: https://github.com/TetraSsky/dsh-offpeak