@aliou/pi-edgee
Pi provider extension for [Edgee](https://www.edgee.ai), the Agent Gateway that compresses, routes, and observes LLM requests.
Package details
Install @aliou/pi-edgee from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@aliou/pi-edgee- Package
@aliou/pi-edgee- Version
0.1.1- Published
- Jul 4, 2026
- Downloads
- 458/mo · 21/wk
- Author
- aliou
- License
- MIT
- Types
- extension
- Size
- 24 KB
- Dependencies
- 1 dependency · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/provider/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-edgee
Pi provider extension for Edgee, the Agent Gateway that compresses, routes, and observes LLM requests.
Learn more about Edgee in the official documentation.
Installation
pi install npm:@aliou/pi-edgee
Set the API key before use:
export EDGEE_API_KEY=...
What it provides
- Registers an
edgeeprovider in Pi. - Uses Edgee's OpenAI-compatible Gateway API directly at
https://edgee.io/v1, not an SDK. - Fetches models from
GET https://edgee.io/v1/modelswhenEDGEE_API_KEYis available. Model ids use the{provider}/{model}format (e.g.openai/gpt-5.2); theowned_byfield exposes the upstream provider. - Enriches fetched models from Pi's built-in model registry. For Edgee-only providers such as
metaorqwen, it falls back to OpenRouter models in the registry for matching upstream model metadata. - Uses Pi's native
openai-completionsprovider path, so tool calls, streaming usage, and context-overflow normalization all work. - Normalizes upstream context-overflow errors through Edgee into Pi's
context_length_exceededsignal.
Two APIs
Edgee exposes two separate APIs. This extension only needs the Gateway API:
- Gateway API (
https://edgee.io) — LLM requests and model listing. Authenticated with ansk-edgee-...API key (EDGEE_API_KEY). Endpoints:/v1/models,/v1/chat/completions,/v1/messages,/v1/responses,/v1/compress,/v1/count_tokens. - Console API (
https://api.edgee.app) — organization management: usage/cost export, gateway API-key management, BYOK. Requires a separateek_live_...Console token and an org id, not the gateway key. Not used by this extension.
Development
pnpm install
pnpm typecheck
pnpm lint
pnpm test
Layout
extensions/provider/: Pi extension entry point.src/edgee/: Edgee model mapping and API helpers.
Notes
Edgee compresses input tokens before they reach the upstream provider, so actual billed cost is usually lower than the cost figures embedded in the model metadata (which reflect upstream list prices from models.dev). Per-request savings are reported in the compression field of Edgee's responses and are not reflected here.