kolawong/fast-compaction-dsh ↗★ 2
fast-compaction-dsh
提供基于决策的快速上下文压缩引擎 适合需要快速判定保留或丢弃上下文以优化模型调用的任务。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:kolawong/fast-compaction-dsh说明文档
阅读完整 README ↗Configuration
All fields are optional and stack in two layers:
- The settings.yaml user layer (the
fast-compaction:section of~/.dsh/settings.yaml) — wins per field and applies live to subsequent compactions: the engine watches the settings service's hot-publish and rebuilds the Jev transport in place whenapiKey/model/baseUrlchange, so no restart is needed. The friendly editor is this package's own Web settings card (web/, thefast-compaction-dsh/cliententry) on the Plugins page (apiKeyrides as asecretrole field — only a set/unset flag ever crosses the wire). - The preset patch
config:(composition layer) — the per-preset base values; changes require a DSH restart.
Per-field precedence: settings.yaml user layer > preset config: > environment (apiKey only, via TYPESAFE_API_KEY) > code defaults. Unlisted fields pass through to compaction-basic (thresholdRatio, retainRatio, retainTokens, summarizationProvider, summarizationModel, maxTokens, compactionRetries, maxOverflowRetries, modelPolicies, auto).
Note: a settings section whose values fail the schema (e.g. a string in keepThreshold) disables the whole settings layer and falls back to the composition layer, with a warning in the log; the layer retries on the next process start.
| Field | Default | Meaning |
|---|---|---|
apiKey | TYPESAFE_API_KEY | TypeSafe API key |
model | jev-latest | Jev model name |
baseUrl | https://api.typesafe.ai/v1/systemone | System One endpoint |
keepThreshold | 0.5 | Minimum keep probability for a call or result to stay |
preserveRecentMessages | 6 | Newest messages never touched (the first is always kept) |
maxStateTokens | 25000 | Estimated token ceiling for the state |
maxRequestTokens | 30000 | Estimated ceiling for state plus one batch of questions |
truncateHeadChars | 300 | Characters of a dropped tool result retained before its note |
minReduction | 0.25 | Fall back to the built-in summary below this reduction ratio |
disabled | false | Use only the built-in summarizer |