@pi-vault/pi-providers

Pi extension that adds MiniMax, StepFun, and Command Code model providers

Packages

Package details

extension

Install @pi-vault/pi-providers from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@pi-vault/pi-providers
Package
@pi-vault/pi-providers
Version
0.3.1
Published
Aug 30, 2026
Downloads
432/mo · 41/wk
Author
lanhhoang
License
MIT
Types
extension
Size
56.7 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

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. Command Code requires Pi 0.84.4 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)
export CMD_API_KEY="..."

# Optional: require zero-data retention for Command Code requests
export CMD_ZDR=1

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.

What's New In 0.3.1

  • command-code import consolidationcommand-code.ts now imports anthropicMessagesApi, openAICompletionsApi, createProvider, Provider, and RefreshModelsContext from a single @earendil-works/pi-ai/compat entry point. No behavior change.

What's New In 0.3.0

  • command-code provider (new) — bundled with 62 snapshot models captured on 2026-08-29, CMD_API_KEY authentication, optional CMD_ZDR=1 zero-data-retention requests, and dual routing (Claude/Anthropic Messages for Claude IDs, OpenAI Chat Completions for everything else).
  • Live catalog overlay — Command Code fetches its model list from https://api.commandcode.ai/provider/v1/models, refreshes at most every four hours, and persists the last successful overlay for offline restore. On first run, or after a refresh failure, the bundled snapshot stays visible until a refresh succeeds.
  • Toolchain updates — TypeScript 7, Biome 2.5.11 schema. No code changes were required for the TypeScript bump. 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 62 bundled snapshot models varies varies varies varies dated snapshot 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.

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 62 bundled models captured on 2026-08-29 remain the static baseline. A successful live catalog response is a separate overlay that adds or replaces model records; later responses can remove only prior live-only overlay records. Pi persists the last successful overlay and restores it offline; online checks run at most every four hours unless forced. Refreshing requires CMD_API_KEY; on the first run, or after a refresh failure, Pi keeps showing the bundled or prior catalog until a successful refresh completes. Claude IDs use Anthropic Messages, and all other IDs use OpenAI Chat Completions. Prices are dated estimates in USD per 1M tokens. Temporary offers use the rates advertised on 2026-08-29 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.