← Catalog

pi-dynamic-providers

Pi extension to dynamically discover and register models from OpenAI-compatible endpoints

ExtensionProvider

Install

Install with PiG

pig install npm:pi-dynamic-providers

Install with Pi

pi install npm:pi-dynamic-providers
Review 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

CI npm version License: MIT

A Pi coding agent extension to automatically discover and register models from OpenAI-compatible endpoints (/models).

Features

  • Dynamic Model Discovery: Queries the /models endpoint 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-models command 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

OptionTypeDefaultDescription
baseUrlstring(required)Base URL for the OpenAI-compatible API endpoint
apiKeystring"dummy-key"Authorization token sent as Bearer header
providerIdstring"dynamic-models"Unique ID for the registered provider in Pi
providerNamestring"Dynamic Models"Friendly name for the provider displayed in Pi
defaultContextWindownumber400000Fallback context window when not reported by /models
defaultMaxTokensnumber8192Fallback max tokens when not reported by /models

Commands

  • /refresh-models: Re-fetches the remote /models endpoint 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