DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Context Budget — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins

dsh-context-budget

Context Budget

将本地模型的上下文长度保持在 GPU 能够良好处理的范围内:基于测得的预填充速度设置硬上限,并为 DeepSeek Harness 提前进行压缩

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add dsh-context-budget@0.2.0
README兼容性版本

兼容性与来源证明

Context Budget 以 dsh-context-budget 发布,当前版本为 0.2.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
npm
Registry 更新时间
2026/8/30

版本

0.2.0stable
2026/8/30
0.1.0stable
2026/8/30

相关插件

正在加载相关插件…

最新版
0.2.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
18.1 kB
文件数
5
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 0
周下载
0
最近提交
2026/8/30
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 memory-context 分类下经过校验的插件。

Memory Plugin@openviking/dsh-memory-plugin适用于 DeepSeek Harness 的 OpenViking 记忆与上下文套件Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Weknora@wxg-prc-cpg/dsh-weknora适用于 DeepSeek Harness (dsh) 的 WeKnora 知识检索工具:通过自有知识库进行语义搜索、文档阅读以及 RAG/代理回答。Mnemondsh-mnemon面向 DeepSeek Harness 的可组合三层记忆控制平面:持久化运行时上下文、可搜索的项目文档、可插拔的长期记忆、受保护的策略、WebUI 和无头工具。

README

dsh-context-budget

A DeepSeek Harness plugin that keeps a local model's context at a size your GPU handles well.

dsh compacts a conversation when it reaches a fixed fraction of the model's declared context window. On local hardware the declared window is not very practical. For example, a 27B model that advertises 256K may read prompts at 300 tokens per second when the context is small and at 70 tokens per second past 100K. So a turn could take a few seconds to start early in the conversation, but later in the same session take half an hour. Also, the GPU may hang before the window is full. This plugin measures how expensive the context has become and warns or compacts early before that point.

What it checks

Before every agent step, for each guarded provider route:

CheckSettingTrips when
Hard ceilinghardCeilingTokensthe context is larger than this many tokens
Observed slownessmaxTtftMsthe last reply on this context took longer than this before its first token
Predicted slownessmaxColdPrefillMscontext size divided by the measured prefill rate exceeds this (the wait if the server's prompt cache were lost)

Any configured check can be tripped. If you leave the check unset, it is skipped. The prefill rate is measured on every model request from the time to the first chunk and the uncached prompt tokens the server reported.

Install

dsh plugin --profile web add dsh-context-budget

Then in ~/.dsh/profiles/web/cordis.patch.yml:

- id: context-budget
  config:
    providers:
      llamacpp:
        hardCeilingTokens: 110000    # optional
        maxTtftMs: 180000            # optional, 3 minutes
        maxColdPrefillMs: 600000     # optional, 10 minutes
        retainTokens: 24000          # kept verbatim when compacting (default 16000)
        action: warn                 # warn (default) or compact

The provider key is the route name from your dsh settings. Each provider entry needs at least one check. After installing the plugin, restart dsh web and open a new session.

Check the composed config with dsh --profile web --dump-config.

What it does when a check trips

  • warn: prints one line to the dsh terminal, naming the check and the current values, as well as an estimate of what compacting now would cost:

    context-budget: llamacpp session=d1e4be82 predicted: cold prefill 37.2 min > 10.0 min (152340 tokens, rate 68 tok/s, compacting now ~41.2 min)
    
  • compact: prints the same line, then asks dsh's compaction engine to summarize everything except the most recent retainTokens, cut at a tool-call boundary. The outcome is printed too (compacted N items (~T tokens) or compaction failed: ...; continuing). The step always continues.

Compaction itself costly on local runs ( summary prompt and the rewritten context both prefill cold) which is what the compacting now estimate shows, so a lower ceiling with a larger retainTokens usually costs less overall than many small compactions.

/context-budget

Type it in a session to see the current values:

context-budget (llamacpp / qwen3.8-long)
  context: 152340 tokens   ceiling 110000   [TRIP]
  last ttft: 41 s   limit 180 s
  measured rate: 68 tok/s (3 samples)
    3 min ago   8400 tok in 37 s   cold
    12 min ago   2100 tok in 8 s   warm
    41 min ago   12800 tok in 55 s   cold
  predicted cold: 37.3 min   limit 10.0 min   [TRIP]
  compact now: ~41.2 min   (retain 24000)
  action: warn

Each sample line shows when it was measured, how many uncached tokens the server had to read, the wait for the first token, and whether the server answered partly from its prompt cache (warm) or read everything fresh (cold). Warm samples have flattering timings; the list makes that visible.

Notes

  • Works with any provider dsh streams from since nothing talks to the model server directly. Measurements come from dsh's own usage reports and wall-clock timing.
  • The plugin runs beside dsh's compaction-basic, which keeps its own threshold. Setting a per-model thresholdRatio there gives you a static ceiling with no plugin. The plugin adds the measured checks and the cost estimate.
  • Compaction summary requests are not measured, and an observed slow reply is forgotten once the context has been rewritten so one compaction does not trigger another.
  • If the session's agent preset has no compaction engine, compact behaves as warn (logged once per session).
  • Log lines are printed only when a check trips; a session that stays under the limits prints nothing.

License

MIT