@astralyn/pi 0.82.7 → 0.83.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +34 -5099
  2. package/README.md +12 -111
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +9 -2
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/credential-print.d.ts +23 -0
  7. package/dist/cli/credential-print.d.ts.map +1 -0
  8. package/dist/cli/credential-print.js +116 -0
  9. package/dist/cli/credential-print.js.map +1 -0
  10. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  11. package/dist/core/agent-session-runtime.js +3 -0
  12. package/dist/core/agent-session-runtime.js.map +1 -1
  13. package/dist/core/agent-session.d.ts +1 -1
  14. package/dist/core/agent-session.d.ts.map +1 -1
  15. package/dist/core/agent-session.js +13 -6
  16. package/dist/core/agent-session.js.map +1 -1
  17. package/dist/core/extensions/runner.d.ts +1 -0
  18. package/dist/core/extensions/runner.d.ts.map +1 -1
  19. package/dist/core/extensions/runner.js +7 -0
  20. package/dist/core/extensions/runner.js.map +1 -1
  21. package/dist/core/extensions/types.d.ts +7 -0
  22. package/dist/core/extensions/types.d.ts.map +1 -1
  23. package/dist/core/extensions/types.js.map +1 -1
  24. package/dist/core/footer-data-provider.d.ts +10 -0
  25. package/dist/core/footer-data-provider.d.ts.map +1 -1
  26. package/dist/core/footer-data-provider.js +1 -1
  27. package/dist/core/footer-data-provider.js.map +1 -1
  28. package/dist/core/model-runtime.d.ts +2 -0
  29. package/dist/core/model-runtime.d.ts.map +1 -1
  30. package/dist/core/model-runtime.js.map +1 -1
  31. package/dist/core/package-manager.d.ts.map +1 -1
  32. package/dist/core/package-manager.js +13 -6
  33. package/dist/core/package-manager.js.map +1 -1
  34. package/dist/core/resource-loader.d.ts +15 -0
  35. package/dist/core/resource-loader.d.ts.map +1 -1
  36. package/dist/core/resource-loader.js +70 -9
  37. package/dist/core/resource-loader.js.map +1 -1
  38. package/dist/core/tools/find.d.ts.map +1 -1
  39. package/dist/core/tools/find.js +34 -4
  40. package/dist/core/tools/find.js.map +1 -1
  41. package/dist/core/trust-manager.d.ts.map +1 -1
  42. package/dist/core/trust-manager.js +48 -9
  43. package/dist/core/trust-manager.js.map +1 -1
  44. package/dist/extensions/index.d.ts.map +1 -1
  45. package/dist/extensions/index.js +0 -2
  46. package/dist/extensions/index.js.map +1 -1
  47. package/dist/extensions/llama/provider.d.ts.map +1 -1
  48. package/dist/extensions/llama/provider.js +1 -1
  49. package/dist/extensions/llama/provider.js.map +1 -1
  50. package/dist/main.d.ts.map +1 -1
  51. package/dist/main.js +43 -0
  52. package/dist/main.js.map +1 -1
  53. package/dist/modes/interactive/components/extension-selector.d.ts +1 -1
  54. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  55. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  56. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  57. package/dist/modes/interactive/components/model-selector.js +4 -1
  58. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  59. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  60. package/dist/modes/interactive/external-editor.js +40 -3
  61. package/dist/modes/interactive/external-editor.js.map +1 -1
  62. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  63. package/dist/modes/interactive/interactive-mode.js +20 -6
  64. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  65. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  66. package/dist/modes/rpc/rpc-mode.js +13 -0
  67. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  68. package/dist/utils/paths.d.ts +2 -3
  69. package/dist/utils/paths.d.ts.map +1 -1
  70. package/dist/utils/paths.js +2 -3
  71. package/dist/utils/paths.js.map +1 -1
  72. package/docs/bundled/README.md +13 -16
  73. package/docs/bundled/themes.md +1 -1
  74. package/docs/compaction.md +25 -30
  75. package/docs/custom-provider.md +298 -583
  76. package/docs/docs.json +0 -8
  77. package/docs/extensions.md +112 -116
  78. package/docs/index.md +18 -74
  79. package/docs/json.md +20 -14
  80. package/docs/models.md +193 -151
  81. package/docs/providers.md +2 -1
  82. package/docs/quickstart.md +3 -3
  83. package/docs/rpc.md +165 -123
  84. package/docs/sdk.md +119 -178
  85. package/docs/security.md +1 -1
  86. package/docs/session-format.md +139 -119
  87. package/docs/skills.md +0 -1
  88. package/docs/themes.md +2 -2
  89. package/docs/tui.md +411 -549
  90. package/docs/usage.md +3 -11
  91. package/examples/README.md +6 -1
  92. package/examples/extensions/README.md +13 -33
  93. package/examples/extensions/custom-provider-anthropic/index.ts +9 -3
  94. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  95. package/examples/extensions/truncated-tool.ts +2 -2
  96. package/examples/sdk/12-full-control.ts +2 -0
  97. package/npm-shrinkwrap.json +21 -21
  98. package/package.json +5 -5
  99. package/dist/extensions/plan/constants.d.ts +0 -68
  100. package/dist/extensions/plan/constants.d.ts.map +0 -1
  101. package/dist/extensions/plan/constants.js +0 -100
  102. package/dist/extensions/plan/constants.js.map +0 -1
  103. package/dist/extensions/plan/index.d.ts +0 -30
  104. package/dist/extensions/plan/index.d.ts.map +0 -1
  105. package/dist/extensions/plan/index.js +0 -429
  106. package/dist/extensions/plan/index.js.map +0 -1
  107. package/dist/extensions/plan/schema.d.ts +0 -20
  108. package/dist/extensions/plan/schema.d.ts.map +0 -1
  109. package/dist/extensions/plan/schema.js +0 -13
  110. package/dist/extensions/plan/schema.js.map +0 -1
  111. package/dist/extensions/plan/state.d.ts +0 -38
  112. package/dist/extensions/plan/state.d.ts.map +0 -1
  113. package/dist/extensions/plan/state.js +0 -96
  114. package/dist/extensions/plan/state.js.map +0 -1
  115. package/dist/extensions/plan/storage.d.ts +0 -26
  116. package/dist/extensions/plan/storage.d.ts.map +0 -1
  117. package/dist/extensions/plan/storage.js +0 -83
  118. package/dist/extensions/plan/storage.js.map +0 -1
  119. package/dist/extensions/plan/view.d.ts +0 -44
  120. package/dist/extensions/plan/view.d.ts.map +0 -1
  121. package/dist/extensions/plan/view.js +0 -149
  122. package/dist/extensions/plan/view.js.map +0 -1
  123. package/docs/bundled/extensions/README.md +0 -19
  124. package/docs/bundled/extensions/plan.md +0 -34
  125. package/examples/extensions/plan-mode/README.md +0 -66
  126. package/examples/extensions/plan-mode/index.ts +0 -390
  127. package/examples/extensions/plan-mode/utils.ts +0 -168
package/docs/models.md CHANGED
@@ -1,22 +1,31 @@
1
1
  # Custom Models
2
2
 
3
- Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.pi/agent/models.json`.
3
+ Use `~/.pi/agent/models.json` to add static providers and models, such as Ollama, vLLM, LM Studio, and compatible proxies. For a provider that needs OAuth, dynamic discovery, request rewriting, or a protocol Pi AI does not implement, use an [extension](custom-provider.md) instead.
4
+
5
+ Pi reads this file at startup and on a model refresh, including when you open `/model`; restart is not required. It is a configuration overlay, not a discovered catalog stored in `models-store.json`.
4
6
 
5
7
  ## Table of Contents
6
8
 
7
9
  - [Minimal Example](#minimal-example)
8
10
  - [Full Example](#full-example)
9
- - [Supported APIs](#supported-apis)
11
+ - [Google Generative AI Example](#google-generative-ai-example)
12
+ - [API Tags](#api-tags)
10
13
  - [Provider Configuration](#provider-configuration)
14
+ - [Value Resolution](#value-resolution)
15
+ - [Custom Headers](#custom-headers)
11
16
  - [Model Configuration](#model-configuration)
17
+ - [Thinking Level Map](#thinking-level-map)
12
18
  - [Overriding Built-in Providers](#overriding-built-in-providers)
13
19
  - [Per-model Overrides](#per-model-overrides)
14
- - [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
15
- - [OpenAI Compatibility](#openai-compatibility)
20
+ - [Compatibility Options](#compatibility-options)
21
+ - [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
22
+ - [OpenAI Compatibility](#openai-compatibility)
23
+ - [OpenAI Chat Completions](#openai-chat-completions)
24
+ - [OpenAI Responses](#openai-responses)
16
25
 
17
26
  ## Minimal Example
18
27
 
19
- For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
28
+ For local OpenAI-compatible servers such as Ollama, LM Studio, and vLLM, each model needs only an `id` when the provider supplies the endpoint and API tag:
20
29
 
21
30
  ```json
22
31
  {
@@ -34,11 +43,9 @@ For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
34
43
  }
35
44
  ```
36
45
 
37
- The `apiKey` value is a placeholder because Ollama ignores it. pi still treats models as requiring auth before they appear in `/model`, so keyless local servers should keep a dummy value, save a key for that provider with `/login`, or pass `--api-key` when selecting the model.
38
-
39
- Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so pi sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
46
+ `"ollama"` is a literal placeholder: Ollama ignores it, while Pi uses its presence to mark the provider as configured so its models appear in `/model`. A keyless server can instead use a saved key from `/login` or a CLI `--api-key` supplied with an explicit model selection.
40
47
 
41
- You can set `compat` at the provider level to apply to all models, or at the model level to override a specific model. This commonly applies to Ollama, vLLM, SGLang, and similar OpenAI-compatible servers.
48
+ Some OpenAI-compatible servers do not understand the `developer` role Pi uses for reasoning models, or `reasoning_effort`. Set the corresponding compatibility flags when necessary:
42
49
 
43
50
  ```json
44
51
  {
@@ -62,9 +69,11 @@ You can set `compat` at the provider level to apply to all models, or at the mod
62
69
  }
63
70
  ```
64
71
 
72
+ Provider `compat` supplies defaults for its models; a model's `compat` refines those defaults. See [Compatibility Options](#compatibility-options).
73
+
65
74
  ## Full Example
66
75
 
67
- Override defaults when you need specific values:
76
+ Override defaults when you need specific metadata:
68
77
 
69
78
  ```json
70
79
  {
@@ -89,11 +98,9 @@ Override defaults when you need specific values:
89
98
  }
90
99
  ```
91
100
 
92
- The file reloads each time you open `/model`. Edit during session; no restart needed.
101
+ ## Google Generative AI Example
93
102
 
94
- ## Google AI Studio Example
95
-
96
- Use `google-generative-ai` with a `baseUrl` to add models from Google AI Studio, including custom Gemma 4 entries:
103
+ Use `google-generative-ai` with a base URL for a new Google Generative AI-compatible provider:
97
104
 
98
105
  ```json
99
106
  {
@@ -116,67 +123,84 @@ Use `google-generative-ai` with a `baseUrl` to add models from Google AI Studio,
116
123
  }
117
124
  ```
118
125
 
119
- The `baseUrl` is required when adding custom models to the `google-generative-ai` API type.
126
+ The `baseUrl` is required here because `my-google` has no existing catalog model to supply one. It is not a special requirement of `google-generative-ai`: a model can also declare its own `baseUrl`.
127
+
128
+ ## API Tags
120
129
 
121
- ## Supported APIs
130
+ `api` is a nonempty string. Pi AI provides these built-in tags; the endpoint and authentication requirements still depend on the selected API and provider.
122
131
 
123
- | API | Description |
124
- |-----|-------------|
125
- | `openai-completions` | OpenAI Chat Completions (most compatible) |
126
- | `openai-responses` | OpenAI Responses API |
127
- | `anthropic-messages` | Anthropic Messages API |
132
+ | API tag | Protocol |
133
+ | --- | --- |
134
+ | `anthropic-messages` | Anthropic Messages |
135
+ | `openai-completions` | OpenAI Chat Completions |
136
+ | `openai-responses` | OpenAI Responses |
137
+ | `azure-openai-responses` | Azure OpenAI Responses |
138
+ | `openai-codex-responses` | OpenAI Codex Responses |
139
+ | `mistral-conversations` | Mistral Conversations |
128
140
  | `google-generative-ai` | Google Generative AI |
141
+ | `google-vertex` | Google Vertex AI |
142
+ | `bedrock-converse-stream` | Amazon Bedrock Converse Stream |
143
+ | `pi-messages` | Pi Messages, including Radius gateways |
144
+
145
+ See [Custom Providers: API and Model Configuration](custom-provider.md#api-and-model-configuration) for when to use each tag and an extension-owned custom API. An extension can register a custom API tag; `models.json` alone cannot implement an arbitrary protocol.
129
146
 
130
- Set `api` at provider level (default for all models) or model level (override per model).
147
+ At provider level, `api` is the default for entries in that provider's `models` array. A model's `api` takes precedence. It does **not** change the API tag of an existing built-in or extension model; replace that model with a `models` entry using the same `id` if it must use another API.
131
148
 
132
149
  ## Provider Configuration
133
150
 
151
+ Each key in `providers` is the provider ID used by `/model`, `--provider`, saved credentials, and model references.
152
+
134
153
  | Field | Description |
135
- |-------|-------------|
136
- | `baseUrl` | API endpoint URL |
137
- | `api` | API type (see above) |
138
- | `apiKey` | Optional API key config (see value resolution below). Omit it when auth is provided by `/login`/`auth.json` or CLI `--api-key`. |
139
- | `oauth` | Dynamic OAuth provider type. Currently supports `"radius"`; requires the gateway `baseUrl`. |
140
- | `headers` | Custom headers (see value resolution below) |
141
- | `authHeader` | Set `true` to add `Authorization: Bearer <apiKey>` automatically |
142
- | `models` | Array of model configurations |
143
- | `modelOverrides` | Per-model overrides for built-in or extension-registered models on this provider |
144
-
145
- For providers with `models`, non-built-in provider configs need `baseUrl` and an `api` value at either provider or model level. `apiKey` is not required to load the file: models become available when auth is configured through `/login`/`auth.json`, CLI `--api-key`, or provider `apiKey`. If no auth is configured, the models load but stay unavailable in `/model` and `--list-models`.
154
+ | --- | --- |
155
+ | `name` | Optional display name for the provider. Defaults to its ID. |
156
+ | `baseUrl` | Default endpoint for this provider's models. A new provider normally needs this for its first custom model; a model may override it. |
157
+ | `api` | Default [API tag](#api-tags) for entries in `models`. |
158
+ | `apiKey` | Optional fallback API-key value; see [Value Resolution](#value-resolution) and [credential resolution](providers.md#resolution-order). |
159
+ | `oauth` | Dynamic OAuth provider type. `"radius"` is the only supported value and requires a Radius gateway `baseUrl`; see [Providers: Radius](providers.md#radius). |
160
+ | `headers` | Request headers for every model on the provider; see [Custom Headers](#custom-headers). |
161
+ | `authHeader` | Adds `Authorization: Bearer <resolved apiKey>` after resolving authentication. |
162
+ | `compat` | Compatibility defaults merged into the provider's models; see [Compatibility Options](#compatibility-options). |
163
+ | `models` | Custom model definitions. On a built-in provider they are added or replaced by `id`; other catalog models remain. |
164
+ | `modelOverrides` | Partial changes for matching final models, including built-in and extension-registered models; see [Per-model Overrides](#per-model-overrides). |
165
+
166
+ A custom model needs an effective `baseUrl` and `api`. For a new provider, put both on the provider (the usual approach) or on its first model. On a built-in provider, a model that replaces an existing ID can fall back to that catalog model's endpoint and API. `contextWindow` and `maxTokens`, when supplied in a `models` entry, must be positive.
167
+
168
+ `apiKey` is not required to parse the file. A provider becomes available when it has a CLI `--api-key`, saved `/login` credential, applicable environment credential, or configured `apiKey`. Without configured authentication, its models remain unavailable in `/model` and `--list-models`.
146
169
 
147
170
  ### Value Resolution
148
171
 
149
- The `apiKey` and `headers` fields support command execution, environment interpolation, and literals:
172
+ `apiKey` and every configured header value support shell commands, environment interpolation, and literals:
150
173
 
151
- - **Shell command:** `"!command"` at the start executes the whole value as a command and uses stdout
174
+ - **Shell command:** a value beginning with `!` runs the rest of the value as a shell command and uses trimmed stdout.
152
175
  ```json
153
176
  "apiKey": "!security find-generic-password -ws 'anthropic'"
154
177
  "apiKey": "!op read 'op://vault/item/credential'"
155
178
  ```
156
- - **Environment interpolation:** `"$ENV_VAR"` or `"${ENV_VAR}"` uses the value of the named variable. Interpolation works inside larger literals.
179
+ - **Environment interpolation:** `$ENV_VAR` and `${ENV_VAR}` interpolate a variable; interpolation also works inside larger literals.
157
180
  ```json
158
181
  "apiKey": "$MY_API_KEY"
159
182
  "apiKey": "${KEY_PREFIX}_${KEY_SUFFIX}"
160
183
  ```
161
- `$FOO_BAR` is the variable `FOO_BAR`; use `${FOO}_BAR` when `BAR` is literal text. Missing environment variables make the value unresolved.
162
- - **Escapes:** `"$$"` emits a literal `"$"`; `"$!"` emits a literal `"!"` without triggering command execution.
184
+ `$FOO_BAR` means the variable `FOO_BAR`; use `${FOO}_BAR` when `_BAR` is literal text. Missing variables leave the value unresolved.
185
+ - **Escapes:** `$$` emits a literal `$`; `$!` emits a literal `!` without turning the value into a command.
163
186
  ```json
164
187
  "apiKey": "$$literal-dollar-prefix"
165
188
  "apiKey": "$!literal-bang-prefix"
166
189
  ```
167
- - **Literal value:** Used directly. Plain uppercase strings such as `MY_API_KEY` are literals; use `$MY_API_KEY` for environment variables.
190
+ - **Literal:** any other text is used as-is. Uppercase strings are not inferred as environment variables.
168
191
  ```json
169
192
  "apiKey": "sk-..."
193
+ "apiKey": "MY_API_KEY"
170
194
  ```
171
195
 
172
- For `models.json`, shell commands are resolved at request time. pi intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and pi cannot infer the right one.
173
-
174
- If your command is slow, expensive, rate-limited, or should keep using a previous value on transient failures, wrap it in your own script or command that implements the caching or TTL behavior you want.
196
+ When a `models.json` value is used, it is resolved for every request. In particular, commands are not cached, reused after a failure, or given a built-in TTL; implement any required caching or fallback in your command or script. A failed command or unresolved header/environment reference fails that request. `/model` availability checks do not execute commands.
175
197
 
176
- `/model` availability checks use configured auth presence and do not execute shell commands.
198
+ Provider-scoped `env` values saved with an API-key credential in `auth.json` take precedence over the process environment during this resolution. See [Providers: Auth File](providers.md#auth-file).
177
199
 
178
200
  ### Custom Headers
179
201
 
202
+ `headers` can be set on a provider, a `models` entry, or a `modelOverrides` entry:
203
+
180
204
  ```json
181
205
  {
182
206
  "providers": {
@@ -188,28 +212,45 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
188
212
  "x-portkey-api-key": "$PORTKEY_API_KEY",
189
213
  "x-secret": "!op read 'op://vault/item/secret'"
190
214
  },
191
- "models": [...]
215
+ "models": [
216
+ {
217
+ "id": "proxy-model",
218
+ "headers": {
219
+ "x-model-route": "fast"
220
+ }
221
+ }
222
+ ]
192
223
  }
193
224
  }
194
225
  }
195
226
  ```
196
227
 
228
+ Provider headers apply to every request. A configured model header overrides the same provider header case-insensitively. If both a `models` entry and `modelOverrides` configure the same header for one model, the `models` entry wins; a model header from a named extension provider registration wins over both. Pi AI and built-in providers can add their own headers; configured model headers are merged last.
229
+
230
+ `models.json` header values must be strings. Unlike the public Pi AI request-header type, `null` cannot remove a built-in header here; use the [`before_provider_headers` extension hook](extensions.md#before_provider_headers) when a request must remove or rewrite headers. `authHeader` requires a resolved API key and adds its bearer header before model-specific headers are merged.
231
+
197
232
  ## Model Configuration
198
233
 
234
+ A `models` entry supplies a complete custom model definition with useful defaults. A model matching a built-in ID replaces that catalog entry rather than partially modifying it; use [`modelOverrides`](#per-model-overrides) for partial changes.
235
+
199
236
  | Field | Required | Default | Description |
200
- |-------|----------|---------|-------------|
201
- | `id` | Yes | — | Model identifier (passed to the API) |
202
- | `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown as secondary model detail text. |
203
- | `api` | No | provider's `api` | Override provider's API for this model |
204
- | `reasoning` | No | `false` | Supports extended thinking |
205
- | `thinkingLevelMap` | No | omitted | Maps pi thinking levels to provider values and marks unsupported levels (see below) |
206
- | `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
207
- | `contextWindow` | No | `128000` | Context window size in tokens |
208
- | `maxTokens` | No | `16384` | Maximum output tokens |
209
- | `cost` | No | all zeros | Per-million-token rates with optional request-wide input pricing tiers |
210
- | `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
211
-
212
- A cost tier supplies a complete alternate rate set and applies to the full request when total input usage (`input + cacheRead + cacheWrite`) exceeds `inputTokensAbove`. When multiple tiers match, the highest threshold wins.
237
+ | --- | --- | --- | --- |
238
+ | `id` | Yes | — | Model identifier sent to the API. |
239
+ | `name` | No | `id` | Human-readable label. It is searchable by `--model` patterns and shown as model detail text. |
240
+ | `api` | No | Provider `api` | [API tag](#api-tags) for this model. |
241
+ | `baseUrl` | No | Provider `baseUrl` | Endpoint override for this model. |
242
+ | `reasoning` | No | `false` | Whether the model supports Pi thinking levels. |
243
+ | `thinkingLevelMap` | No | omitted | Maps Pi thinking levels to provider values and declares unsupported levels; see below. |
244
+ | `input` | No | `["text"]` | Supported input kinds: `text` and `image`. |
245
+ | `contextWindow` | No | `128000` | Context window in tokens. |
246
+ | `maxTokens` | No | `16384` | Maximum generated tokens. |
247
+ | `cost` | No | all rates `0` | Per-million-token rates and optional request-wide price tiers. |
248
+ | `headers` | No | omitted | Model-specific request headers; see [Custom Headers](#custom-headers). |
249
+ | `compat` | No | provider `compat` | Compatibility refinements merged with provider defaults. |
250
+
251
+ `/model`, `--list-models`, and the footer show a model's `id`; `name` does not replace it. The model selector and `--model` pattern matching also search `name`.
252
+
253
+ When `cost` is supplied on a `models` entry, it must contain all four base rates: `input`, `output`, `cacheRead`, and `cacheWrite`. Rates are per million tokens. Each tier likewise supplies all four rates and an `inputTokensAbove` threshold. A matching tier prices the entire request; Pi uses the tier with the highest threshold strictly below total input usage (`input + cacheRead + cacheWrite`).
213
254
 
214
255
  ```json
215
256
  {
@@ -231,23 +272,17 @@ A cost tier supplies a complete alternate rate set and applies to the full reque
231
272
  }
232
273
  ```
233
274
 
234
- Current behavior:
235
- - `/model`, `--list-models`, and the interactive footer display entries by model `id`.
236
- - The configured `name` is used for model matching and secondary model detail text. It does not replace the footer/status-bar model id.
237
-
238
275
  ### Thinking Level Map
239
276
 
240
- Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are pi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. Maps may contain holes; for example, a model can expose `high` and `max` without exposing `xhigh`.
241
-
242
- Values are tristate:
277
+ `thinkingLevelMap` uses these Pi levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. It only affects a model with `reasoning: true`; a non-reasoning model exposes `off` only.
243
278
 
244
- | Value | Meaning |
245
- |-------|---------|
246
- | omitted | Standard levels through `high` use the provider's default mapping; extended `xhigh` and `max` levels are unsupported |
247
- | string | Level is supported and this value is sent to the provider |
248
- | `null` | Level is unsupported and hidden/skipped/clamped away |
279
+ | Map value for a level | Effect |
280
+ | --- | --- |
281
+ | omitted | `off` through `high` remain supported with the API's default mapping. `xhigh` and `max` are unsupported unless they have a string mapping. |
282
+ | string | The level is supported and this value is sent to the provider. |
283
+ | `null` | The level is unsupported and hidden from the selector. |
249
284
 
250
- Example for a model that only supports off, high, and max reasoning:
285
+ Maps may contain holes. If a requested level is unavailable, Pi clamps to the next available higher level, then to the nearest lower one. For example, this model exposes `off`, `high`, and `max`:
251
286
 
252
287
  ```json
253
288
  {
@@ -264,7 +299,7 @@ Example for a model that only supports off, high, and max reasoning:
264
299
  }
265
300
  ```
266
301
 
267
- Example for a model where thinking cannot be disabled:
302
+ For a model that cannot disable thinking, mark `off` unsupported:
268
303
 
269
304
  ```json
270
305
  {
@@ -276,11 +311,9 @@ Example for a model where thinking cannot be disabled:
276
311
  }
277
312
  ```
278
313
 
279
- Migration: older configs that used `compat.reasoningEffortMap` should move that mapping to model-level `thinkingLevelMap`. Use `null` for levels that should not appear in the UI.
280
-
281
314
  ## Overriding Built-in Providers
282
315
 
283
- Route a built-in provider through a proxy without redefining models:
316
+ Change a built-in provider's endpoint without redefining its models:
284
317
 
285
318
  ```json
286
319
  {
@@ -292,9 +325,9 @@ Route a built-in provider through a proxy without redefining models:
292
325
  }
293
326
  ```
294
327
 
295
- All built-in Anthropic models remain available. Existing OAuth or API key auth continues to work.
328
+ The built-in Anthropic catalog and its normal authentication remain in place. Credential precedence, including a configured `apiKey` fallback, is described in [Providers: Resolution Order](providers.md#resolution-order).
296
329
 
297
- To merge custom models into a built-in provider, include the `models` array:
330
+ To add models to a built-in provider, include `models`:
298
331
 
299
332
  ```json
300
333
  {
@@ -303,21 +336,19 @@ To merge custom models into a built-in provider, include the `models` array:
303
336
  "baseUrl": "https://my-proxy.example.com/v1",
304
337
  "apiKey": "$ANTHROPIC_API_KEY",
305
338
  "api": "anthropic-messages",
306
- "models": [...]
339
+ "models": [
340
+ { "id": "my-claude-alias", "reasoning": true }
341
+ ]
307
342
  }
308
343
  }
309
344
  }
310
345
  ```
311
346
 
312
- Merge semantics:
313
- - Built-in models are kept.
314
- - Custom models are upserted by `id` within the provider.
315
- - If a custom model `id` matches a built-in model `id`, the custom model replaces that built-in model.
316
- - If a custom model `id` is new, it is added alongside built-in models.
347
+ The built-in models remain. A new custom `id` is added, while a matching ID is replaced by the custom definition and its defaults. Provider-level `baseUrl` and `compat` apply to the catalog models as well. To preserve catalog metadata while changing only selected fields, use `modelOverrides`.
317
348
 
318
349
  ## Per-model Overrides
319
350
 
320
- Use `modelOverrides` to customize built-in models and matching extension-registered models without replacing the provider's full model list.
351
+ `modelOverrides` applies partial changes to matching models after built-in/native models, `models` upserts, and extension-provided models have been composed. It does not create an unknown model and cannot change `id`, `api`, or `baseUrl`.
321
352
 
322
353
  ```json
323
354
  {
@@ -338,9 +369,11 @@ Use `modelOverrides` to customize built-in models and matching extension-registe
338
369
  }
339
370
  ```
340
371
 
341
- `modelOverrides` supports these fields per model: `name`, `reasoning`, `thinkingLevelMap`, `input`, `cost` (partial), `contextWindow`, `maxTokens`, `headers`, `compat`.
372
+ An override supports `name`, `reasoning`, `thinkingLevelMap`, `input`, `cost`, `contextWindow`, `maxTokens`, `headers`, and `compat`. Its `cost` base rates are individually optional and retain omitted values; a supplied `tiers` array replaces the existing array. Thinking maps merge by level. `compat` merges by field, and its `openRouterRouting`, `vercelGatewayRouting`, and `chatTemplateKwargs` objects merge by key.
373
+
374
+ If an override and a `models` entry use the same ID, the override still changes the final model. For headers only, the `models` entry wins on a duplicate header name as described in [Custom Headers](#custom-headers). Overrides also apply to matching extension-registered models; see [Custom Providers: Composition, Updates, and Removal](custom-provider.md#composition-updates-and-removal).
342
375
 
343
- Direct OpenAI GPT-5.6 Sol, Terra, and Luna default to a `272000` context window so requests remain within OpenAI's short-context pricing tier. To opt into OpenAI's 1.05M context window, increase it for each model you use:
376
+ Direct OpenAI GPT-5.6 Sol, Terra, and Luna default to a `272000` context window so requests remain within OpenAI's short-context pricing tier. To use the 1.05M context window, override each model you use:
344
377
 
345
378
  ```json
346
379
  {
@@ -356,26 +389,29 @@ Direct OpenAI GPT-5.6 Sol, Terra, and Luna default to a `272000` context window
356
389
  }
357
390
  ```
358
391
 
359
- The override preserves the built-in pricing metadata. Requests with more than 272K total input tokens use GPT-5.6's long-context rates for the entire request. Apply the same override to `gpt-5.6-terra` or `gpt-5.6-luna` when needed.
360
-
361
- Behavior notes:
362
- - `modelOverrides` are applied to built-in provider models and matching extension-registered provider models.
363
- - Unknown model IDs are ignored.
364
- - You can combine provider-level `baseUrl`/`headers` with `modelOverrides`.
365
- - Overriding `name` changes model matching and secondary detail text only; the footer and primary model lists continue to show the model `id`.
366
- - If `models` is also defined for a provider, custom models are merged after built-in overrides. A custom model with the same `id` replaces the overridden built-in model entry.
392
+ The override preserves catalog pricing metadata. Requests whose total input usage exceeds 272K use the GPT-5.6 long-context rates for the entire request. Apply the same override to `gpt-5.6-terra` or `gpt-5.6-luna` when needed.
367
393
 
368
- ## Anthropic Messages Compatibility
369
-
370
- For providers or proxies using `api: "anthropic-messages"`, use `compat` to control Anthropic-specific request compatibility.
394
+ ## Compatibility Options
371
395
 
372
- By default pi sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. Pi will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
396
+ Set `compat` on a provider for defaults or on a `models`/`modelOverrides` entry for a model-specific refinement. The selected API interprets these options; do not use an option for a different API in the expectation that Pi will translate it. Standard endpoint quirks are usually better expressed here than by writing a custom stream.
373
397
 
374
- Some Anthropic models require adaptive thinking (`thinking.type: "adaptive"` plus `output_config.effort`) instead of the legacy budget-based thinking payload. Built-in models set this automatically. For custom providers or aliases that route to those models, set `forceAdaptiveThinking` to `true`.
398
+ ## Anthropic Messages Compatibility
375
399
 
376
- Some Anthropic-compatible providers emit thinking blocks with empty signatures and still expect them on replay. Set `allowEmptySignature` to `true` only for those providers; real Anthropic rejects empty thinking signatures.
400
+ For `api: "anthropic-messages"`, use these options for Anthropic-compatible endpoints:
377
401
 
378
- Built-in Anthropic models enable `supportsStrictTools` in their model metadata. Custom Anthropic-compatible models must set it to `true` when their endpoint accepts strict JSON-schema tool definitions.
402
+ | Field | Description |
403
+ | --- | --- |
404
+ | `supportsEagerToolInputStreaming` | Accepts per-tool `eager_input_streaming`. Default: `true`. When `false`, Pi omits it and sends the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests. |
405
+ | `supportsLongCacheRetention` | Accepts `cache_control.ttl: "1h"` for long cache retention. Default: `true`. |
406
+ | `sendSessionAffinityHeaders` | Sends `x-session-affinity` from the session ID when caching is enabled. Default: `false`; built-in model metadata can enable it for providers that need it. |
407
+ | `supportsCacheControlOnTools` | Accepts Anthropic `cache_control` on tool definitions. Default: `true`. |
408
+ | `supportsTemperature` | Accepts non-default `temperature`. Default: `true`; set `false` for endpoints such as Claude Opus 4.7+ that reject it. |
409
+ | `forceAdaptiveThinking` | Uses adaptive thinking (`thinking.type: "adaptive"` and `output_config.effort`) regardless of model ID. Default: `false`. |
410
+ | `allowEmptySignature` | Replays an empty thinking signature as `signature: ""` instead of converting the thinking block to text. Default: `false`. |
411
+ | `supportsStrictTools` | Accepts strict JSON-schema tool definitions. Default: `false`; capable built-in Anthropic models set it in their metadata. |
412
+ | `supportsToolReferences` | Accepts deferred tool loading with `tool_reference` blocks. The default is enabled only for supported recent first-party Anthropic models, and otherwise `false`. |
413
+
414
+ For example, a proxy that lacks eager streaming but supports long cache retention and adaptive thinking can use:
379
415
 
380
416
  ```json
381
417
  {
@@ -402,67 +438,55 @@ Built-in Anthropic models enable `supportsStrictTools` in their model metadata.
402
438
  }
403
439
  ```
404
440
 
405
- | Field | Description |
406
- |-------|-------------|
407
- | `supportsEagerToolInputStreaming` | Whether the provider accepts per-tool `eager_input_streaming`. Default: `true`. Set to `false` to omit that field and use the legacy fine-grained tool streaming beta header on tool-enabled requests. |
408
- | `supportsLongCacheRetention` | Whether the provider accepts Anthropic long cache retention (`cache_control.ttl: "1h"`) when cache retention is `long`. Default: `true`. |
409
- | `sendSessionAffinityHeaders` | Whether to send `x-session-affinity` from the session id when caching is enabled. Default: auto-detected for known providers. |
410
- | `supportsCacheControlOnTools` | Whether the provider accepts Anthropic-style `cache_control` markers on tool definitions. Default: `true`. |
411
- | `forceAdaptiveThinking` | Whether to send adaptive thinking (`thinking.type: "adaptive"` plus `output_config.effort`) for this model. Built-in adaptive models set this automatically. Default: `false`. |
412
- | `allowEmptySignature` | Whether to replay empty thinking signatures as `signature: ""` instead of converting thinking to text. Default: `false`. |
413
- | `supportsStrictTools` | Whether the provider accepts strict JSON-schema tool definitions. Default: `false`; built-in Anthropic models enable it in generated metadata. |
414
-
415
441
  ## OpenAI Compatibility
416
442
 
417
- For providers with partial OpenAI compatibility, use the `compat` field.
443
+ ### OpenAI Chat Completions
418
444
 
419
- - Provider-level `compat` applies defaults to all models under that provider.
420
- - Model-level `compat` overrides provider-level values for that model.
445
+ For `api: "openai-completions"`, Pi auto-detects many defaults from the provider ID and base URL. Set an option only when the endpoint differs from that behavior.
446
+
447
+ | Field | Description |
448
+ | --- | --- |
449
+ | `supportsStore` | Accepts `store: false`. Default: URL-detected. |
450
+ | `supportsDeveloperRole` | Uses `developer` rather than `system` for reasoning models. Default: URL-detected. |
451
+ | `supportsReasoningEffort` | Accepts `reasoning_effort` when the selected thinking format uses it. Default: URL-detected. |
452
+ | `supportsUsageInStreaming` | Accepts `stream_options: { "include_usage": true }`. Default: `true`. |
453
+ | `maxTokensField` | Selects `max_completion_tokens` or `max_tokens`. Default: URL-detected. |
454
+ | `requiresToolResultName` | Requires `name` on tool-result messages. Default: URL-detected. |
455
+ | `requiresAssistantAfterToolResult` | Requires an assistant message before a user message following tool results. Default: URL-detected. |
456
+ | `requiresThinkingAsText` | Replays thinking blocks as text delimited by `<thinking>`. Default: URL-detected. |
457
+ | `requiresReasoningContentOnAssistantMessages` | Includes empty `reasoning_content` on replayed assistant messages when reasoning is enabled. Default: URL-detected. |
458
+ | `thinkingFormat` | One of `openai`, `openrouter`, `deepseek`, `together`, `zai`, `qwen`, `chat-template`, `qwen-chat-template`, `string-thinking`, or `ant-ling`. Default: `openai` unless URL detection selects a known provider format. |
459
+ | `chatTemplateKwargs` | `chat_template_kwargs` for `thinkingFormat: "chat-template"`. Values may be strings, numbers, booleans, `null`, or `{ "$var": "thinking.enabled" | "thinking.effort", "omitWhenOff"?: true }`. |
460
+ | `zaiToolStream` | Sends top-level `tool_stream: true` when tools are present. Default: `false`; use only for Z.AI-compatible endpoints that require it. |
461
+ | `cacheControlFormat` | `anthropic` applies Anthropic-style `cache_control` markers to the system prompt, last tool definition, and final text content when caching is enabled. |
462
+ | `sendSessionAffinityHeaders` | Sends session-affinity headers from the session ID when caching is enabled. Default: `false`. |
463
+ | `sessionAffinityFormat` | `openai` sends `session_id`, `x-client-request-id`, and `x-session-affinity`; `openai-nosession` omits `session_id`; `openrouter` sends `x-session-id`. It does not change `prompt_cache_key`. Default: URL-detected. |
464
+ | `supportsStrictMode` | Accepts strict JSON-schema function tools. Default: URL-detected. |
465
+ | `supportsOpenAIGrammarTools` | Emits OpenAI Lark/regex grammar tools. When `false`, grammar-constrained tools fall back to normal function tools. Default: `false`. |
466
+ | `deferredToolsMode` | Provider-specific deferred-tool serialization. The only value is `kimi`. |
467
+ | `supportsLongCacheRetention` | Accepts long prompt-cache retention: `prompt_cache_retention: "24h"`, or `cache_control.ttl: "1h"` with `cacheControlFormat: "anthropic"`. Default: `true` except URL-detected incompatible endpoints. |
468
+ | `openRouterRouting` | OpenRouter routing preferences sent unchanged in the request `provider` field. |
469
+ | `vercelGatewayRouting` | Vercel AI Gateway routing preferences (`only`, `order`) sent as `providerOptions.gateway`. |
470
+
471
+ Thinking formats use these request shapes: `openai` sends `reasoning_effort`; `openrouter` sends `reasoning: { effort }`; `deepseek` sends `thinking: { type }` and, when enabled, `reasoning_effort`; `together` sends `reasoning: { enabled }` and optionally `reasoning_effort`; `zai` sends `thinking: { type }`; `qwen` sends `enable_thinking`; `qwen-chat-template` sends `chat_template_kwargs.enable_thinking` and `preserve_thinking`; `string-thinking` sends top-level `thinking` as a string; and `ant-ling` sends `reasoning: { effort }` only for a non-null mapped effort. `chat-template` sends the configured `chatTemplateKwargs`.
472
+
473
+ Use `qwen-chat-template` for local Qwen-compatible servers that need its fixed chat-template kwargs. Use `chat-template` for vLLM or Hugging Face templates that need custom kwargs, for example:
421
474
 
422
475
  ```json
423
476
  {
424
- "providers": {
425
- "local-llm": {
426
- "baseUrl": "http://localhost:8080/v1",
427
- "api": "openai-completions",
428
- "compat": {
429
- "supportsUsageInStreaming": false,
430
- "maxTokensField": "max_tokens"
431
- },
432
- "models": [...]
477
+ "compat": {
478
+ "thinkingFormat": "chat-template",
479
+ "chatTemplateKwargs": {
480
+ "thinking": { "$var": "thinking.enabled" },
481
+ "thinking_effort": { "$var": "thinking.effort", "omitWhenOff": true }
433
482
  }
434
483
  }
435
484
  }
436
485
  ```
437
486
 
438
- | Field | Description |
439
- |-------|-------------|
440
- | `supportsStore` | Provider supports `store` field |
441
- | `supportsDeveloperRole` | Use `developer` vs `system` role |
442
- | `supportsReasoningEffort` | Support for `reasoning_effort` parameter |
443
- | `supportsUsageInStreaming` | Supports `stream_options: { include_usage: true }` (default: `true`) |
444
- | `maxTokensField` | Use `max_completion_tokens` or `max_tokens` |
445
- | `requiresToolResultName` | Include `name` on tool result messages |
446
- | `requiresAssistantAfterToolResult` | Insert an assistant message before a user message after tool results |
447
- | `requiresThinkingAsText` | Convert thinking blocks to plain text |
448
- | `requiresReasoningContentOnAssistantMessages` | Include empty `reasoning_content` on all replayed assistant messages when reasoning is enabled |
449
- | `thinkingFormat` | Use `reasoning_effort`, `openrouter`, `deepseek`, `together`, `zai`, `qwen`, `chat-template`, or `qwen-chat-template` thinking parameters |
450
- | `chatTemplateKwargs` | `chat_template_kwargs` values for `thinkingFormat: "chat-template"`; use `{ "$var": "thinking.enabled" }` or `{ "$var": "thinking.effort" }` for pi-controlled thinking values |
451
- | `cacheControlFormat` | Use Anthropic-style `cache_control` markers on the system prompt, last tool definition, and last user, assistant, or tool-result text content. Currently only `anthropic` is supported. |
452
- | `sendSessionAffinityHeaders` | For `openai-completions`, send session-affinity headers from the session id when caching is enabled. Default: `false`. |
453
- | `sessionAffinityFormat` | For `openai-completions` and `openai-responses`, the session-affinity header format: `openai` sends `session_id`/`x-client-request-id` (completions also `x-session-affinity`), `openai-nosession` omits the underscore-containing `session_id` header, `openrouter` sends `x-session-id`. Does not affect the `prompt_cache_key` body param. Default: auto-detected. |
454
- | `supportsStrictMode` | Whether the provider accepts strict JSON-schema function tool definitions. Defaults depend on the API; built-in OpenAI models carry explicit capability metadata. |
455
- | `supportsOpenAIGrammarTools` | Whether OpenAI-compatible APIs emit custom Lark/regex grammar tools. When `false`, grammar-constrained tools fall back to normal function tools. Default: `false`; the built-in model catalog enables it for GPT-5+ models on OpenAI, OpenAI Codex, Azure OpenAI, GitHub Copilot, opencode, and Cloudflare AI Gateway. |
456
- | `deferredToolsMode` | Use provider-specific deferred tool serialization. Currently only `"kimi"` is supported for Kimi's OpenAI-compatible Chat Completions format. |
457
- | `supportsLongCacheRetention` | Whether the provider accepts long cache retention when cache retention is `long`: `prompt_cache_retention: "24h"` for OpenAI prompt caching, or `cache_control.ttl: "1h"` when `cacheControlFormat` is `anthropic`. Default: `true`. |
458
- | `openRouterRouting` | OpenRouter provider routing preferences. This object is sent as-is in the `provider` field of the [OpenRouter API request](https://openrouter.ai/docs/guides/routing/provider-selection). |
459
- | `vercelGatewayRouting` | Vercel AI Gateway routing config for provider selection (`only`, `order`) |
460
-
461
- `openrouter` uses `reasoning: { effort }`. `together` uses `reasoning: { enabled }` and also `reasoning_effort` when `supportsReasoningEffort` is enabled. `qwen` uses top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that require `chat_template_kwargs.enable_thinking` and `preserve_thinking`. Use `chat-template` for vLLM/Hugging Face chat templates that need configurable `chat_template_kwargs`, such as `chatTemplateKwargs: { "thinking": { "$var": "thinking.enabled" } }` for DeepSeek V3.x templates.
462
-
463
- `cacheControlFormat: "anthropic"` is for OpenAI-compatible providers that expose Anthropic-style prompt caching through `cache_control` markers on text content and tool definitions.
464
-
465
- Example:
487
+ `cacheControlFormat: "anthropic"` is for OpenAI-compatible servers that expose Anthropic-style prompt caching. `openRouterRouting` and `vercelGatewayRouting` have the shapes defined by the [OpenRouter routing API](https://openrouter.ai/docs/guides/routing/provider-selection) and [Vercel AI Gateway](https://vercel.com/docs/ai-gateway/models-and-providers/provider-options), respectively.
488
+
489
+ OpenRouter example:
466
490
 
467
491
  ```json
468
492
  {
@@ -473,7 +497,7 @@ Example:
473
497
  "api": "openai-completions",
474
498
  "models": [
475
499
  {
476
- "id": "openrouter/anthropic/claude-3.5-sonnet",
500
+ "id": "anthropic/claude-3.5-sonnet",
477
501
  "name": "OpenRouter Claude 3.5 Sonnet",
478
502
  "compat": {
479
503
  "openRouterRouting": {
@@ -542,3 +566,21 @@ Vercel AI Gateway example:
542
566
  }
543
567
  }
544
568
  ```
569
+
570
+ ### OpenAI Responses
571
+
572
+ For `api: "openai-responses"`, the compatible fields are `supportsDeveloperRole`, `sessionAffinityFormat`, `supportsLongCacheRetention`, `supportsStrictMode`, `supportsOpenAIGrammarTools`, `supportsToolSearch`, and `supportsExplicitPromptCacheMode`.
573
+
574
+ | Field | Description |
575
+ | --- | --- |
576
+ | `supportsDeveloperRole` | Uses `developer` rather than `system` for reasoning models. Default: `true`. |
577
+ | `sessionAffinityFormat` | `openai` sends `session_id` and `x-client-request-id`; `openai-nosession` omits `session_id`; `openrouter` sends `x-session-id`. It does not change `prompt_cache_key`. |
578
+ | `supportsLongCacheRetention` | Accepts `prompt_cache_retention: "24h"` for long cache retention. Default: `true`. |
579
+ | `supportsStrictMode` | Accepts strict JSON-schema function tools. Default: `false`. |
580
+ | `supportsOpenAIGrammarTools` | Emits OpenAI Lark/regex grammar tools. Default: `false`. |
581
+ | `supportsToolSearch` | Supports client-executed deferred tool search. Default: `false`. |
582
+ | `supportsExplicitPromptCacheMode` | Accepts `prompt_cache_options: { mode: "explicit" }` when cache retention is `none`, which disables implicit prompt caching. Default: `false`. |
583
+
584
+ The public Pi AI model type also exposes the Responses compatibility shape for `azure-openai-responses` and `openai-codex-responses`. The Azure transport uses `supportsDeveloperRole`, `supportsStrictMode`, and `supportsOpenAIGrammarTools`; the Codex transport uses `supportsStrictMode`, `supportsOpenAIGrammarTools`, and `supportsToolSearch`. Other Responses options do not alter those transports.
585
+
586
+ For `bedrock-converse-stream`, `compat.supportsStrictMode` controls Bedrock strict JSON-schema tool definitions and defaults to `false`. The other built-in API tags do not define model compatibility options.
package/docs/providers.md CHANGED
@@ -48,6 +48,7 @@ Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party h
48
48
 
49
49
  - Run `/login openrouter`, then select **Sign in with OpenRouter** to open the OpenRouter PKCE authorization flow
50
50
  - The authorization creates a user-controlled OpenRouter API key billed from your OpenRouter credits
51
+ - On remote or headless machines (for example over SSH), paste the final redirect URL or authorization code into the login prompt when the browser cannot reach the loopback callback
51
52
  - `OPENROUTER_API_KEY` remains available through **Use an API key**
52
53
 
53
54
  ### Radius
@@ -101,7 +102,7 @@ pi
101
102
  | Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` | `xiaomi-token-plan-ams` |
102
103
  | Xiaomi MiMo Token Plan (Singapore) | `XIAOMI_TOKEN_PLAN_SGP_API_KEY` | `xiaomi-token-plan-sgp` |
103
104
 
104
- Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/earendil-works/pi/blob/v0.82.1/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/earendil-works/pi/blob/v0.82.1/packages/ai/src/env-api-keys.ts).
105
+ See [Environment variables](environment-variables.md) for process configuration and [Auth File](#auth-file) for credential storage.
105
106
 
106
107
  #### Auth File
107
108
 
@@ -4,7 +4,7 @@ This page gets you from install to a useful first pi session.
4
4
 
5
5
  ## Install
6
6
 
7
- Pi is distributed as an npm package:
7
+ Pi is distributed as an npm package. Pi requires Node.js >=22.19.
8
8
 
9
9
  ```bash
10
10
  npm install -g --ignore-scripts @astralyn/pi
@@ -14,10 +14,10 @@ npm install -g --ignore-scripts @astralyn/pi
14
14
 
15
15
  ### Uninstall
16
16
 
17
- Use the package manager that installed pi. The curl installer uses npm globally, so curl and npm installs are removed with npm:
17
+ Use the package manager that installed pi:
18
18
 
19
19
  ```bash
20
- # curl installer or npm install -g
20
+ # npm
21
21
  npm uninstall -g @astralyn/pi
22
22
 
23
23
  # pnpm