Introduction¶
The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” In model inference scenarios, manually configuring reasoning levels for different requests (such as Off, Low, Medium, High) is cumbersome and may introduce additional latency and resource overhead due to frequent switching between models or configurations. The dsh-adaptive-reasoning plugin addresses this pain point by automatically selecting an appropriate reasoning level for each request without making extra model calls, keeping GPUs active, or running background tasks.
Plugin Overview¶
This is a standalone plugin maintained by Manolo Remiddi, focused on automating model inference in DeepSeek Harness. It does not require a trained classifier model; instead, it identifies task families through local rules and uses existing DSH models to automatically select reasoning levels.
Core Features¶
- Automatic reasoning selection: The plugin automatically selects reasoning levels based on task type. It makes decisions using existing models instead of introducing a new classifier.
- Task family recognition: It can identify local task families with specific rules (for example, conversational greetings, text rewriting, summarization, prompt improvement, etc.) and apply the corresponding local rules.
- Decision logging and metrics: During request processing, the plugin records reasoning decisions (
adaptive-reasoning/decision) and time/character statistics (adaptive-reasoning/measurement) in sidecar files, without copying the original prompt or answer text. - Lifecycle integration: It supports DSH lifecycle hooks and request hooks, as well as tool guard mechanisms.
- Flexible configuration: It can be controlled through configuration options such as
enabled,textOnly,presets, androutes.
Installation and Enablement¶
Before installation, ensure that Node.js (>=22.18.0) is installed and the DSH environment has been deployed.
- Package the plugin: Go to the plugin source directory and run the package command.
npm pack
This generates the `dsh-adaptive-reasoning-0.2.3.tgz` file.
- Add the plugin: Use the
dsh plugincommand to install the generated tarball into DSH.
dsh plugin --profile web add /absolute/path/dsh-adaptive-reasoning-0.2.3.tgz --ignore-scripts --config.auto-install-peers=false
*Note: Replace the path with the actual absolute path. After installation, DSH must be restarted for the changes to take effect, and all running tasks should be completed before installation.*
Typical Usage¶
After configuring the plugin, you do not need to manually adjust reasoning levels for each request. You can debug and verify it in the following ways:
- Read reports: Use the provided report script to read decision and measurement data from sidecar files.
npm run report
By default, this command reads the current and previous sidecar files.
- Configure routes: Specific provider/model/effort-level mappings must be defined in the configuration. The plugin automatically manages reasoning levels on these routes based on the rules, without changing unconfigured routes.
Applicable Scenarios and Notes¶
- Applicable scenarios: Scenarios that require automated management of reasoning levels, especially for developers who want to reduce manual intervention and avoid frequent switching between model configurations.
- Conservative preview: The current version (0.2.3) is a conservative preview and is not a fully trained or perfect difficulty estimator.
- No guarantee of semantic correctness: The plugin does not guarantee the semantic correctness of final answers or validate every answer.
- Dependency on model configuration: To enable automatic effort-level changes, specific configuration must be set for the model.
- Log location: Diagnostic logs are stored in
$XDG_STATE_HOME/dsh-adaptive-reasoning/telemetry.l. - Permissions and replay: The plugin does not introduce automatic replay of completed actions or relaxation of permissions.
Summary¶
dsh-adaptive-reasoning provides DSH users with a solution for automatic reasoning management. Through local rules and sidecar file logging, it achieves lightweight automation. If you are looking for a way to reduce manual configuration and improve reasoning efficiency, you can try it via its GitHub repository.