omp packages

pi-dynamic-providers0.0.4

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

GitHub Actions Published 12 days ago MIT ~698 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

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

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 /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