kolawong/fast-compaction-dsh ↗★ 2

fast-compaction-dsh

提供基于决策的快速上下文压缩引擎 适合需要快速判定保留或丢弃上下文以优化模型调用的任务。

套件
fast-compaction-dsh
相容性
待驗證
版本
0.1.0
授權
NOASSERTION
最近更新
2026年9月20日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:kolawong/fast-compaction-dsh

Configuration

All fields are optional and stack in two layers:

  1. 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 when apiKey/model/baseUrl change, so no restart is needed. The friendly editor is this package's own Web settings card (web/, the fast-compaction-dsh/client entry) on the Plugins page (apiKey rides as a secret role field — only a set/unset flag ever crosses the wire).
  2. 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.

FieldDefaultMeaning
apiKeyTYPESAFE_API_KEYTypeSafe API key
modeljev-latestJev model name
baseUrlhttps://api.typesafe.ai/v1/systemoneSystem One endpoint
keepThreshold0.5Minimum keep probability for a call or result to stay
preserveRecentMessages6Newest messages never touched (the first is always kept)
maxStateTokens25000Estimated token ceiling for the state
maxRequestTokens30000Estimated ceiling for state plus one batch of questions
truncateHeadChars300Characters of a dropped tool result retained before its note
minReduction0.25Fall back to the built-in summary below this reduction ratio
disabledfalseUse only the built-in summarizer