pi-yandex-bridge
v0.3.19
Published
Pi Coding Agent provider bridge for Yandex Cloud AI (YandexGPT)
Maintainers
Readme
pi-yandex-bridge
Pi Coding Agent provider bridge for Yandex Cloud AI (YandexGPT).
Models
All models available in your Yandex Cloud folder are fetched dynamically after authentication. Supported models include:
- YandexGPT (Pro 5.1, Pro 5, Lite) — with chain-of-thought reasoning
- DeepSeek V3.2 — with thinking mode
- Qwen3 series (235B, 3.5-35B, 3.6-35B) — with reasoning
- GPT-OSS (120B, 20B) — with reasoning capability
- Other models like Alice AI LLM, Gemma 3, embedding models, and speech models
Installation
Install from npm:
npm install pi-yandex-bridgeOr add directly to ~/.pi/agent/settings.json:
{
"extensions": ["pi-yandex-bridge"]
}Then restart Pi and run /yalogin.
Auth: OAuth (default)
1. Find your Yandex Cloud folder ID
In the Yandex Cloud console, select your folder. The ID is shown in the URL and on the folder overview page (looks like b1gk28...).
2. Log in
Run /yalogin in Pi. A browser window opens automatically — authorize the app, and the token is captured without any pasting. Pi then prompts for your folder ID. Available models are fetched immediately after login.
IAM tokens expire after 12 hours and are refreshed automatically using the stored OAuth token. The model list is re-fetched on each refresh.
To skip the browser flow, set env vars before starting Pi:
export YANDEX_OAUTH_TOKEN="y0_AgAAAA..."
export YANDEX_FOLDER_ID="b1g..."Auth: Static API key
Set both env vars before starting Pi — no auth.json entry needed:
export YANDEX_API_KEY="your-api-key"
export YANDEX_FOLDER_ID="your-folder-id"Models are fetched at startup using the API key. You can generate an API key in the Yandex AI Studio or in the Yandex Cloud console under Service accounts → your account → API keys.
Development & Testing
Run tests
bun testTests cover:
- Model ID parsing from Yandex API response
- OAuth → IAM token exchange
- Header construction (Bearer tokens vs. API keys)
- Error handling and timeouts
- Model entry structure validation
Manual API verification
Before releasing, verify that the Yandex API is accessible and models are being fetched correctly:
# OAuth flow
YANDEX_OAUTH_TOKEN="<token>" YANDEX_FOLDER_ID="<id>" bun run verify.ts
# API key flow
YANDEX_API_KEY="<key>" YANDEX_FOLDER_ID="<id>" bun run verify.tsThe verification script:
- Tests IAM token exchange (OAuth only)
- Fetches the list of available models
- Tests connectivity to the model API endpoint
- Reports any 404 errors or misconfiguration
Build
bun run buildOutputs to dist/index.js.
