dsh-call-shrink: A DSH plugin for DeepSeek Harness to Compress LLM Calls
zhuzichen362/dsh-call-shrink
A DSH plugin that compresses multiple LLM calls into one via caching, dedup, and batch merging, saving tokens and budget.
dsh-call-shrink is a call compression plugin built for DeepSeek Harness. It intercepts and merges LLM requests at the Stream layer, reducing N upstream calls to 1. Through three layers—cache replay, in-flight dedup, and batch merge—it cuts redundant API calls from concurrent sessions, parallel sub-agents, and title generation without altering conversation results. The plugin also provides a real-time panel showing usage and savings, plus one-click toggle and parameter tuning, helping you significantly reduce token consumption and budget in agent environments.
How to Install
dsh plugin --profile web add github:zhuzichen362/dsh-call-shrink- Category
- Tools & Capabilities
- Platform
- DSH Plugin
- Author
- zhuzichen362
- Distribution
- Plugin
dsh-call-shrink Key Features
dsh-call-shrink Repo Summary
What Does It Do?
dsh-call-shrink is a DSH plugin for DeepSeek Harness that compresses LLM calls by intercepting and merging requests at the Stream layer, reducing N upstream calls to 1. It solves the problem of redundant API calls caused by concurrent sessions, parallel sub-agents, title generation, and similar requests in agent environments. Through three layers—cache, dedup, and batch-merge—it saves tokens, budget, and time without changing the conversation result.
Core Features
- Cache replay: identical fingerprint requests are replayed directly, with 24-hour TTL, 4096 entries, and disk persistence.
- In-flight dedup: same-fingerprint requests share one upstream result, avoiding duplicate calls.
- Batch merge: within a 10-second window, N independent requests are merged into 1 upstream call, with no limit on count and no character-based splitting.
- Title generation short-circuit: requests with
purpose === 'title'return empty immediately, resulting in 0 upstream calls. - Real-time panel: shows today's usage/budget, single vs. merged cost sharing, dedup, cache hits, and saved calls.
- Usage persistence: daily budget of 500, recording daily and per-session usage across restarts.
How to Use This Plugin?
After enabling it in DSH, call-shrink automatically intercepts llm/stream events without manual intervention. A "call compression" status dot appears in the session header, allowing one-click toggle or reset. Through host.call RPC, you can query state, session stats, and enable/disable. To adjust parameters, modify the "tuning area" at the top of src/host.js, such as cache TTL, merge window, and daily budget.
This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: zhuzichen362/dsh-call-shrink. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.
