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

koishi-plugin-aihub-auto

v0.3.0

Published

查询 AIHub 当前最优分组,或最高倍率层中最慢的单个最烂分组

Readme

koishi-plugin-aihub-auto

查询 AIHub 当前最优或最烂分组。插件只读取公开 usage-stats、官网真实用户平均 TTFT 与云端探测并回复排名,不会修改 AIHub Key 或执行切组

群里发 最优分组/最优分组,机器人回复:

AIHub 当前推荐
策略:价格与首字延迟均衡
1. A001-Plus/K12(#57)|0.03x|9584 ms
2. A012-K12(#30)|0.06x|4300 ms
3. A001-Plus(#34)|0.06x|6012 ms
下载:https://github.com/WSXYT/aihub-auto/releases/latest

最烂分组/最烂分组 则只回复 1 个:先取最高有效倍率层,再选其中首字延迟最慢的分组:

AIHub 当前最烂分组
策略:最高倍率优先,同倍率首字最慢
1. A099-Plus(#99)|0.15x|12800 ms
下载:https://github.com/WSXYT/aihub-auto/releases/latest
  • 最优条数自适应 1~6 条:分数接近就多列,断层就只列头部
  • 最烂固定只发 1 条:有效候选中倍率最高优先,同倍率则保守首字延迟最慢优先
  • 只比较倍率在 maxRate 内、官网 provider 当前可用且具有有效 TTFT 的候选;即使 usage-stats 仍有历史/残留样本,available=false 的分组也不会推荐
  • 评分算法与 aihub-auto 自动路由应用同源:官网用户/云端探测几何融合、保守延迟修正、价格与首字延迟三种策略
  • economy 只约束最优推荐;最烂查询仍覆盖 maxRate 内全部有效倍率层
  • 仅查询 AIHub 当前提供的 OpenAI 分组

安装

插件市场搜索 aihub-auto,或:

npm i koishi-plugin-aihub-auto

配置

| 配置项 | 默认 | 说明 | | --- | --- | --- | | rules | ["onebot:*"] | 生效范围,每项 平台:群号,* 通配。示例:onebot:1059338666(指定群)、onebot:*(OneBot 全部群)、*:*(所有平台) | | baseUrl | https://aihub.top | 站点地址(usage-stats 为 AIHub 自有接口,不兼容其他 sub2api 站) | | mode | balanced | economy 省钱 / balanced 均衡 / speed 速度 | | maxRate | 0.15 | 最大倍率硬约束 | | samples | 100 | 每组统计样本条数 | | scoreWindow | 0.15 | 最优推荐窗口:与最优分差在窗口内才展示 | | strategyText | 价格与首字延迟均衡 | 「策略:」后的文案,可自定义 | | downloadUrl | 应用 Releases | 自动路由应用下载链接 | | template | 见下 | 最优分组回复模板,变量 {strategy} {items} {download} | | worstTemplate | 见下 | 最烂分组回复模板,变量同上 | | cacheTtlMs | 30000 | 推荐结果缓存 | | cooldownMs | 10000 | 每群冷却 | | respondPrivate | false | 是否响应私聊 | | errorText | AIHub 数据暂不可用,请稍后再试 | 降级文案 |

默认模板:

AIHub 当前推荐
策略:{strategy}
{items}
下载:{download}

最烂分组默认模板只将首行改为 AIHub 当前最烂分组

触发方式

  • /最优分组/最烂分组(经指令系统,支持你配置的全局 prefix 与 help)
  • 裸文本 最优分组最烂分组(中间件精确匹配,@机器人后跟触发词也可)

两种方式同一消息只回一次;同类查询在冷却期内重复触发静默,最优和最烂的冷却互不阻塞。