pi-dynamic-providers
Pi extension to dynamically discover and register models from OpenAI-compatible endpoints
Package details
Install pi-dynamic-providers from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-dynamic-providers- Package
pi-dynamic-providers- Version
0.0.4- Published
- Oct 7, 2026
- Downloads
- 714/mo · 24/wk
- Author
- hhhtj
- License
- MIT
- Types
- extension
- Size
- 9.6 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./src/dynamic-models.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
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