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

pi-diy-provider

v0.1.1

Published

Create custom API providers for Pi without editing JSON

Readme

Pi DIY Provider

English | 简体中文 | 繁體中文 | 日本語 | 한국어

A focused Pi package for setting up API-key-based relay and custom providers without editing JSON. It writes provider and model definitions to ~/.pi/agent/models.json, refreshes Pi's model registry, and safely reloads the extension runtime.

Install

Install the latest release from npm:

pi install npm:pi-diy-provider

Try it for one session without adding it to your settings:

pi -e npm:pi-diy-provider

Update or remove the installed package:

pi update npm:pi-diy-provider
pi remove npm:pi-diy-provider

Use

Run /provider-add and enter:

  • a stable lowercase provider id;
  • a display name;
  • an HTTP(S) Base URL;
  • an API type (OpenAI Chat Completions is the default; OpenAI Responses, Anthropic Messages, and Google Generative AI are also supported);
  • whether to discover models after login or enter model ids manually.

The recommended discovery flow is:

/provider-add
/login <provider-id>
/provider-model-sync <provider-id>

/provider-model-sync resolves the API key from Pi's credential store, requests the provider's model-catalog endpoint, and opens the discovered comma-separated model ids in an editor for review. Confirming the list updates models.json, refreshes Pi, and makes the authenticated models available in /model.

Discovery recognizes OpenAI- and Anthropic-style { "data": [...] } catalogs and Google-style { "models": [...] } catalogs. It sends the stored key using the authentication convention for the selected API and times out after 20 seconds. A relay must expose a compatible model-list endpoint; if it does not, rerun /provider-add and choose manual model entry.

The extension preserves unrelated models.json configuration. Before changing an existing file, it creates a timestamped sibling backup such as models.json.backup-20260905T010203004Z, then replaces the original atomically. Existing JSON comments are accepted, although a rewritten file is formatted as standard JSON; the backup retains the exact original text.

No API key is written to models.json. When using manual model entry, run:

/login <provider-id>

The provider appears in Pi's built-in API-key provider list. After the key is saved in Pi's credential store, manually configured models become available in /model; discovery-mode providers appear there after /provider-model-sync saves a non-empty model list. This package intentionally adds separate /provider-add and /provider-model-sync commands; Pi's extension API does not expose a supported way to inject an arbitrary setup action into the native /login menu.

Development

Requires Node.js 22.19 or newer.

git clone https://github.com/chen-985211/pi-diy-provider.git
cd pi-diy-provider
npm install --ignore-scripts
npm run check

Load the local checkout for one session while developing:

pi -e /absolute/path/to/pi-diy-provider

Or install the local checkout in Pi:

pi install /absolute/path/to/pi-diy-provider