121212165/dsh-plugin-cache-guard ↗★ 0
dsh-plugin-cache-guard
dsh plugin: prefix-cache health guard. Separates prefix rewrites from ordinary context growth using the three disjoint usage buckets, and estimates the tokens re-billed at full price. 适合需要优化大模型上下文缓存和控制API成本的用户。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:121212165/dsh-plugin-cache-guardREADME
Read the full README ↗配置
| 字段 | 默认 | 说明 |
|---|---|---|
window | 8 | 基线滑动窗口(同时也是"最近"的跨度) |
factor | 2.5 | 大小闸:未缓存基线倍数 |
floorTokens | 1500 | 大小闸:绝对地板(正常增长不误报) |
collapseRatio | 0.25 | 形状闸:cacheRead 低于自身基线该比例算塌陷 |
collapseMinBaseline | 2000 | 形状闸:基线低于此值不判塌陷(不报缓存的 provider 不误伤) |
rebillShare | 0.6 | 归因闸:重计量需达到上一步 prompt 的该比例 |
adviseModel | true | 上下文内提醒 |