|
|
1 개월 전 | |
|---|---|---|
| README.md | 1 개월 전 | |
| index.ts | 1 개월 전 | |
| package.json | 4 달 전 |
A pi extension that registers DuckCoding AI as a custom AI provider using its OpenAI-compatible API (openai-completions).
https://www.duckcoding.ai/api/pricing)./v1/models endpoint using your API key to narrow down models specifically enabled for your billing tier/group, avoiding model_not_found errors.~/.cache/pi-agent-duckcoding/.You can install this plugin directly via pi package management or place it in your Pi configuration.
pi installpi install npm:pi-extension-duckcoding
# or from git repository:
pi install git+https://github.com/<owner>/pi-agent-duckcoding-provider.git
Add the directory to your ~/.pi/agent/settings.json:
{
"extensions": [
"/path/to/pi-agent-duckcoding-provider"
]
}
Or copy/link index.ts to ~/.pi/agent/extensions/duckcoding.ts.
Set your DuckCoding API key in your environment:
export DUCKCODING_API_KEY="your-duckcoding-api-key"
You can also configure it in your shell startup file (~/.bashrc, ~/.zshrc, etc.) or Pi's environment configuration.
| Variable | Description | Default |
|---|---|---|
DUCKCODING_API_KEY |
Your DuckCoding API key (required to query models and authenticate requests). | None |
DUCKCODING_MODEL_CACHE_TTL_MS |
Cache TTL in milliseconds for the public model & pricing list. | 604800000 (7 days) |
PI_OFFLINE |
Disables network refresh when set. | None |
Once configured, launch Pi:
pi
Switch to any DuckCoding model using the /model command:
/model duckcoding/<model-id>
Example:
/model duckcoding/claude-3-7-sonnet-20250219
Or specify the model directly on launch:
pi --model duckcoding/claude-3-7-sonnet-20250219
https://www.duckcoding.ai/api/pricing for chat-compatible models and their token costs.https://pi.dev/api/models/providers/...).DUCKCODING_API_KEY using https://api.duckcoding.ai/v1/models and caches key availability for 1 hour.session_start event).Cache files are stored in:
~/.cache/pi-agent-duckcoding/models.json (Model definitions & pricing)~/.cache/pi-agent-duckcoding/availability.json (Key-specific model availability)MIT