@alexeiled/pi-provider-compat
v0.1.3
Published
Bridge Pi custom providers into the legacy pi-ai compat dispatcher
Maintainers
Readme
@alexeiled/pi-provider-compat
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-compatThen reload Pi:
/reloadTemporary 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:allLicense
MIT
