@billjr99/pi-openai-compat 1.1.16 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -23
- package/index.ts +11 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,23 +59,25 @@ If pi is already running when you install, type `/reload` first.
|
|
|
59
59
|
| **llmproxy** | `http://localhost:8080/v1` (editable) | Keyless by default; bearer token if your instance requires one |
|
|
60
60
|
| **Custom** | Any URL you supply | Optional bearer token |
|
|
61
61
|
|
|
62
|
-
> **
|
|
63
|
-
>
|
|
64
|
-
>
|
|
65
|
-
>
|
|
66
|
-
>
|
|
67
|
-
>
|
|
68
|
-
> `
|
|
69
|
-
>
|
|
70
|
-
> `
|
|
71
|
-
>
|
|
62
|
+
> **The `__` → `/` model-id rewrite (display compatibility).**
|
|
63
|
+
> Some providers advertise model ids in a `provider__model` form. For example,
|
|
64
|
+
> [llmproxy](https://github.com/BillJr99/llmproxy) exposes ids like
|
|
65
|
+
> `openrouter__gpt-4` and virtual models such as `llmproxy__free` and
|
|
66
|
+
> `llmproxy__loadbalanced`. The extension can optionally rewrite the first `__`
|
|
67
|
+
> of each id to `/` (e.g. `openrouter__gpt-4` → `openrouter/gpt-4`,
|
|
68
|
+
> `llmproxy__free` → `llmproxy/free`) before registering with pi, so the ids
|
|
69
|
+
> display in the more familiar `provider/model` slash form. Upstreams that use
|
|
70
|
+
> the `__` convention canonicalize the slash form back to `__` on each request,
|
|
71
|
+
> so routing still works.
|
|
72
72
|
>
|
|
73
|
-
>
|
|
74
|
-
> **false**)
|
|
75
|
-
>
|
|
76
|
-
>
|
|
77
|
-
> provider
|
|
78
|
-
>
|
|
73
|
+
> This is a presentation-only convenience controlled by a per-provider config
|
|
74
|
+
> field (`rewriteDoubleUnderscore`, default **false**). It is enabled
|
|
75
|
+
> automatically for the llmproxy template purely for display consistency — other
|
|
76
|
+
> providers are unaffected, and you can turn it on or off freely. If you added a
|
|
77
|
+
> provider as a **Custom** endpoint and want the slash-form display, set
|
|
78
|
+
> `"rewriteDoubleUnderscore": true` on that provider in
|
|
79
|
+
> `~/.config/pi-openai-compat/config.json` (or re-run `/compat-login` and pick a
|
|
80
|
+
> template that enables it). Leaving it off keeps the original `__` ids.
|
|
79
81
|
|
|
80
82
|
> **Providers whose model catalog lives at a non-standard `/models` path (as of June 2026)**
|
|
81
83
|
> Some providers don't return models at `<base_url>/models`. The extension
|
|
@@ -347,13 +349,13 @@ For OpenRouter: some keys are restricted to free-tier models only.
|
|
|
347
349
|
For NIM: confirm your account has inference access enabled.
|
|
348
350
|
|
|
349
351
|
**`/compat-login` reports N models but far fewer appear in `/model`**
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
352
|
+
The usual cause is a **scoped or restricted API key/account** — the catalog
|
|
353
|
+
endpoint advertises the full model list, but your credentials are only entitled
|
|
354
|
+
to a subset, so pi only surfaces the ones you can actually use. Check whether your
|
|
355
|
+
key is limited to specific models or a free tier on the provider's dashboard.
|
|
356
|
+
(This is unrelated to the `__` → `/` rewrite, which is a display-only convenience —
|
|
357
|
+
see the note in **Supported providers** above. Toggling `rewriteDoubleUnderscore`
|
|
358
|
+
only changes how ids are displayed, not how many appear.)
|
|
357
359
|
|
|
358
360
|
**Models appear in `/model` but requests fail**
|
|
359
361
|
Check `/compat-login` ran successfully (no error message).
|
package/index.ts
CHANGED
|
@@ -49,11 +49,11 @@ interface ProviderConfig {
|
|
|
49
49
|
// only once rather than on every session_start while the config stays stale.
|
|
50
50
|
staleNotified?: boolean;
|
|
51
51
|
// When true, rewrite the FIRST "__" of every model id to "/" before
|
|
52
|
-
// registering with pi
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
// request
|
|
56
|
-
// the wizard turns it on only for the llmproxy template.
|
|
52
|
+
// registering with pi, so ids from providers that use a "provider__model"
|
|
53
|
+
// convention (e.g. llmproxy) display in the more familiar "provider/model"
|
|
54
|
+
// slash form. This is a display-only convenience: such upstreams canonicalize
|
|
55
|
+
// the slash form back to "__" on each request, so requests still round-trip.
|
|
56
|
+
// Defaults false; the wizard turns it on only for the llmproxy template.
|
|
57
57
|
rewriteDoubleUnderscore?: boolean;
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -105,9 +105,10 @@ const TEMPLATES: Record<string, {
|
|
|
105
105
|
/** Keep only models whose task.name matches this string (case-insensitive). */
|
|
106
106
|
modelsKeepTask?: string;
|
|
107
107
|
/**
|
|
108
|
-
* Rewrite the first "__" of each model id to "/" before registering with pi
|
|
109
|
-
*
|
|
110
|
-
*
|
|
108
|
+
* Rewrite the first "__" of each model id to "/" before registering with pi,
|
|
109
|
+
* for display compatibility — ids from "provider__model" upstreams (e.g.
|
|
110
|
+
* llmproxy) then show in the familiar "provider/model" slash form. Display-only;
|
|
111
|
+
* default false; set true where you want the slash-form presentation.
|
|
111
112
|
*/
|
|
112
113
|
rewriteDoubleUnderscore?: boolean;
|
|
113
114
|
}> = {
|
|
@@ -302,8 +303,8 @@ const TEMPLATES: Record<string, {
|
|
|
302
303
|
keyless: true,
|
|
303
304
|
promptUrl: true,
|
|
304
305
|
// llmproxy advertises "provider__model" ids (and virtuals like
|
|
305
|
-
// "llmproxy__free").
|
|
306
|
-
//
|
|
306
|
+
// "llmproxy__free"). Rewrite the first "__" to "/" here so they display in
|
|
307
|
+
// the familiar slash form; llmproxy canonicalizes it back on requests.
|
|
307
308
|
rewriteDoubleUnderscore: true,
|
|
308
309
|
},
|
|
309
310
|
vercel: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@billjr99/pi-openai-compat",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
4
4
|
"description": "pi-coding-agent extension: OpenAI-compatible endpoint support (OpenRouter, NVIDIA NIM, Nous Portal, Ollama, custom)",
|
|
5
5
|
"author": "Bill Mongan <https://github.com/BillJr99>",
|
|
6
6
|
"license": "MIT",
|