pi-cliproxyapi-provider 0.4.13 → 0.15.0
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 +42 -4
- package/data/models-dev-fallback.json +1 -1
- package/package.json +7 -2
- package/src/catalog.ts +6 -2
- package/src/commands.ts +42 -5
- package/src/config.ts +144 -3
- package/src/matching.ts +82 -6
- package/src/model-ui.ts +353 -0
- package/src/models-dev.ts +6 -1
- package/src/provider.ts +31 -4
- package/src/settings.ts +41 -5
- package/src/types.ts +19 -0
package/README.md
CHANGED
|
@@ -68,9 +68,12 @@ CLIPROXYAPI_PROVIDER_NAME
|
|
|
68
68
|
CLIPROXYAPI_AUTH_REQUIRED
|
|
69
69
|
CLIPROXYAPI_AUTH_HEADER
|
|
70
70
|
CLIPROXYAPI_MODELS_DEV_ENABLED
|
|
71
|
+
CLIPROXYAPI_METADATA_FALLBACK_PROVIDER
|
|
71
72
|
```
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
Set `CLIPROXYAPI_METADATA_FALLBACK_PROVIDER=none` to disable unresolved-model metadata fallback.
|
|
75
|
+
|
|
76
|
+
Project config supports `metadataFallbackProvider`, metadata aliases, and bounded per-model overrides. Set `metadataFallbackProvider` to `null` or `"none"` to disable fallback. Connection and auth settings such as `baseUrl`, `providerName`, `authRequired`, `authHeader`, and `headers` must be set in global config or environment variables.
|
|
74
77
|
|
|
75
78
|
### GPT-5.6 context window
|
|
76
79
|
|
|
@@ -91,7 +94,22 @@ The same setting can be placed in project `.pi/settings.json`; project settings
|
|
|
91
94
|
- `"canonical"` (default): advertise `272000` tokens and compact at Pi's conservative boundary.
|
|
92
95
|
- `"full"`: advertise the models.dev context limit, allowing Pi to retain substantially more history before compaction.
|
|
93
96
|
|
|
94
|
-
Use `"full"` only when the selected CLIProxyAPI route and upstream account actually support that limit. Requests above `272000` input tokens also use the higher models.dev context-pricing tier where one is defined.
|
|
97
|
+
Use `"full"` only when the selected CLIProxyAPI route and upstream account actually support that limit. Requests above `272000` input tokens also use the higher models.dev context-pricing tier where one is defined.
|
|
98
|
+
|
|
99
|
+
### Model and display configuration
|
|
100
|
+
|
|
101
|
+
Run `/cliproxyapi config` in Pi TUI mode to edit every package-level `settings.json` value. The tabbed panel has `Connection`, `Models`, and `Display` sections; it controls the GPT-5.6 context-window mode and whether the model selector shows the published strict tool-schema capability.
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"pi-cliproxyapi-provider": {
|
|
106
|
+
"gpt56ContextWindow": "canonical",
|
|
107
|
+
"showStrictMode": false
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`showStrictMode` defaults to `false` because the selector stays compact for normal use. Enable it when diagnosing tool-schema behavior; model details always show `Strict tool schema` explicitly. Saving through `/cliproxyapi config` reloads Pi. Select `Connection` to open the endpoint and authentication editor.
|
|
95
113
|
|
|
96
114
|
## Authenticate
|
|
97
115
|
|
|
@@ -122,13 +140,16 @@ export CLIPROXYAPI_API_KEY=your-key
|
|
|
122
140
|
/cliproxyapi refresh models # refresh CLIProxyAPI availability only
|
|
123
141
|
/cliproxyapi refresh metadata # refresh models.dev metadata only
|
|
124
142
|
/cliproxyapi aliases # show unmatched model IDs for metadata aliases
|
|
143
|
+
/cliproxyapi models # inspect effective model settings and set bounded overrides
|
|
144
|
+
/cliproxyapi config # tabbed connection, model, and display configuration
|
|
145
|
+
/cliproxyapi config connection # open endpoint and authentication editor
|
|
125
146
|
```
|
|
126
147
|
|
|
127
148
|
## Metadata aliases
|
|
128
149
|
|
|
129
150
|
Aliases affect metadata only. The package still sends the original CLIProxyAPI model ID to the proxy.
|
|
130
151
|
|
|
131
|
-
When `/v1/models` reports a canonical owner such as `openai`, the package uses that provider's metadata even if models.dev lists the model under several providers. Add an alias when CLIProxyAPI's reported owner does not match the provider whose limits and pricing apply to your setup.
|
|
152
|
+
When `/v1/models` reports a canonical owner such as `openai`, the package uses that provider's metadata even if models.dev lists the model under several providers. Noncanonical owners can embed a provider hint, so `feedmob-opencode-go` resolves to `opencode-go` when that provider publishes the model. If ownership is still unresolved, the package uses OpenRouter metadata by default when there is exactly one matching OpenRouter entry. Set `metadataFallbackProvider` to another models.dev provider ID, or to `null`/`"none"` to disable this fallback. Legacy metadata caches without source-provider identity are ignored in favor of the bundled provider-qualified catalog until metadata is refreshed. Add an alias when CLIProxyAPI's reported owner or fallback does not match the provider whose limits and pricing apply to your setup.
|
|
132
153
|
|
|
133
154
|
Add global aliases to:
|
|
134
155
|
|
|
@@ -142,17 +163,34 @@ Add project aliases manually to:
|
|
|
142
163
|
.pi/pi-cliproxyapi-provider/config.json
|
|
143
164
|
```
|
|
144
165
|
|
|
145
|
-
Project config
|
|
166
|
+
Project config reads `metadataFallbackProvider`, `modelAliases`, and `modelOverrides`; other fields are ignored.
|
|
146
167
|
|
|
147
168
|
```json
|
|
148
169
|
{
|
|
170
|
+
"metadataFallbackProvider": "openrouter",
|
|
149
171
|
"modelAliases": {
|
|
150
172
|
"claude-opus-4-6-thinking": "anthropic/claude-opus-4-6",
|
|
151
173
|
"gpt-5.6-sol": "openai/gpt-5.6-sol"
|
|
174
|
+
},
|
|
175
|
+
"modelOverrides": {
|
|
176
|
+
"gpt-5.6-sol": {
|
|
177
|
+
"contextWindow": 512000,
|
|
178
|
+
"maxTokens": 32768
|
|
179
|
+
}
|
|
152
180
|
}
|
|
153
181
|
}
|
|
154
182
|
```
|
|
155
183
|
|
|
184
|
+
## Model inspector and overrides
|
|
185
|
+
|
|
186
|
+
Run `/cliproxyapi models` in Pi TUI mode to inspect the models in the current CPA snapshot. The selector shows the effective API, reasoning mode, and context window. The detail view also shows input modalities, cost, thinking levels, and the compatibility values that Pi will publish.
|
|
187
|
+
|
|
188
|
+
Only `reasoning`, `contextWindow`, and `maxTokens` are editable. Values are constrained to safe presets; choose `auto` to remove an override and restore the derived value after reload. API routing and compatibility stay provider-owned: GPT-5.6/Codex models remain on `openai-responses`, while the CLIProxyAPI workaround publishes `supportsStrictMode: false`.
|
|
189
|
+
|
|
190
|
+
For CPA Responses requests, the extension also applies the Codex-compatible function-tool wire contract used by `pi-codex-conversion`: each function tool explicitly carries `strict: null`. This preserves optional tool arguments such as `interactive_shell.listBackground` without replacing CPA authentication, transport, discovery, or streaming with the ChatGPT-backed `openai-codex-responses` provider.
|
|
191
|
+
|
|
192
|
+
Saving writes to an existing project config when present, otherwise to the global provider config, then reloads Pi. Project overrides take precedence over global overrides field by field.
|
|
193
|
+
|
|
156
194
|
## Snapshots and startup
|
|
157
195
|
|
|
158
196
|
```text
|