@pi-vault/pi-providers
v0.2.2
Published
Pi extension that adds MiniMax and StepFun custom model providers
Maintainers
Readme
@pi-vault/pi-providers
Register MiniMax M3 and StepFun Flash reasoning models as custom providers for Pi.
Install, Upgrade, And Reload
pi install npm:@pi-vault/pi-providersThen reload Pi:
/reloadQuick 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="..."After reloading, the providers appear in Pi's model picker:
- Select
minimax-openai(orminimax-openai-cn) and chooseMiniMax-M3. - Select
stepfun-aiand choose one ofstep-3.7-flash,step-3.5-flash-2603, orstep-3.5-flash.
Ask Pi normally; there is no provider-specific prompt syntax. Image input works with MiniMax-M3 and step-3.7-flash.
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 |
API bases:
minimax-openai:https://api.minimax.io/v1minimax-openai-cn:https://api.minimaxi.com/v1stepfun-ai:https://api.stepfun.ai/step_plan/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-openaiandminimax-openai-cnproviders wrap their streams with a MiniMax-specific pipeline that folds inlinethinkblocks into a properthinkingcontent block, repairs empty{}tool-call arguments via second-chance JSON parse, reorders tool-result messages to match the order of precedingtool_useblocks (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.
- 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 release:checkChangelog
See CHANGELOG.md for release notes.
License
MIT. See LICENSE.
