Introduction

DeepSeek’s official pricing uses peak and off-peak periods. Running costs are higher during peak periods and lower during off-peak periods. The DSH plugin ecosystem allows features to be extended through plugins. The dsh-laa plugin addresses this issue by providing LAA (Low Activity/Usage Hours) mode for each session. It automatically stops execution during DeepSeek peak periods and resumes execution during off-peak periods.

Core Features

  • Session-level control: Provides an independent LAA mode switch for each session.
  • Automatic switching: Automatically stops execution during peak periods and automatically resumes execution during off-peak periods, recovering interrupted turns.
  • Control plane: Provides a browser toggle and a Web UI control plane, with browser notifications for peak/off-peak transitions.
  • API support: Supports controlling the mode via the HTTP API (GET /dsh-laa/state, POST /dsh-laa/mode).
  • Session inheritance: Child sessions do not have independent modes and follow the parent session.

Installation

You must install the plugin using the official installation command. After installation, restart the service.

dsh plugin --profile web add dsh-laa

After installation is complete, restart dsh web or DSH Desktop. The configuration file is located at cordis.patch.yml.

Usage

After the plugin is installed, it can be controlled through the command line or the Web UI.

  1. Command-line control

    • /laa: View status (switch, current peak/off-peak state, next transition, peak window, number of queued inputs awaiting recovery).
    • /laa on: Enable LAA mode for this session.
    • /laa off: Disable the mode; disabling sends any queued inputs immediately.
  2. Web UI control

    • Use the slider toggle on the right side of the session page top bar, or on the left side of the input box tool row on the new conversation page, to switch the current session’s mode.
  3. HTTP API control

    • Get the session state:
        curl -s "$DSH_URL/dsh-laa/state?sessionId=$SID"
*   Set the mode:
        curl -s -X POST "$DSH_URL/dsh-laa/mode" \
        -H 'content-type: application/json' \
        -d "{\"sessionId\":\"$SID\",\"enabled\":true}"

Configuration and Limitations

  • Effective scope: Only applies to the deepseek-official provider (billed by peak/off-peak periods). Other providers are not billed by peak/off-peak periods and are not constrained.
  • Child session behavior: Child sessions do not have independent modes and follow the parent session. Pending work is recorded under the session that created them.
  • Browser notifications: Browser notifications require permission. The policy is controlled by the notify configuration item.
  • State persistence: State is persisted to $DSH_HOME/laa/state.

The configuration file is cordis.patch.yml, and the main configuration items include:
* enabled: The master switch for the plugin.
* timeZone: The timezone used for peak windows (default: Asia/Shanghai).
* peakWindows: The array of peak windows; all other periods are off-peak.
* peakProviders: The provider routes billed by peak/off-peak periods (default: deepseek-official).
* cancelRunningOnPeak: Whether to cancel running turns when a peak period starts.
* resumeOnValley: Whether to automatically resume execution when an off-peak period starts.
* notify: The browser notification policy.