@alexeiled/pi-provider-compat

Bridge Pi custom providers into the legacy pi-ai compat dispatcher

Packages

Package details

extension

Install @alexeiled/pi-provider-compat from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@alexeiled/pi-provider-compat
Package
@alexeiled/pi-provider-compat
Version
0.1.3
Published
Oct 4, 2026
Downloads
302/mo · 19/wk
Author
alexeiled
License
MIT
Types
extension
Size
8.2 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@alexeiled/pi-provider-compat

npm version CI license

Temporary compatibility bridge for Pi extensions that call the legacy pi-ai dispatcher.

Problem

Pi >=0.80.8 keeps custom provider handlers registered through pi.registerProvider() inside their provider runtime. The legacy global @earendil-works/pi-ai/compat registry no longer receives those handlers.

Directly selecting a custom-provider model still works. An extension that calls stream() or streamSimple() from pi-ai/compat for that model fails instead:

No API provider registered for api: <custom-api>

Solution

This extension mirrors registered custom providers with streamSimple into the legacy compat registry. It routes each request by model.provider to the matching provider-scoped handler.

It does not use provider-specific names or allowlists. It never replaces an existing compat provider, and removes only registrations it created.

Install

pi install npm:@alexeiled/pi-provider-compat

Then reload Pi:

/reload

Temporary migration bridge

This package is a workaround, not the durable design. Affected extensions should use the selected provider's registered streamSimple handler from Pi's model registry, with the legacy compat dispatcher only as a fallback for built-in APIs.

Migration is tracked here:

Extension Issue
@yeliu84/pi-model-router #19: Custom provider targets fail on Pi >= 0.80.8
pi-subagents #527: Watchdog review fails with custom providers on Pi >= 0.80.8

Remove this bridge once the extensions you use have released those migrations.

Requirements

  • Pi 1.x starting at 1.0.2 (tested with Pi 1.0.2)
  • A custom provider registered with pi.registerProvider(..., { streamSimple })

This package does not provide credentials, implement a provider, or change Pi's normal model routing. It cannot help when the selected provider has no registered streamSimple handler.

Development

npm install
npm run test:all

License

MIT