pi-cliproxyapi-provider 0.4.11 → 0.4.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # pi-cliproxyapi-provider
2
2
 
3
- `pi-cliproxyapi-provider` registers one [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) instance as a pi model provider. It discovers models from CLIProxyAPI's OpenAI-compatible `/v1/models` endpoint and enriches them with metadata from [models.dev](https://models.dev/).
3
+ `pi-cliproxyapi-provider` registers one [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) instance as a pi model provider. It discovers models from CLIProxyAPI's OpenAI-compatible `/v1/models` endpoint and enriches them with provider-specific metadata from [models.dev](https://models.dev/). Mixed catalogs use OpenAI Completions by default, while GPT-5.6 family models (including Codex variants) use the Responses API so pi can read their usage data. Canonical `/v1/models` owners such as `openai` select the matching provider metadata; aliases can override that selection when a proxy routes billing differently.
4
4
 
5
5
  ## Install
6
6
 
@@ -72,6 +72,27 @@ CLIPROXYAPI_MODELS_DEV_ENABLED
72
72
 
73
73
  Project config only supports metadata aliases. Connection and auth settings such as `baseUrl`, `providerName`, `authRequired`, `authHeader`, and `headers` must be set in global config or environment variables.
74
74
 
75
+ ### GPT-5.6 context window
76
+
77
+ The provider advertises a `272000`-token context window for GPT-5.6 models by default. This matches Pi's conservative canonical limit, keeps compaction behavior consistent with native model definitions, and avoids assuming that every CLIProxyAPI upstream account or route enables the provider's full long-context limit.
78
+
79
+ To opt into the full context limit reported by models.dev (currently `1050000` tokens for OpenAI GPT-5.6 models), add this package-specific setting to global `~/.pi/agent/settings.json`:
80
+
81
+ ```json
82
+ {
83
+ "pi-cliproxyapi-provider": {
84
+ "gpt56ContextWindow": "full"
85
+ }
86
+ }
87
+ ```
88
+
89
+ The same setting can be placed in project `.pi/settings.json`; project settings override global settings. Supported values are:
90
+
91
+ - `"canonical"` (default): advertise `272000` tokens and compact at Pi's conservative boundary.
92
+ - `"full"`: advertise the models.dev context limit, allowing Pi to retain substantially more history before compaction.
93
+
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. Run `/reload` after changing the setting so Pi rebuilds the provider model catalog.
95
+
75
96
  ## Authenticate
76
97
 
77
98
  Use pi's normal API-key login flow:
@@ -107,6 +128,8 @@ export CLIPROXYAPI_API_KEY=your-key
107
128
 
108
129
  Aliases affect metadata only. The package still sends the original CLIProxyAPI model ID to the proxy.
109
130
 
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.
132
+
110
133
  Add global aliases to:
111
134
 
112
135
  ```text
@@ -124,7 +147,8 @@ Project config only reads `modelAliases`; other fields are ignored.
124
147
  ```json
125
148
  {
126
149
  "modelAliases": {
127
- "claude-opus-4-6-thinking": "anthropic/claude-opus-4-6"
150
+ "claude-opus-4-6-thinking": "anthropic/claude-opus-4-6",
151
+ "gpt-5.6-sol": "openai/gpt-5.6-sol"
128
152
  }
129
153
  }
130
154
  ```