Daniel Griesser 发布了 pi-openrouter 扩展,将 OpenRouter 的 advisor、subagent 等服务器工具集成到 Pi 平台,支持实时进度和成本显示
AI 摘要
Daniel Griesser 发布了 pi-openrouter 扩展,将 OpenRouter 的 advisor、subagent 等服务器工具集成到 Pi 平台,支持实时进度和成本显示。
推荐理由常规快讯,保留列表
原文
Pi extension exposing OpenRouter server tools as local pi tools — works with any pi provider, not just OpenRouter.
Each tool makes a one-shot OpenRouter chat-completions call where a cheap executor model (google/gemini-2.5-flash by default) invokes the server tool and relays its output verbatim.
Tools
| Tool | Server tool | What it does |
|---|---|---|
| or_advisor | openrouter:advisor | Consult a stronger model (default ~anthropic/claude-opus-latest) for guidance; optional web search |
| or_subagent | openrouter:subagent | Delegate a self-contained task to a fast worker model (default ~anthropic/claude-haiku-latest) |
| or_web_search | openrouter:web_search | Web search with citations |
| or_web_fetch | openrouter:web_fetch | Fetch/extract URL content (pages, docs, PDFs) |
| or_fusion | openrouter:fusion | Multi-model panel + judge analysis |
All tools show live progress in the TUI: spinner, phase, elapsed time, and bytes received as the result streams in.
While running:
When done:
Out of scope: datetime, image_generation, shell, files, apply_patch, experimental__search_models — pi covers most natively, shell/patch require the Responses API.
Install
pi install git:github.com/HazAT/pi-openrouterOr for local development, clone and add to ~/.pi/agent/settings.json:
{ "extensions": ["/path/to/pi-openrouter/index.ts"] }(This repo also wires itself via .pi/settings.json, so running pi inside the checkout loads the extension automatically.)
API key
Resolved in order:
OPENROUTER_API_KEYenvironment variable- pi model registry (
openrouterprovider) ~/.pi/agent/models.json→providers.openrouter.apiKey
Cost
Every call bills the executor model's tokens plus server-tool usage on your OpenRouter account. The executor is cheap and output is capped, but or_fusion and or_advisor with large models can cost real money. Cost per call is surfaced in the tool result details.
Development
vp install
vp check # format + lint + typecheck (Vite+ toolchain)
pi # extension auto-loads via .pi/settings.jsonLicense
MIT
讨论
暂无评论。