Install
Install with PiG
pig install npm:pi-dynamic-providersInstall with Pi
pi install npm:pi-dynamic-providersReview before installing
Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./src/dynamic-models.ts"
]
}README
Written by the package's publisher, shown as published in version 0.0.5 (README.md). PiG does not review it.
pi-dynamic-providers
A Pi coding agent extension to automatically discover and register models from OpenAI-compatible endpoints (/models).
Features
- Dynamic Model Discovery: Queries the
/modelsendpoint at startup and dynamically registers available models with the Pi provider registry. - Reasoning Model Support: Enables reasoning support for models with configurable thinking levels up to
max. - Manual Hot-Reload: Provides a
/refresh-modelscommand to reload the remote model catalog without restarting Pi. - Flexible Configuration: Reads configuration from
~/.pi/agent/dynamic-models/config.json.
Configuration
Create configuration in ~/.pi/agent/dynamic-models/config.json (or ~/.pi/agents/dynamic-models/config.json):
{
"baseUrl": "https://your-llm-proxy.example.com/v1",
"apiKey": "your-api-key-optional",
"providerId": "my-proxy",
"providerName": "Custom Proxy",
"defaultContextWindow": 400000,
"defaultMaxTokens": 8192
}
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
baseUrl | string | (required) | Base URL for the OpenAI-compatible API endpoint |
apiKey | string | "dummy-key" | Authorization token sent as Bearer header |
providerId | string | "dynamic-models" | Unique ID for the registered provider in Pi |
providerName | string | "Dynamic Models" | Friendly name for the provider displayed in Pi |
defaultContextWindow | number | 400000 | Fallback context window when not reported by /models |
defaultMaxTokens | number | 8192 | Fallback max tokens when not reported by /models |
Commands
/refresh-models: Re-fetches the remote/modelsendpoint and updates registered models.
Installation
Via Pi Package Catalog / npm
pi install npm:pi-dynamic-providers
Via Git Repository
pi install git:github.com/cybershape/pi-dynamic-models
Try Without Installing
pi -e git:github.com/cybershape/pi-dynamic-models
Requirements
- Pi Coding Agent (
@earendil-works/pi-coding-agent)>= 0.80.0 - Node.js
>= 20.0.0
Development
Install dependencies and run checks:
npm install
npm run check
License
MIT © cybershape