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

@shelken/pi-dynamic-models

v0.1.2

Published

自动发现已配置 provider 的远端模型,并用 models.dev registry 补全上下文窗口、输出上限、推理能力和输入模态。

Readme

pi-dynamic-models

自动发现已配置 provider 的远端模型,并用 models.dev registry 补全上下文窗口、输出上限、推理能力和输入模态。

安装

本插件作为 pi-extensions mono repo 的子包维护。通常只需要把仓库根目录作为 Pi package 加到 settings.jsonpackages,由根 package.jsonpi.extensions 加载本插件入口。

{
  "packages": ["/path/to/pi-extensions"]
}

修改 settings.json 后,在 Pi 中 /reload 即可加载。

配置

配置文件位置:

  • 全局:~/.pi/agent/extensions/pi-dynamic-models/config.json
  • 项目级:.pi/extensions/pi-dynamic-models/config.json

项目级配置会覆盖全局配置中的同名字段。

配置内容:

{
  "enable": true,
  "enableProviders": ["provider-name"],
  "debug": false
}

字段说明:

  • enable:是否启用扩展。
  • enableProviders:要自动发现模型的 provider 名称,必须已经存在于 Pi 的 models.json
  • debug:是否同时输出调试日志到 console;日志文件始终写入。

行为

  • 启动时读取 Pi 的 models.json,只处理 enableProviders 中列出的 provider。
  • 远端模型列表来自 provider 的 baseUrl + /models,provider 域名、API key 和 API 类型都来自 models.json。不在插件内硬编码 provider 地址。
  • 只新增 models.json 中未手动定义的模型,不覆盖已有模型。
  • 自动发现的模型名统一追加 (AUTO)
  • registry 和远端模型列表只缓存 raw 数据,不缓存最终匹配结果。
  • registry 缓存 6 小时内直接使用本地文件,避免启动时等待网络 ETag 请求。
  • 匹配算法先归一化模型名,再统一收集候选,最后按模型家族偏好、路由提示和完整对齐程度选最优。

运行时文件

~/.pi/agent/cache/models-registry.json          # models.dev registry 缓存
~/.pi/agent/cache/provider-models/<provider>.json # provider 远端模型 ID 列表缓存
~/.pi/agent/logs/pi-dynamic-models.log          # 扩展日志

debug=false 时日志仍写入文件,但不会输出到 console。