npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-adaptive-effort

v0.3.0

Published

DSH plugin: auto-select reasoning_effort (low/high/max) per user turn via a MiniMax complexity scorer with heuristic fallback, an effort-router-style token ledger, and a per-reply metadata label (model · effort · tokens · steps, click to jump back). Manua

Readme

dsh-adaptive-effort

DSH 宿主插件:用 MiniMax 给每条用户消息打复杂度分,自动选择 reasoning_effort(low / high / max),带 effort-router 风格的 token 记账(分档统计、降档节省估算、误路由标记),并在每条 AI 回复末尾挂元数据标签(模型 · 思考档位 · 输出 tokens · 步数,点击回到该回复开头)。GLM-5.3 安全:绝不自动选 off / medium,强制思考模型上的手动 off 会被钳制为 low。

English · 中文

它解决什么问题

  • effort 是会话级设置,没有程序化的逐轮调整手段:默认高档在琐碎改动上浪费 token,默认低档在难题上思考不足(effort-router 的问题陈述,同样适用于 DSH)。
  • GLM-5.3 强制思考(thinking.type: disabled 直接报错)且只认 low / high / max 三档(medium 报错)——自动切换器必须守住这条硬边界。

工作原理

用户消息 ──► MiniMax 复杂度打分(thinking 关闭,max_tokens≤64,严格 JSON)
                │  失败/超时/无 key ──► 启发式回退(长度+代码块+关键词)
                ▼
            tier ∈ {low, high, max}(按消息缓存:一条消息最多打一次分)
                │  + 近期工具重负载只升不降(≥3200 字符参数 → max)
                ▼
       agent/request 瀑布注入 reasoningEffort(prepend,模型选择器手动档优先)
                ▼
       JSONL 账本(~/.dsh/adaptive-effort/ledger-<会话>.jsonl)
                ▼
       中文报表:分档 token 统计 / 降档节省估算 / 误路由标记
  • 打分后端:默认 minimax(LLM 判分,准);可切 heuristic(零依赖纯规则)。MiniMax 调用带 thinking: {type:"disabled"}——打分要快要便宜。
  • 手动优先:模型选择器里选了 off/low/high/max 就不干预;插件往选择器里注入 Auto 档,选 Auto 才启用自动调度。
  • GLM-5.3 钳制:强制思考模型(glm-5.3+ / glm-4.7)上的手动 off 会被替换成 low 并记日志,避免 API 报错。
  • 记账:每次请求记录(tier、effort、原因、打分来源),每步的 assistant/message usage(input/output tokens)延迟入库;报表给出「疑似低估」(low 档输出爆炸)与「疑似高估」(high/max 档输出极小)标记。

回复标签(v0.3)

每条已定稿的 AI 回复的 IconActions 行里渲染一枚徽标:

[ glm-5.3 · 低 · 1.5k tok ]
  • 模型 · 思考档位 · 输出 tokens;点击平滑滚到该回复;
  • 挂官方 conversation.chat.assistant-actions list 插槽(additive,与 feedback 等共存;不走 turnTail 链——那是 first-match-wins 互斥链,会被 better-sidebar/deliverables 挡掉);
  • 数据 = 会话快照 legacy nodes(usage)join trajectory 视图(requestConfig:model/reasoningEffort,按 turn+step 对齐)——零 RPC;
  • 标签上的「思考」就是实际注入档位——配合自动调度,一眼核验每条回复真的跑在哪档。

档位入口:模型选择弹窗(v0.2.1 起)

像选 DeepSeek 推理等级一样:点开模型选择弹窗 → 模型下方「推理等级」列表 → 多出一项 「自动」(副标题:自适应档位,MiniMax 打分消息复杂度,在 low/high/max 间自动调度)。

| 模型弹窗「推理等级」 | 行为 | |---|---| | 自动 | MiniMax 打分 + 调度(low/high/max,重负载工具只升不降) | | Off / Low / High / Max | 原生手动档,插件不介入、不打分 | | 未选 | 不介入(走适配器默认) |

GLM-5.3 等强制思考模型上,任何来源的 off 都会被钳制为 low 并记日志。

设置 → 插件卡片只放后端配置(打分后端 MiniMax/启发式、启用开关、重负载升级开关);高级用户可用 cordis.yml 的 level 强制全局档位。

安装(本地开发)

cd dsh-adaptive-effort
pnpm install && pnpm build
dsh plugin add ./dsh-adaptive-effort   # 或按你的 profile 方式挂载

刷新 DSH 页面后生效。

配置(cordis.yml 或设置命名空间 adaptive-effort)

| 键 | 默认 | 说明 | |---|---|---| | enabled | true | 总开关 | | level | auto | 插件级档位:auto(跟随模型选择器,双 Auto 才打分)或强制档 off/low/high/max | | mode | minimax | minimax / heuristic | | minimaxApiKey | '' | 为空时读环境变量 MINIMAX_API_KEY,再为空回退启发式 | | minimaxBaseUrl | https://api.minimaxi.com/v1 | 国际站;国内换成 https://api.minimax.chat/v1 | | minimaxModel | MiniMax-M3 | 打分模型 | | scoreTimeoutMs | 4000 | 打分超时,超时回退启发式 | | allowToolUpgrade | true | 允许重负载工具参数把档位升到 max | | clampForcedThinkingOff | true | GLM-5.3 等强制思考模型上把手动 off 钳制为 low | | ledgerDir | '' | 账本目录;空 = ~/.dsh/adaptive-effort |

报表

node lib/report.js            # 会话索引
node lib/report.js --last     # 最近会话报表
node lib/report.js --session <id>
node lib/report.js --all      # 全部合并

输出示例:

== 自适应思考档位报表 ==
会话步骤数:42,总输出 tokens:318442

档位      步数    输出 tokens    均值/步
low       6       5222           870
high      21      330440         15735
max       15      276780         18452

降档节省估算(相对全程 max 的粗略反事实):约 36503 tokens

设计来源与致谢

已知限制

  • 账本采集发生在下一次 agent/request:一轮的最后一个 assistant 步骤要等下一轮请求才入库(中断的轮次可能缺usage记录)。
  • 启发式回退是保守的长度+关键词规则,中文为主;MiniMax 后端可用时不参与定档。
  • 报表 CLI 只读本地 JSONL,不消耗 API。

License

MIT