@senomas/proxy-provider
v0.1.1
Published
A [pi-coding-agent](https://github.com/earendil-works/pi-coding-agent) extension that registers a **deepseek** provider via a configurable AI proxy.
Readme
@senomas/proxy-provider
A pi-coding-agent extension that registers a deepseek provider via a configurable AI proxy.
What it does
This package extends pi with a provider named "deepseek". On every session:
- Walks up from the current directory looking for
.pi-project.json - Reads the
projectandproxyfields from that file - Fetches model definitions from
${proxy}/static/providers/deepseek.json - Registers the provider with the proxy as
baseUrland the project name as theAI-Proxy-Projectheader
Prerequisites
- Node.js 18+ (for global
fetch) - pi-coding-agent installed (
npm install -g @earendil-works/pi-coding-agent)
Installation
pi install npm:@senomas/proxy-providerConfiguration
Create a .pi-project.json file in your project root:
{
"project": "my-project",
"proxy": "https://deepseek-proxy-dev.senomas.com"
}| Field | Type | Description |
|-------|------|-------------|
| project | string | Project name sent as the AI-Proxy-Project header |
| proxy | string | Base URL of the AI proxy server |
Verification
After installation, list available models to confirm the provider is registered:
pi --list-models | grep deepseekYou should see the deepseek models exposed by your proxy.
How it works
The extension exports an async default function that:
- Uses
fs.existsSyncandfs.readFileSync(Node built-ins) to find and parse.pi-project.json - Calls
fetch()to retrieve provider metadata from the proxy - Calls
pi.registerProvider("deepseek", config)with the fetched models, proxybaseUrl, andAI-Proxy-Projectheader
License
MIT
