用途:管理 ~/.pi/agent/models.json 配置文件的命令行工具,基于 Bun 脚本运行,入口为 ~/.pi/agent/skills/models-config/models.ts。
主要能力:列出模型(支持按 provider 查看详情与 JSON 输出);添加 Provider(设置 baseUrl、API 密钥、API 类型、是否使用 Authorization header);添加模型(设置显示名称、是否支持推理、上下文窗口、最大输出、输入/输出价格);测试连接(可指定测试消息、流式响应、推理与思考级别 minimal/low/medium/high/xhigh);按 provider 批量测试;删除 provider 或指定模型;从 models.dev 更新价格;查看 OpenAI 兼容与 Anthropic 兼容配置模板;验证 JSON 配置。
支持 API 类型:openai-responses、openai-completions、anthropic-messages、google-generative-ai、mistral-conversations、azure-openai-responses,各自对应不同端点。
使用方式:通过 bun 执行脚本,例如列出模型 bun models.ts list,添加 Provider bun models.ts add provider <name> <baseUrl> [选项],添加模型 bun models.ts add model <provider> <modelId> [选项],测试 bun models.ts test <provider> [modelId] [选项],批量测试 bun models.ts batch <provider>,删除 bun models.ts rm <provider> [modelId],更新价格 bun models.ts update,模板 bun models.ts template openai-compatible 或 anthropic-compatible,校验 bun models.ts validate。
适用场景:需要集中维护多 Provider、多模型参数与价格的本地配置,并在使用前验证连通性、流式与推理能力。
限制:资料仅说明为 Bun 脚本与本地 JSON 管理工具,未提供收费、平台兼容范围、性能与稳定性等信息;价格更新依赖 models.dev,实际可用性取决于所配置的第三方接口。