The core architecture of DeepSeek Harness (DSH) is “everything is a plugin”. When performing model inference and agent development, Prompt caching is key to reducing latency and inference costs. As a plugin, dsh-cache-warmer aims to help developers better manage inference sessions by estimating cache time, observing cached Token usage, and providing optional cost-aware warm-up capabilities.
Core Features¶
This plugin provides the following capabilities:
- Cache Time Estimation: Uses a draining ring mechanism to estimate the remaining time for Prompt caching.
- Token Usage Observation: Displays the number of cached Tokens in the current session.
- Cost-Aware Warm-up: Proactively initiates warm-up requests to extend cache validity when costs allow.
- Model Compatibility: As long as the model is compatible with text dialogue, warm-up can be performed regardless of the provider name (non-pi-ai routes only support observation mode).
- Interface and Configuration: Settings only exist in the “Plugins → Cache warmer” menu, providing Chinese and English UI and natively styled switch controls.
Installation and Usage¶
Install the latest officially released version (v0.1.7):
dsh plugin --profile web add 'https://github.com/yoggu/dsh-cache-warmer.git#v0.1.7'
For local debugging, you can link to the local checkout directory:
git clone --branch v0.1.7 --depth 1 https://github.com/yoggu/dsh-cache-warmer.git
cd dsh-cache-warmer
dsh plugin --profile web add "link:$(pwd)"
After installing or replacing a version, you must restart DSH and refresh the browser. Updating or installing the plugin itself will not automatically send warm-up requests.
Applicable Scenarios and Considerations¶
Environment Requirements¶
The plugin requires a compatible Harness runtime environment to run, including:
* Standard large language model services
* Session projection services
* Credential and storage services
* Plugin’s built-in pi-ai adapter
The native warm-up logic has been reviewed for llm-pi-ai 0.2.0-rc.2 and pi-ai 0.99.1. If the adapter or serializer version differs, the plugin will enter a “fail-closed” state (i.e., no warm-up requests are sent).
Default Behavior¶
- Default Disabled: The plugin is disabled by default and needs to be manually enabled.
- Lifecycle: Timing is based on the last “real” model request, not page refreshes or tool execution completion times.
- Sub-sessions: Sub-sessions (subagents) will not auto-warm up.
Model and Cache Strategy¶
Configure model policies in “Plugins → Cache warmer → Model cache policies”. This page automatically lists models from all registered Harness providers (including Codex accounts, pi-ai providers).
* Discovery Mechanism: Providers share a 5-second discovery deadline, browser settings and model list reading have a 10-second timeout with retry support.
* Configuration Items:
* Enable warming: Allow warming up for this model. The lifetime setting is retained after disabling.
* Estimated cache lifetime (minutes): Integer 1-10080. Leave blank for “unknown”, in which case requests will not be sent even if warming is enabled.
* Reset to default: Restore default values.
* Save Mechanism: Only saves user-defined override rules (up to 100 entries), not the auto-discovered catalog. Saving settings cancels captured targets and requires new real requests to resume warming.
Limitations and Special Cases¶
- Codex / OAuth: Codex or signed response routes do not guarantee server-side output caps. Need to separately enable “Allow best-effort warming (Codex / OAuth)” in plugin settings.
- Client Cancellation: Client cancellation cannot guarantee that hidden reasoning or provider generation has stopped.
- Price Estimation: Price estimation is not actual consumption or quota caps.
- Bedrock: Currently unavailable because AWS Bedrock’s native SDK cannot disable retries through this interface.
- Cache Lifetime Assumptions: The plugin does not rely on provider-reported lifetimes or built-in Codex lifetimes; all lifetimes are local planning assumptions.
Summary¶
dsh-cache-warmer provides DeepSeek Harness users with refined Prompt cache management capabilities, especially for cost and latency optimization. Developers can finely configure model policies through the plugin menu to achieve controllable cache warm-up. For more technical details, please refer to the GitHub repository.