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

@aiti-ai/pi-models-respect

v0.1.2

Published

Keep your model list tidy: for providers with an explicit models list in models.json, only those models stay visible. A pi package.

Readme

pi-models-respect

一个让模型列表保持整洁的 pi 包

对于你在 models.json 里显式配置了 models 列表的 provider,只有你配置的 模型保持可见——内置 catalog 里那一大堆模型(比如 openrouter 的全量目录) 会安静地退到一边。

不会删除任何东西:provider 定义、模型定义、凭据都原样保留。本包只影响 pi 的模型视图中显示哪些模型。

🇬🇧 English version: README.md

为什么需要它

pi 的 models.json 是追加式语义:内置 provider 保留完整 catalog,你显式配置 的 models 条目在其上合并。所以像 openrouter 这类 provider,即使你只配置了 几个模型,也会显示 300 多个内置模型。单靠 models.json 无法缩减这个列表。

这个包在不改变 pi 解析 provider 方式的前提下补上了这个缺口。

安装

pi install npm:@aiti-ai/pi-models-respect

或者直接指向本仓库:

pi install git:github.com/aiti-ai/pi-models-respect

工作原理

扩展包住了 ModelRuntimeModelRegistry 上的模型查询入口 (getModelsgetAvailablegetAvailableSnapshotgetAllfind)。 对于每个在 ~/.pi/agent/models.json 里显式配置了 models 列表的 provider, 只有这些显式配置的模型 id 保持可见。没有显式 models 列表的 provider (比如依赖内置 catalog 的 sensenova)完全不受影响。

白名单 100% 从 models.json 生成(按文件 mtime 自动重读)。用你的模型向导 增删模型后,下一次查询即反映——无需改扩展、无需重启。

示例

~/.pi/agent/models.json 里这样配置:

{
  "providers": {
    "openrouter": {
      "baseUrl": "https://openrouter.ai/api/v1",
      "api": "openai-completions",
      "models": [
        { "id": "z-ai/glm-5.2:free" },
        { "id": "openai/gpt-oss-20b:free" }
      ]
    }
  }
}

openrouter 下只有 z-ai/glm-5.2:freeopenai/gpt-oss-20b:free 保持可见—— 其余内置 catalog 从模型选择、modelRegistry.getAll()modelRegistry.getAvailable()modelRegistry.find() 中隐藏。

配置

没有独立配置文件。白名单完全跟随 models.json

依赖要求

  • pi(编码 agent)——本包是 pi 扩展
  • ~/.pi/agent/models.json 中对你想要精简的 provider 配置了显式 models 列表

License

MIT