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-vault/pi-providers

v0.4.1

Published

Pi extension that adds MiniMax, StepFun, and Command Code model providers plus a TypeSafe Jev decision tool

Readme

@pi-vault/pi-providers

npm version Quality Node >= 24.15.0 License: MIT

Register MiniMax M3, StepFun Flash, and Command Code models as custom providers for Pi, and add a typesafe_decide tool for typed decision questions answered by TypeSafe Jev. Command Code requires Pi 0.86 or newer.

Install, Upgrade, And Reload

pi install npm:@pi-vault/pi-providers

Then reload Pi:

/reload

Quick Start

Set the API keys for the providers you want to use before launching Pi:

# MiniMax global endpoint (minimax-openai)
export MINIMAX_API_KEY="..."

# MiniMax China endpoint (minimax-openai-cn)
export MINIMAX_CN_API_KEY="..."

# StepFun Step Plan endpoint (stepfun-ai)
export STEP_API_KEY="..."

# Command Code provider (command-code), and the typesafe_decide fallback backend
export CMD_API_KEY="..."

# Optional secondary Command Code key name (CMD_API_KEY takes precedence)
export COMMAND_CODE_API_KEY="..."

# Optional: direct TypeSafe credential for typesafe_decide (preferred)
export TYPESAFE_API_KEY="..."

# Optional: enforce zero data retention for Command Code chat-provider requests only; excludes typesafe_decide
export CMD_ZDR=1

# Optional: override the live catalog endpoint only (inference bases stay unchanged)
export CMD_MODELS_URL="https://catalog.example.test/models"

You can also save a Command Code credential through Pi's login flow:

/login command-code

CMD_API_KEY is the primary environment variable; COMMAND_CODE_API_KEY is a secondary alias. CMD_MODELS_URL changes only where the live model catalog is fetched, never where inference requests are sent.

After reloading, the providers appear in Pi's model picker:

  • Select minimax-openai (or minimax-openai-cn) and choose MiniMax-M3.
  • Select stepfun-ai and choose one of step-3.7-flash, step-3.5-flash-2603, or step-3.5-flash.
  • Select command-code and choose any bundled Command Code model.

Ask Pi normally; there is no provider-specific prompt syntax. Image input works with MiniMax-M3 and step-3.7-flash.

typesafe_decide is a tool, not a selectable chat model, so it never appears in the model picker and never accepts a chat prompt. Pi calls it like any other tool — see TypeSafe Decisions.

What's New In 0.4.1

  • COMMAND_CODE_API_KEY alias and catalog-only CMD_MODELS_URL override — CMD_API_KEY keeps precedence; CMD_MODELS_URL changes only where the live model catalog is fetched, never where inference requests are sent. Inference bases are unchanged.
  • Live pricing, modalities, and reasoning metadata with strict catalog validation — valid live fields override local estimates; missing fields fall back to Pi donor metadata, official family defaults, or the dated bundled pricing snapshot. Malformed refreshes retain the prior catalog.
  • Official family and adaptive-thinking fallbacks — retained alongside the bundled snapshot and offline cache. Pricing for temporary offers uses the rates advertised on 2026-09-30.
  • Command Code output-cap and cache migration — default max output raised to 32,768 capped by each model's context window. Legacy cache records are migrated in place.
  • OpenAI Responses routing — supported alongside Anthropic Messages and OpenAI Chat Completions. Records advertising only /responses no longer get filtered out.
  • 86-model bundled snapshot — captured 2026-09-30 (was 82). See CHANGELOG.md for the full release notes.

What's New In 0.4.0

  • typesafe_decide tool (new) — answers typed Noul, Choice, and Score questions against a JSON state with TypeSafe Jev and returns structured probabilities, not generated text. Calls TypeSafe System One directly when a TYPESAFE_API_KEY or host-resolved typesafe credential is present; otherwise makes a single fallback request to typesafe/jev through command-code. Direct 400 / 422 responses and cancellation are terminal and never fall back. System One requests never inherit CMD_ZDR, because typesafe/jev has no ZDR-capable Command Code upstream — the tool provides no enforced-ZDR mode.
  • Command Code catalog refreshed to 82 models — snapshot captured 2026-09-27 (was 62). Routing is declared per record: /messages takes precedence, /chat/completions is used otherwise, and records advertising only /responses are filtered out because this package does not implement Responses API transport. Pricing estimates were also refreshed against the 2026-09-27 rates. See CHANGELOG.md for the full release notes.

Providers And Models

| Provider | Model | Input | Reasoning | Context | Max output | Input / output per 1M tokens | Cache read | | -------------------------------------- | ------------------------------------------------ | ----------- | ------------------------- | --------- | -------------------------- | ---------------------------- | ---------- | | minimax-openai / minimax-openai-cn | MiniMax-M3 | text, image | yes | 1,000,000 | 512,000 | $0.60 / $2.40 | $0.12 | | minimax-openai / minimax-openai-cn | MiniMax-M2.7 | text | yes | 204,800 | 131,072 | $0.30 / $1.20 | $0.06 | | minimax-openai / minimax-openai-cn | MiniMax-M2.7-highspeed | text | yes | 204,800 | 131,072 | $0.60 / $2.40 | $0.06 | | stepfun-ai | step-3.7-flash | text, image | low / medium / high | 256,000 | 256,000 | $0.20 / $1.15 | $0.04 | | stepfun-ai | step-3.5-flash-2603 | text | low / high | 256,000 | 256,000 | $0.10 / $0.30 | $0.02 | | stepfun-ai | step-3.5-flash | text | automatic (shown as high) | 256,000 | 256,000 | $0.10 / $0.30 | $0.02 | | command-code | 86 bundled snapshot models (captured 2026-09-30) | varies | varies | varies | up to min(32,768, context) | varies | varies |

API bases:

  • minimax-openai: https://api.minimax.io/v1
  • minimax-openai-cn: https://api.minimaxi.com/v1
  • stepfun-ai: https://api.stepfun.ai/step_plan/v1
  • command-code: https://api.commandcode.ai/provider/v1

Cache writes are free for MiniMax-M3. They cost $0.375 per 1M tokens for MiniMax-M2.7 and MiniMax-M2.7-highspeed. They are free for all stepfun-ai models.

TypeSafe Decisions

typesafe_decide is a Pi tool, not a chat model. It takes a JSON state plus one or more named questions and returns structured probabilities, not generated text:

  • Noul — a yes/no question with optional true / false criteria.
  • Choice — a question over 2–255 named options, each with an optional rubric.
  • Score — a question over 2–10 ordered level descriptions.

See the TypeSafe quick start for how to construct questions, and the TypeSafe API reference for the full upstream contract. A request using all three question types:

{
  "state": { "repo": "pi-providers", "phase": "release review" },
  "questions": {
    "ship_now": {
      "type": "noul",
      "instructions": "Is the release safe to ship today?",
      "criteria": { "true": "All gates pass", "false": "Any gate is open" }
    },
    "risk_level": {
      "type": "score",
      "instructions": "How risky is shipping today?",
      "criteria": ["low", "moderate", "high"]
    },
    "next_step": {
      "type": "choice",
      "instructions": "What should happen next?",
      "criteria": { "ship": "No blockers remain", "fix": "Address open gates" }
    }
  }
}

Routing. The tool prefers direct TypeSafe access: with a configured credential it calls jev-latest on the TypeSafe System One API. If no direct credential is available, or a direct attempt fails in a retryable way, it may make a single fallback request to typesafe/jev through Command Code. Direct 400 / 422 responses mean the request itself is invalid, and a cancelled call is terminal — neither falls back. Credentials are resolved in this order: a host-resolved typesafe credential, then a non-blank TYPESAFE_API_KEY, then command-code fallback auth.

Billing. The result reports which backend answered: backend is typesafe or command-code, alongside the concrete response model, the answers, and token usage. Direct calls bill your TypeSafe account. Fallback calls consume the Command Code plan's model-specific credits or your pay-as-you-go credit balance. See the Command Code Provider API and the GOAT plan for current rates — this README intentionally does not copy mutable prices.

Privacy. The tool never sends x-cmd-zdr, even when CMD_ZDR=1 is set, because Command Code documents no ZDR-capable upstream for typesafe/jev. It does not provide an enforced-ZDR mode. A direct TypeSafe credential changes the preferred backend but does not disable Command Code fallback after retryable direct failures, and direct TypeSafe handling is governed by your TypeSafe agreement rather than CMD_ZDR. If your policy requires ZDR, do not send that data through this tool unless that agreement independently satisfies the requirement and Command Code fallback authentication is unavailable.

Known Limits

  • Key matching. The provider code passes the corresponding environment-variable reference ($MINIMAX_API_KEY, $MINIMAX_CN_API_KEY, $STEP_API_KEY) to Pi. If the variable is unset, the provider cannot authenticate.
  • MiniMax tool-call hardening. The minimax-openai and minimax-openai-cn providers wrap their streams with a MiniMax-specific pipeline that folds inline think blocks into a proper thinking content block, repairs empty {} tool-call arguments via second-chance JSON parse, reorders tool-result messages to match the order of preceding tool_use blocks (the MiniMax API rejects mismatched ordering), and fails closed with a retryable error if the upstream ever emits internal tool-call markup instead of proper OpenAI tool calls.
  • StepFun native stream. StepFun uses Pi's built-in OpenAI-compatible driver directly, without the MiniMax hardening pipeline.
  • Command Code catalog. The 86 bundled models captured on 2026-09-30 are the fallback baseline, with a default max output of 32,768 capped by each model's context window. A successful live catalog response is authoritative for exposed model IDs, so bundled models missing from that response stay hidden until a later live refresh includes them. Valid live pricing, modalities, and reasoning metadata overrides local estimates; missing fields fall back to Pi donor metadata, official family defaults, or the dated bundled pricing snapshot. Pi persists the last successful catalog and restores it offline; source-aware online checks run at most every four hours unless forced, and changing CMD_MODELS_URL triggers a refresh. Refreshing requires Command Code authentication; on the first run, or after a refresh failure, Pi keeps showing the bundled or prior catalog until a successful refresh completes. Routing is declared per record: /messages uses Anthropic Messages, /responses uses OpenAI Responses, and /chat/completions uses OpenAI Chat Completions. Prices are dated estimates in USD per 1M tokens. Temporary offers use the rates advertised on 2026-09-30 and may change or expire; explicit free model IDs are zero in this snapshot and must be refreshed when their offers expire or the IDs leave the live catalog. DeepSeek V4 uses the displayed off-peak estimate because Pi cannot represent UTC price bands, and its peak input/output rates are higher. Open-model routing and ZDR can also change the actual charge; Command's usage page remains authoritative. CMD_ZDR=1 applies only when making requests and is never persisted in the model cache.
  • Deeply nested tool schemas. The MiniMax API may produce collapsed nested arguments on complex JSON schemas; this has been observed with MiniMax-M3. The package emits a diagnostic message instead of retrying.

Development And Verification

pnpm install
pnpm check
pnpm pack:dry-run

Changelog

See CHANGELOG.md for release notes.

License

MIT. See LICENSE.