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

@seqyuan/pimodel

v0.2.4

Published

Import OpenAI-compatible model providers into PI models.json

Readme

pimodel

pimodel imports models from an OpenAI-compatible provider into PI's models.json.

It is a lightweight Node.js CLI with a small interactive prompt dependency and no release build step.

Install

npm install -g @seqyuan/pimodel

Usage

pimodel            # interactive import
pimodel --version  # print version
pimodel --help     # show help

The tool will interactively prompt for:

| Prompt | Description | |---|---| | Base URL | Provider base URL (e.g. https://api.openai.com) | | API Key | API key; leave empty for local providers | | Provider name | PI provider name to create or update | | Models | Choose models interactively from the fetched provider catalog |

Endpoint discovery

The CLI automatically tries multiple endpoint paths to fetch the model list:

  • /v1/models — OpenAI / most compatible providers
  • /models
  • /api/models
  • /api/tags — Ollama

Model display format

When models are discovered, the CLI renders them in this format:

Available models (14):
  1. custom - unknown | out=64000
  2. auto - unknown | out=64000
  3. ring-2.6-1t - unknown | ctx=262144 | out=32800
  4. mimo-v2.5-pro - unknown | ctx=1000000 | out=131000
  5. gpt-5.3-codex - unknown | ctx=400000 | out=128000

Interactive model selection

The flow first lets you choose between importing all models or interactively selecting a subset.

  • Up / Down: move
  • Space: select or unselect the current model
  • Enter: confirm selection
  • Ctrl+C: cancel

For large catalogs, the interactive picker uses a scrollable list instead of printing every model at once. If you enter the multi-select picker and confirm with nothing checked, it imports all models.

Non-interactive mode

When stdin or stdout is not a TTY (e.g. piped input), the tool falls back to a prompt-based mode: it prints the model table and asks you to type all, model numbers, or model IDs.

Provider matching and re-import

When importing, the CLI matches existing providers by baseUrl + apiKey. If a match is found, models are merged into the existing provider entry rather than creating a duplicate.

Re-importing an existing provider overwrites baseUrl and apiKey with the latest values, so you can fix wrong URLs or rotate credentials.

New models are added; existing models are skipped by default (use replaceExisting in programmatic mode to overwrite).

Metadata enrichment

If the provider's model list does not include context window or max output tokens, the CLI automatically tries model detail endpoints (/v1/models/{id}, /models/{id}, /api/models/{id}, Ollama /api/show) to fill in the gaps.

For models where detail endpoints also don't return limits, pimodel estimates defaults based on the model ID (e.g. Claude models default to 200k context, DeepSeek to 128k). Claude models with "thinking" or "reasoning" in the ID are automatically flagged with reasoning: true.

Output

By default it writes:

~/.pi/agent/models.json

If PI_CODING_AGENT_DIR is set, it writes ${PI_CODING_AGENT_DIR}/models.json.