pi-zenmux

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

ZenMux Provider Extension for pi

This package adds a zenmux provider to pi using the extension API (registerProvider), as requested in badlogic/pi-mono#1811.

Features

  • Registers provider name: zenmux
  • Uses API key env var: ZENMUX_API_KEY
  • Fetches live model list from https://zenmux.ai/api/v1/models at runtime
  • Routes Anthropic models to https://zenmux.ai/api/anthropic with anthropic-messages
  • Routes non-Anthropic models to https://zenmux.ai/api/v1 with openai-completions
  • Model maxTokens is merged from https://models.dev/api.json at runtime

Install

Local path

pi install /absolute/path/to/pi-zenmux

NPM

pi install npm:pi-zenmux

Configure

Set API key:

export ZENMUX_API_KEY="your-zenmux-key"

Or use ~/.pi/agent/auth.json:

{
  "zenmux": {
    "type": "api_key",
    "key": "your-zenmux-key"
  }
}

Use

pi --provider zenmux --model anthropic/claude-opus-4.6

You can also start pi normally and switch with /model.

Optional endpoint override

If you need to route to a different ZenMux domain:

export ZENMUX_BASE_URL="https://zenmux.ai"

The extension derives:

  • OpenAI-compatible base: ${ZENMUX_BASE_URL}/api/v1
  • Anthropic-compatible base: ${ZENMUX_BASE_URL}/api/anthropic

Publish

npm run check
npm login
npm publish --access public

Dev / Test

npm install
npm run typecheck
npm test