@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.
- package/CHANGELOG.md +34 -5099
- package/README.md +12 -111
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/credential-print.d.ts +23 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +116 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +13 -6
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +7 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +7 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +10 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +13 -6
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resource-loader.d.ts +15 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +70 -9
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +34 -4
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +48 -9
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +0 -2
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +43 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +40 -3
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +20 -6
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +13 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/utils/paths.d.ts +2 -3
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +2 -3
- package/dist/utils/paths.js.map +1 -1
- package/docs/bundled/README.md +13 -16
- package/docs/bundled/themes.md +1 -1
- package/docs/compaction.md +25 -30
- package/docs/custom-provider.md +298 -583
- package/docs/docs.json +0 -8
- package/docs/extensions.md +112 -116
- package/docs/index.md +18 -74
- package/docs/json.md +20 -14
- package/docs/models.md +193 -151
- package/docs/providers.md +2 -1
- package/docs/quickstart.md +3 -3
- package/docs/rpc.md +165 -123
- package/docs/sdk.md +119 -178
- package/docs/security.md +1 -1
- package/docs/session-format.md +139 -119
- package/docs/skills.md +0 -1
- package/docs/themes.md +2 -2
- package/docs/tui.md +411 -549
- package/docs/usage.md +3 -11
- package/examples/README.md +6 -1
- package/examples/extensions/README.md +13 -33
- package/examples/extensions/custom-provider-anthropic/index.ts +9 -3
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/truncated-tool.ts +2 -2
- package/examples/sdk/12-full-control.ts +2 -0
- package/npm-shrinkwrap.json +21 -21
- package/package.json +5 -5
- package/dist/extensions/plan/constants.d.ts +0 -68
- package/dist/extensions/plan/constants.d.ts.map +0 -1
- package/dist/extensions/plan/constants.js +0 -100
- package/dist/extensions/plan/constants.js.map +0 -1
- package/dist/extensions/plan/index.d.ts +0 -30
- package/dist/extensions/plan/index.d.ts.map +0 -1
- package/dist/extensions/plan/index.js +0 -429
- package/dist/extensions/plan/index.js.map +0 -1
- package/dist/extensions/plan/schema.d.ts +0 -20
- package/dist/extensions/plan/schema.d.ts.map +0 -1
- package/dist/extensions/plan/schema.js +0 -13
- package/dist/extensions/plan/schema.js.map +0 -1
- package/dist/extensions/plan/state.d.ts +0 -38
- package/dist/extensions/plan/state.d.ts.map +0 -1
- package/dist/extensions/plan/state.js +0 -96
- package/dist/extensions/plan/state.js.map +0 -1
- package/dist/extensions/plan/storage.d.ts +0 -26
- package/dist/extensions/plan/storage.d.ts.map +0 -1
- package/dist/extensions/plan/storage.js +0 -83
- package/dist/extensions/plan/storage.js.map +0 -1
- package/dist/extensions/plan/view.d.ts +0 -44
- package/dist/extensions/plan/view.d.ts.map +0 -1
- package/dist/extensions/plan/view.js +0 -149
- package/dist/extensions/plan/view.js.map +0 -1
- package/docs/bundled/extensions/README.md +0 -19
- package/docs/bundled/extensions/plan.md +0 -34
- package/examples/extensions/plan-mode/README.md +0 -66
- package/examples/extensions/plan-mode/index.ts +0 -390
- 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
|
-
|
|
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
|
-
- [
|
|
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
|
-
- [
|
|
15
|
-
- [
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
101
|
+
## Google Generative AI Example
|
|
93
102
|
|
|
94
|
-
|
|
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
|
|
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
|
-
|
|
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 |
|
|
124
|
-
|
|
125
|
-
| `
|
|
126
|
-
| `openai-
|
|
127
|
-
| `
|
|
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
|
-
|
|
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
|
-
| `
|
|
137
|
-
| `
|
|
138
|
-
| `
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
172
|
+
`apiKey` and every configured header value support shell commands, environment interpolation, and literals:
|
|
150
173
|
|
|
151
|
-
- **Shell command:**
|
|
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:**
|
|
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`
|
|
162
|
-
- **Escapes:**
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
202
|
-
| `name` | No | `id` | Human-readable
|
|
203
|
-
| `api` | No |
|
|
204
|
-
| `
|
|
205
|
-
| `
|
|
206
|
-
| `
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
209
|
-
| `
|
|
210
|
-
| `
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
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
|
-
|
|
|
245
|
-
|
|
246
|
-
| omitted |
|
|
247
|
-
| string |
|
|
248
|
-
| `null` |
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
##
|
|
369
|
-
|
|
370
|
-
For providers or proxies using `api: "anthropic-messages"`, use `compat` to control Anthropic-specific request compatibility.
|
|
394
|
+
## Compatibility Options
|
|
371
395
|
|
|
372
|
-
|
|
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
|
-
|
|
398
|
+
## Anthropic Messages Compatibility
|
|
375
399
|
|
|
376
|
-
|
|
400
|
+
For `api: "anthropic-messages"`, use these options for Anthropic-compatible endpoints:
|
|
377
401
|
|
|
378
|
-
|
|
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
|
-
|
|
443
|
+
### OpenAI Chat Completions
|
|
418
444
|
|
|
419
|
-
-
|
|
420
|
-
|
|
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
|
-
"
|
|
425
|
-
"
|
|
426
|
-
|
|
427
|
-
"
|
|
428
|
-
"
|
|
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
|
-
|
|
439
|
-
|
|
440
|
-
|
|
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": "
|
|
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
|
-
|
|
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
|
|
package/docs/quickstart.md
CHANGED
|
@@ -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
|
|
17
|
+
Use the package manager that installed pi:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
#
|
|
20
|
+
# npm
|
|
21
21
|
npm uninstall -g @astralyn/pi
|
|
22
22
|
|
|
23
23
|
# pnpm
|