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

@brglng/pi-model-discovery

v0.1.1

Published

Model auto-discovery for Pi using only models.json — no extension development needed

Readme

@brglng/pi-model-discovery

A Pi extension that adds model auto-discovery to Pi using only the providers section of Pi's native ~/.pi/agent/models.json — no extension development needed. Same format as Pi's built-in model configuration, with <baseUrl>/models discovery and per-model overrides built in.

Installation

pi install /absolute/path/to/pi-model-discovery

After publication:

pi install npm:@brglng/pi-model-discovery

Configuration

Providers are defined under the providers key of Pi's native ~/.pi/agent/models.json. The key is the provider ID; each value is one provider. For example:

{
  "providers": {
    "gateway": {
      "$schema": "https://raw.githubusercontent.com/brglng/pi-model-discovery/main/schemas/config.schema.json",
      "name": "My Gateway",
      "baseUrl": "https://api.example.com/v1",
      "apiKey": "$GATEWAY_API_KEY",
      "api": "openai-completions",
      "models": [
        {
          "id": "special-model",
          "api": "openai-responses",
          "baseUrl": "http://192.168.5.46:18000/v1",
          "maxTokens": 32768
        }
      ]
    }
  }
}

baseUrl is the provider default URL and is optional. Providers without a baseUrl remain in the configuration, but the extension skips remote model discovery for them. apiKey uses Pi's native config value syntax. API keys are provider-level; Pi's native model configuration does not support a separate API key per model. It supports literals, $ENV_VAR, ${ENV_VAR}, and leading !command values. The key is never stored in the configuration when an environment variable or command reference is used.

Model discovery and overrides

Model discovery is always enabled: the extension requests <baseUrl>/models with a Bearer token. It accepts common OpenAI-style responses (data), bare arrays, and catalogs nested under models or output.models. Set PI_OFFLINE=1 to skip all network requests during startup.

Server model metadata is used by default. Entries in the models array can specify overrides for configured model IDs. Provider and model fields are kept as supplied; this extension does not validate fields it does not consume. Configured model IDs are also retained when the server does not return them. Common fields include name, api, baseUrl, reasoning, thinkingLevelMap, input, cost, contextWindow, maxTokens, samplingParams, headers, and compat. This allows each model to select a different endpoint and API type such as openai-completions, openai-responses, or anthropic-messages. The spelling anthropic-message is accepted as an alias.

If discovery fails, explicitly configured models remain available.

Commands

  • /model-discovery status shows configured providers and model counts.
  • /model-discovery refresh refreshes every catalog.
  • /model-discovery refresh <provider> refreshes one catalog.

License

MPL-2.0