AI Agent Hub
Back to plugins
🤖

dsh-ledger-compact

Model Inference Updated 2026.09.11

Run the following command in DeepSeek Harness:

dsh plugin install telagod/dsh-ledger-compact

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install telagod/dsh-ledger-compact inside DeepSeek Harness to install this plugin; the source is available at https://github.com/telagod/dsh-ledger-compact .

About this plugin

In long multi-turn Agent sessions, oversized tool_result blocks are often forwarded verbatim into the next request, burning tokens and swelling the context window. DSH ships an excellent LLM-based compaction, but it costs an extra model call and only kicks in after pressure has already built up. dsh-ledger-compact takes the opposite approach: shape the data locally, before pressure forms, so that the scenarios truly needing LLM intervention shrink dramatically.

The plugin offers three layers of zero-model-call capability. First, ingress shaping: during the idle pre-step, only the unsent oversized tool_result from the step that just finished is excerpted to a head/tail summary; already-sent content stays byte-identical, preserving the provider prefix cache. Second, mechanical fold: /fast-compact or the input-bar bolt collapses older history into a compact ledger card with no model call at all. Third (off by default), replace-default compact: it reuses the official engine's summarize hook so that /compact, auto-compaction, and overflow recovery all run the local summarizer, eliminating the LLM call entirely. On top of this, the plugin supports dense PNG rendering — packing large, repetitive structured text into a tile-aligned canvas where measured token cost is 1/10 to 1/100 of the equivalent raw text, while a line-number ruler and column layout let the model still pinpoint a bad row precisely.

It is built for developers who run long Agent chains where tools return large structured payloads (logs, test reports, API responses). If you work with DeepSeek-series models and want to drive per-turn inference cost to the floor without meaningfully sacrificing structural accuracy, this plugin layers cleanly on top of the official dsh-compaction-basic, letting roughly 90% of compaction scenarios complete with zero additional model calls.

Use Cases

  • Long Agent sessions where tool results return massive JSON or logs that overflow the next turn context
  • Frequently folding older history messages without paying an extra LLM call every time
  • Running DeepSeek-series inference at extreme low per-turn cost without meaningful structural accuracy loss

Best For

  • Developers running long Agent chains where tools frequently return large structured payloads
  • Inference teams on DeepSeek-series models that track token spend closely
  • Workflows layered on top of official dsh-compaction-basic where most LLM compaction can be replaced locally