@stll/ai-catalog 0.1.6 → 0.1.8

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/dist/index.d.ts CHANGED
@@ -1,1122 +1,1224 @@
1
1
  import * as v from "valibot";
2
- //#region src/capabilities-overrides.d.ts
3
- /**
4
- * Hand-declared capabilities for offered models that models.dev does
5
- * not cover. The capability generator
6
- * (`packages/scripts/src/model-catalog-capabilities-gen.ts`) refuses
7
- * an override for any model the upstream source covers, so manual
8
- * data cannot shadow sourced data — this file can only ever fill
9
- * genuine gaps, each with a dated justification.
10
- */
11
- type CapabilityOverride = {
12
- documentInput: boolean;
13
- documentInputReason: string;
14
- reasoningEfforts: readonly ReasoningEffort[] | null;
15
- temperatureSupported: boolean;
16
- /** Why the upstream source cannot answer for this model. Dated. */
17
- reason: string;
18
- };
19
- declare const CAPABILITY_OVERRIDES: Partial<Record<OfferedBYOKModelId, CapabilityOverride>>;
20
- //#endregion
21
- //#region src/document-input-overrides.d.ts
22
- type DocumentInputOverride = {
23
- /** Whether the model accepts a PDF/file content part. */
24
- supported: boolean;
25
- /** Why the live catalogue cannot answer correctly. Dated. */
26
- reason: string;
27
- };
28
- /**
29
- * Reviewed document-input corrections for models.dev records that exist but
30
- * under-report the provider API's file-input support. The generator rejects an
31
- * override once upstream agrees, so sourced data takes ownership automatically.
32
- */
33
- declare const DOCUMENT_INPUT_OVERRIDES: Partial<Record<OfferedBYOKModelId, DocumentInputOverride>>;
34
- //#endregion
35
- //#region src/capabilities.gen.d.ts
36
- /**
37
- * Reasoning-effort values each offered model accepts, `null` when the
38
- * model exposes no effort-style reasoning control. A missing `"none"`
39
- * means the model's reasoning cannot be disabled; consumers must go
40
- * through `resolveReasoningEffort`.
41
- */
42
- declare const MODEL_REASONING_EFFORTS: {
43
- readonly "gemini-3.8-flash": readonly ["low", "medium", "high"];
44
- readonly "gemini-3.7-flash": readonly ["low", "medium", "high"];
45
- readonly "gemini-3.6-flash": readonly ["minimal", "low", "medium", "high"];
46
- readonly "gemini-3.5-flash-lite": readonly ["minimal", "low", "medium", "high"];
47
- readonly "gemini-3.1-pro-preview": readonly ["low", "medium", "high"];
48
- readonly "gemini-3.5-flash": readonly ["minimal", "low", "medium", "high"];
49
- readonly "gemini-3.1-flash-lite": readonly ["minimal", "low", "medium", "high"];
50
- readonly "openai/gpt-5.6-luna": readonly ["none", "low", "medium", "high", "xhigh", "max"];
51
- readonly "openai/gpt-5.6-terra": readonly ["none", "low", "medium", "high", "xhigh", "max"];
52
- readonly "google/gemini-3.8-flash": readonly ["low", "medium", "high"];
53
- readonly "google/gemini-3.7-flash": readonly ["low", "medium", "high"];
54
- readonly "google/gemini-3.6-flash": readonly ["minimal", "low", "medium", "high"];
55
- readonly "google/gemini-3.5-flash-lite": readonly ["minimal", "low", "medium", "high"];
56
- readonly "google/gemini-3.1-pro-preview": readonly ["low", "medium", "high"];
57
- readonly "google/gemini-3.5-flash": readonly ["minimal", "low", "medium", "high"];
58
- readonly "google/gemini-3.1-flash-lite": readonly ["none", "minimal", "low", "medium", "high"];
59
- readonly "anthropic/claude-sonnet-5": readonly ["none", "low", "medium", "high", "xhigh", "max"];
60
- readonly "anthropic/claude-opus-5": readonly ["none", "low", "medium", "high", "xhigh", "max"];
61
- readonly "anthropic/claude-opus-4.8": readonly ["none", "low", "medium", "high", "xhigh", "max"];
62
- readonly "anthropic/claude-sonnet-4.6": readonly ["none", "low", "medium", "high", "max"];
63
- readonly "openai/gpt-5.5": readonly ["none", "low", "medium", "high", "xhigh"];
64
- readonly "openai/gpt-5.4-mini": readonly ["none", "low", "medium", "high", "xhigh"];
65
- readonly "gpt-5.6": readonly ["none", "low", "medium", "high", "xhigh", "max"];
66
- readonly "gpt-5.6-terra": readonly ["none", "low", "medium", "high", "xhigh", "max"];
67
- readonly "gpt-5.6-luna": readonly ["none", "low", "medium", "high", "xhigh", "max"];
68
- readonly "gpt-5.5": readonly ["none", "low", "medium", "high", "xhigh"];
69
- readonly "gpt-5.4": readonly ["none", "low", "medium", "high", "xhigh"];
70
- readonly "gpt-5.4-mini": readonly ["none", "low", "medium", "high", "xhigh"];
71
- readonly "gpt-5.4-nano": readonly ["none", "low", "medium", "high", "xhigh"];
72
- readonly "gpt-5.2": readonly ["none", "low", "medium", "high", "xhigh"];
73
- readonly "claude-sonnet-5": readonly ["none", "low", "medium", "high", "xhigh", "max"];
74
- readonly "claude-fable-5-1": readonly ["low", "medium", "high", "xhigh", "max"];
75
- readonly "claude-fable-5": readonly ["low", "medium", "high", "xhigh", "max"];
76
- readonly "claude-opus-5": readonly ["low", "medium", "high", "xhigh", "max"];
77
- readonly "claude-opus-4-8": readonly ["low", "medium", "high", "xhigh", "max"];
78
- readonly "claude-opus-4-7": readonly ["low", "medium", "high", "xhigh", "max"];
79
- readonly "claude-sonnet-4-6": readonly ["low", "medium", "high", "max"];
80
- readonly "claude-opus-4-6": readonly ["low", "medium", "high", "max"];
81
- readonly "claude-haiku-4-5-20251001": null;
82
- readonly "us.anthropic.claude-sonnet-4-5-20250929-v1:0": null;
83
- readonly "us.anthropic.claude-haiku-4-5-20251001-v1:0": null;
84
- readonly "us.amazon.nova-pro-v1:0": null;
85
- readonly "us.amazon.nova-lite-v1:0": null;
86
- readonly "us.amazon.nova-micro-v1:0": null;
87
- readonly "openai.gpt-oss-120b-1:0": readonly ["low", "medium", "high"];
88
- readonly "openai.gpt-oss-20b-1:0": readonly ["low", "medium", "high"];
89
- readonly "us.deepseek.r1-v1:0": null;
90
- readonly "mistral-large-latest": null;
91
- readonly "mistral-medium-latest": readonly ["none", "high"];
92
- readonly "mistral-small-latest": readonly ["none", "high"];
93
- readonly "magistral-medium-latest": null;
94
- readonly "magistral-small": null;
95
- readonly "pixtral-large-latest": null;
96
- };
97
- /**
98
- * Concrete provider-default effort where the upstream catalogue publishes
99
- * one. OpenRouter is the source today; null means the provider does not expose
100
- * a truthful named default, so clients must retain a separate Default choice.
101
- */
102
- declare const MODEL_DEFAULT_REASONING_EFFORTS: {
103
- readonly "gemini-3.8-flash": null;
104
- readonly "gemini-3.7-flash": null;
105
- readonly "gemini-3.6-flash": null;
106
- readonly "gemini-3.5-flash-lite": null;
107
- readonly "gemini-3.1-pro-preview": null;
108
- readonly "gemini-3.5-flash": null;
109
- readonly "gemini-3.1-flash-lite": null;
110
- readonly "openai/gpt-5.6-luna": "medium";
111
- readonly "openai/gpt-5.6-terra": "medium";
112
- readonly "google/gemini-3.8-flash": "medium";
113
- readonly "google/gemini-3.7-flash": "medium";
114
- readonly "google/gemini-3.6-flash": "medium";
115
- readonly "google/gemini-3.5-flash-lite": "minimal";
116
- readonly "google/gemini-3.1-pro-preview": "medium";
117
- readonly "google/gemini-3.5-flash": "medium";
118
- readonly "google/gemini-3.1-flash-lite": "minimal";
119
- readonly "anthropic/claude-sonnet-5": "high";
120
- readonly "anthropic/claude-opus-5": "high";
121
- readonly "anthropic/claude-opus-4.8": "high";
122
- readonly "anthropic/claude-sonnet-4.6": "medium";
123
- readonly "openai/gpt-5.5": "medium";
124
- readonly "openai/gpt-5.4-mini": "medium";
125
- readonly "gpt-5.6": null;
126
- readonly "gpt-5.6-terra": null;
127
- readonly "gpt-5.6-luna": null;
128
- readonly "gpt-5.5": null;
129
- readonly "gpt-5.4": null;
130
- readonly "gpt-5.4-mini": null;
131
- readonly "gpt-5.4-nano": null;
132
- readonly "gpt-5.2": null;
133
- readonly "claude-sonnet-5": null;
134
- readonly "claude-fable-5-1": null;
135
- readonly "claude-fable-5": null;
136
- readonly "claude-opus-5": null;
137
- readonly "claude-opus-4-8": null;
138
- readonly "claude-opus-4-7": null;
139
- readonly "claude-sonnet-4-6": null;
140
- readonly "claude-opus-4-6": null;
141
- readonly "claude-haiku-4-5-20251001": null;
142
- readonly "us.anthropic.claude-sonnet-4-5-20250929-v1:0": null;
143
- readonly "us.anthropic.claude-haiku-4-5-20251001-v1:0": null;
144
- readonly "us.amazon.nova-pro-v1:0": null;
145
- readonly "us.amazon.nova-lite-v1:0": null;
146
- readonly "us.amazon.nova-micro-v1:0": null;
147
- readonly "openai.gpt-oss-120b-1:0": null;
148
- readonly "openai.gpt-oss-20b-1:0": null;
149
- readonly "us.deepseek.r1-v1:0": null;
150
- readonly "mistral-large-latest": null;
151
- readonly "mistral-medium-latest": null;
152
- readonly "mistral-small-latest": null;
153
- readonly "magistral-medium-latest": null;
154
- readonly "magistral-small": null;
155
- readonly "pixtral-large-latest": null;
156
- };
157
- /**
158
- * Whether stella should emit a `temperature` sampling override.
159
- * `"omit"` covers rejected, deprecated, and accepted-but-ignored
160
- * parameters. Consumers must go through `shouldEmitTemperature`.
161
- */
162
- declare const MODEL_TEMPERATURE_POLICIES: {
163
- readonly "gemini-3.8-flash": "omit";
164
- readonly "gemini-3.7-flash": "omit";
165
- readonly "gemini-3.6-flash": "omit";
166
- readonly "gemini-3.5-flash-lite": "omit";
167
- readonly "gemini-3.1-pro-preview": "emit";
168
- readonly "gemini-3.5-flash": "emit";
169
- readonly "gemini-3.1-flash-lite": "emit";
170
- readonly "openai/gpt-5.6-luna": "omit";
171
- readonly "openai/gpt-5.6-terra": "omit";
172
- readonly "google/gemini-3.8-flash": "omit";
173
- readonly "google/gemini-3.7-flash": "omit";
174
- readonly "google/gemini-3.6-flash": "omit";
175
- readonly "google/gemini-3.5-flash-lite": "omit";
176
- readonly "google/gemini-3.1-pro-preview": "emit";
177
- readonly "google/gemini-3.5-flash": "emit";
178
- readonly "google/gemini-3.1-flash-lite": "emit";
179
- readonly "anthropic/claude-sonnet-5": "omit";
180
- readonly "anthropic/claude-opus-5": "emit";
181
- readonly "anthropic/claude-opus-4.8": "emit";
182
- readonly "anthropic/claude-sonnet-4.6": "emit";
183
- readonly "openai/gpt-5.5": "omit";
184
- readonly "openai/gpt-5.4-mini": "omit";
185
- readonly "gpt-5.6": "omit";
186
- readonly "gpt-5.6-terra": "omit";
187
- readonly "gpt-5.6-luna": "omit";
188
- readonly "gpt-5.5": "omit";
189
- readonly "gpt-5.4": "emit";
190
- readonly "gpt-5.4-mini": "emit";
191
- readonly "gpt-5.4-nano": "emit";
192
- readonly "gpt-5.2": "emit";
193
- readonly "claude-sonnet-5": "omit";
194
- readonly "claude-fable-5-1": "omit";
195
- readonly "claude-fable-5": "omit";
196
- readonly "claude-opus-5": "omit";
197
- readonly "claude-opus-4-8": "omit";
198
- readonly "claude-opus-4-7": "omit";
199
- readonly "claude-sonnet-4-6": "emit";
200
- readonly "claude-opus-4-6": "emit";
201
- readonly "claude-haiku-4-5-20251001": "emit";
202
- readonly "us.anthropic.claude-sonnet-4-5-20250929-v1:0": "emit";
203
- readonly "us.anthropic.claude-haiku-4-5-20251001-v1:0": "emit";
204
- readonly "us.amazon.nova-pro-v1:0": "emit";
205
- readonly "us.amazon.nova-lite-v1:0": "emit";
206
- readonly "us.amazon.nova-micro-v1:0": "emit";
207
- readonly "openai.gpt-oss-120b-1:0": "emit";
208
- readonly "openai.gpt-oss-20b-1:0": "emit";
209
- readonly "us.deepseek.r1-v1:0": "emit";
210
- readonly "mistral-large-latest": "emit";
211
- readonly "mistral-medium-latest": "emit";
212
- readonly "mistral-small-latest": "emit";
213
- readonly "magistral-medium-latest": "emit";
214
- readonly "magistral-small": "emit";
215
- readonly "pixtral-large-latest": "emit";
216
- };
217
- //#endregion
218
- //#region src/index.d.ts
219
- /**
220
- * Logical model roles. Call sites declare *what* they need, not
221
- * *which* model to use.
222
- *
223
- * - fast: classification, extraction, short generation
224
- * - chat: conversational with tool use and streaming
225
- * - reasoning: complex multi-step legal analysis
226
- * - pdf: native PDF/image understanding
227
- */
228
- declare const MODEL_ROLES: readonly ["fast", "chat", "reasoning", "pdf"];
229
- type ModelRole = (typeof MODEL_ROLES)[number];
230
- declare const TEMPERATURE_POLICIES: readonly ["emit", "omit"];
231
- type TemperaturePolicy = (typeof TEMPERATURE_POLICIES)[number];
232
- declare const AI_PROVIDERS: readonly ["google", "openrouter", "openai", "azure_foundry", "anthropic", "bedrock", "mistral", "openai_compatible", "huggingface"];
233
- type AIProvider = (typeof AI_PROVIDERS)[number];
234
- declare const AI_PROVIDER_ADAPTER_KIND: {
235
- readonly google: "tanstack";
236
- readonly openrouter: "tanstack";
237
- readonly openai: "tanstack";
238
- readonly azure_foundry: "custom";
239
- readonly anthropic: "tanstack";
240
- readonly bedrock: "tanstack";
241
- readonly mistral: "tanstack";
242
- readonly openai_compatible: "custom";
243
- readonly huggingface: "custom";
244
- };
245
- type TanStackAIProvider = { [TProvider in AIProvider]: (typeof AI_PROVIDER_ADAPTER_KIND)[TProvider] extends "tanstack" ? TProvider : never; }[AIProvider];
246
- declare const TANSTACK_AI_PROVIDERS: readonly ["google", "openrouter", "openai", "anthropic", "bedrock", "mistral"];
247
- declare const MODEL_CATALOG_PROVIDER_KIND: {
248
- readonly google: "first-party";
249
- readonly openrouter: "aggregator";
250
- readonly openai: "first-party";
251
- readonly anthropic: "first-party";
252
- readonly bedrock: "platform";
253
- readonly mistral: "first-party";
254
- };
255
- /** Providers whose picker IDs map directly to public first-party catalogs. */
256
- type FirstPartyModelProvider = { [TProvider in TanStackAIProvider]: (typeof MODEL_CATALOG_PROVIDER_KIND)[TProvider] extends "first-party" ? TProvider : never; }[TanStackAIProvider];
257
- declare const FIRST_PARTY_MODEL_PROVIDER_VALUES: readonly ["google", "openai", "anthropic", "mistral"];
258
- /**
259
- * Runtime form of the first-party provider union. The conditional annotation
260
- * makes adding a first-party policy without adding its discovery implementation
261
- * a compile error.
262
- */
263
- declare const FIRST_PARTY_MODEL_PROVIDERS: Exclude<FirstPartyModelProvider, (typeof FIRST_PARTY_MODEL_PROVIDER_VALUES)[number]> extends never ? typeof FIRST_PARTY_MODEL_PROVIDER_VALUES : never;
264
- /**
265
- * Per-role default model IDs for the BYOK-capable cloud providers.
266
- * Shared between the instance default table (`DEFAULT_MODELS`) and the
267
- * settings-UI default selection, so a default is defined exactly once.
268
- */
269
- declare const BYOK_DEFAULT_MODELS: {
270
- readonly google: {
271
- readonly fast: "gemini-3.7-flash";
272
- readonly chat: "gemini-3.7-flash";
273
- readonly reasoning: "gemini-3.7-flash";
274
- readonly pdf: "gemini-3.7-flash";
275
- };
276
- readonly openrouter: {
277
- readonly fast: "openai/gpt-5.6-luna";
278
- readonly chat: "openai/gpt-5.6-terra";
279
- readonly reasoning: "openai/gpt-5.6-terra";
280
- readonly pdf: "openai/gpt-5.6-terra";
281
- };
282
- readonly openai: {
283
- readonly fast: "gpt-5.4-nano";
284
- readonly chat: "gpt-5.4-mini";
285
- readonly reasoning: "gpt-5.4";
286
- readonly pdf: "gpt-5.4";
287
- };
288
- readonly anthropic: {
289
- readonly fast: "claude-opus-5";
290
- readonly chat: "claude-opus-5";
291
- readonly reasoning: "claude-opus-5";
292
- readonly pdf: "claude-opus-5";
293
- };
294
- readonly bedrock: {
295
- readonly fast: "us.amazon.nova-micro-v1:0";
296
- readonly chat: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
297
- readonly reasoning: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
298
- readonly pdf: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
299
- };
300
- readonly mistral: {
301
- readonly fast: "mistral-small-latest";
302
- readonly chat: "mistral-medium-latest";
303
- readonly reasoning: "magistral-medium-latest";
304
- readonly pdf: "mistral-large-latest";
305
- };
306
- };
307
- /**
308
- * Instance-level default model IDs per provider. Extends the BYOK
309
- * defaults with the providers that only the instance path uses
310
- * (custom deployments and OpenAI-compatible endpoints).
311
- */
312
- declare const DEFAULT_MODELS: {
313
- readonly azure_foundry: {
314
- readonly fast: "gpt-5.4-nano";
315
- readonly chat: "gpt-5.4-mini";
316
- readonly reasoning: "gpt-5.4";
317
- readonly pdf: "gpt-5.4";
318
- };
319
- readonly openai_compatible: {
320
- readonly fast: "default";
321
- readonly chat: "default";
322
- readonly reasoning: "default";
323
- readonly pdf: "default";
324
- };
325
- readonly huggingface: {
326
- readonly fast: "speakleash/Bielik-1.5B-v3.0-Instruct";
327
- readonly chat: "speakleash/Bielik-11B-v2.3-Instruct";
328
- readonly reasoning: "speakleash/Bielik-11B-v2.3-Instruct";
329
- readonly pdf: "speakleash/Bielik-11B-v2.3-Instruct";
330
- };
331
- readonly google: {
332
- readonly fast: "gemini-3.7-flash";
333
- readonly chat: "gemini-3.7-flash";
334
- readonly reasoning: "gemini-3.7-flash";
335
- readonly pdf: "gemini-3.7-flash";
336
- };
337
- readonly openrouter: {
338
- readonly fast: "openai/gpt-5.6-luna";
339
- readonly chat: "openai/gpt-5.6-terra";
340
- readonly reasoning: "openai/gpt-5.6-terra";
341
- readonly pdf: "openai/gpt-5.6-terra";
342
- };
343
- readonly openai: {
344
- readonly fast: "gpt-5.4-nano";
345
- readonly chat: "gpt-5.4-mini";
346
- readonly reasoning: "gpt-5.4";
347
- readonly pdf: "gpt-5.4";
348
- };
349
- readonly anthropic: {
350
- readonly fast: "claude-opus-5";
351
- readonly chat: "claude-opus-5";
352
- readonly reasoning: "claude-opus-5";
353
- readonly pdf: "claude-opus-5";
354
- };
355
- readonly bedrock: {
356
- readonly fast: "us.amazon.nova-micro-v1:0";
357
- readonly chat: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
358
- readonly reasoning: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
359
- readonly pdf: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
360
- };
361
- readonly mistral: {
362
- readonly fast: "mistral-small-latest";
363
- readonly chat: "mistral-medium-latest";
364
- readonly reasoning: "magistral-medium-latest";
365
- readonly pdf: "mistral-large-latest";
366
- };
367
- };
2
+ //#region src/model-rate.d.ts
368
3
  /**
369
- * BYOK-offered model IDs per provider — the curated catalog users pick
370
- * from in org settings, and the server-side allowlist the API enforces.
371
- * The frontend list is not a security boundary; this is what the API
372
- * accepts.
373
- *
374
- * Limited to providers the TanStack AI integration supports for BYOK.
375
- * Providers without a first-class TanStack adapter path are intentionally
376
- * not accepted at this boundary.
4
+ * models.dev publishes USD prices per one million tokens. Stella stores the
5
+ * same rates as integer ledger units so usage arithmetic never depends on
6
+ * floating point values.
377
7
  */
378
- declare const BYOK_MODEL_OPTIONS: {
379
- readonly google: readonly ["gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash-lite", "gemini-3.1-pro-preview", "gemini-3.5-flash", "gemini-3.1-flash-lite"];
380
- readonly anthropic: readonly ["claude-sonnet-5", "claude-fable-5-1", "claude-fable-5", "claude-opus-5", "claude-opus-4-8", "claude-opus-4-7", "claude-sonnet-4-6", "claude-opus-4-6", "claude-haiku-4-5-20251001"];
381
- readonly openai: readonly ["gpt-5.6", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.2"];
382
- readonly openrouter: readonly ["openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "google/gemini-3.8-flash", "google/gemini-3.7-flash", "google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "google/gemini-3.1-pro-preview", "google/gemini-3.5-flash", "google/gemini-3.1-flash-lite", "anthropic/claude-sonnet-5", "anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "anthropic/claude-sonnet-4.6", "openai/gpt-5.5", "openai/gpt-5.4-mini"];
383
- readonly bedrock: readonly ["us.anthropic.claude-sonnet-4-5-20250929-v1:0", "us.anthropic.claude-haiku-4-5-20251001-v1:0", "us.amazon.nova-pro-v1:0", "us.amazon.nova-lite-v1:0", "us.amazon.nova-micro-v1:0", "openai.gpt-oss-120b-1:0", "openai.gpt-oss-20b-1:0", "us.deepseek.r1-v1:0"];
384
- readonly mistral: readonly ["mistral-large-latest", "mistral-medium-latest", "mistral-small-latest", "magistral-medium-latest", "magistral-small", "pixtral-large-latest"];
385
- };
386
- type BYOKProvider = keyof typeof BYOK_MODEL_OPTIONS;
387
- type BYOKModelIdByProvider = { [TProvider in BYOKProvider]: (typeof BYOK_MODEL_OPTIONS)[TProvider][number]; };
388
- type OfferedBYOKModelId = BYOKModelIdByProvider[BYOKProvider];
389
- type ModelDisplayMetadata = {
390
- /** Human-readable product name; model names are trademarks and stay untranslated. */
391
- displayName: string;
392
- /** Brand mark to show. This may differ from the routing provider. */
393
- iconProvider: BYOKProvider;
8
+ declare const MODEL_RATE_UNITS_PER_USD = 100000;
9
+ type ModelRateAmounts = {
10
+ /** Normalized ledger units per 1M input tokens. */
11
+ inputPerMTok: number;
12
+ /** Normalized ledger units per 1M output tokens. */
13
+ outputPerMTok: number;
14
+ /**
15
+ * Normalized ledger units per 1M cached input tokens, when the provider
16
+ * offers a cache-read adjustment. Falls back to `inputPerMTok` when absent.
17
+ */
18
+ cachedInputPerMTok?: number;
19
+ /**
20
+ * Normalized ledger units per 1M tokens written to a prompt cache. Falls
21
+ * back to `inputPerMTok` when absent.
22
+ */
23
+ cachedWriteInputPerMTok?: number;
394
24
  };
395
25
  /**
396
- * Presentation metadata for every offered model. Keeping this exhaustive beside
397
- * the allowlist prevents a newly offered model from leaking a raw provider ID
398
- * into user-facing pickers. OpenRouter entries deliberately carry their model
399
- * creator's icon while their routing provider remains available separately.
26
+ * A discriminated rate schedule. Consumers resolve the schedule from the
27
+ * request's total input tokens before reading any prices, so a model with a
28
+ * long-context premium cannot accidentally be metered at its base rate.
400
29
  */
401
- declare const MODEL_DISPLAY_METADATA: {
30
+ type ModelRate = ({
31
+ kind: "flat";
32
+ } & ModelRateAmounts) | {
33
+ kind: "input-token-tiered";
34
+ /** The base tier applies at or below this total input-token count. */
35
+ inputTokenThreshold: number;
36
+ standard: ModelRateAmounts;
37
+ /** Applies to the entire request once input exceeds the threshold. */
38
+ aboveThreshold: ModelRateAmounts;
39
+ };
40
+ declare const getStandardModelRate: (rate: ModelRate) => ModelRateAmounts;
41
+ declare const resolveModelRate: (rate: ModelRate, inputTokens: number) => ModelRateAmounts;
42
+ //#endregion
43
+ //#region src/model-rates.gen.d.ts
44
+ declare const MODEL_RATES: {
402
45
  readonly "gemini-3.8-flash": {
403
- readonly displayName: "Gemini 3.8 Flash";
404
- readonly iconProvider: "google";
46
+ readonly kind: "flat";
47
+ readonly inputPerMTok: 75000;
48
+ readonly outputPerMTok: 375000;
49
+ readonly cachedInputPerMTok: 7500;
405
50
  };
406
51
  readonly "gemini-3.7-flash": {
407
- readonly displayName: "Gemini 3.7 Flash";
408
- readonly iconProvider: "google";
52
+ readonly kind: "flat";
53
+ readonly inputPerMTok: 75000;
54
+ readonly outputPerMTok: 375000;
55
+ readonly cachedInputPerMTok: 7500;
409
56
  };
410
57
  readonly "gemini-3.6-flash": {
411
- readonly displayName: "Gemini 3.6 Flash";
412
- readonly iconProvider: "google";
58
+ readonly kind: "flat";
59
+ readonly inputPerMTok: 75000;
60
+ readonly outputPerMTok: 375000;
61
+ readonly cachedInputPerMTok: 7500;
413
62
  };
414
63
  readonly "gemini-3.5-flash-lite": {
415
- readonly displayName: "Gemini 3.5 Flash Lite";
416
- readonly iconProvider: "google";
64
+ readonly kind: "flat";
65
+ readonly inputPerMTok: 30000;
66
+ readonly outputPerMTok: 250000;
67
+ readonly cachedInputPerMTok: 3000;
417
68
  };
418
69
  readonly "gemini-3.1-pro-preview": {
419
- readonly displayName: "Gemini 3.1 Pro Preview";
420
- readonly iconProvider: "google";
70
+ readonly kind: "input-token-tiered";
71
+ readonly inputTokenThreshold: 200000;
72
+ readonly standard: {
73
+ readonly inputPerMTok: 200000;
74
+ readonly outputPerMTok: 1200000;
75
+ readonly cachedInputPerMTok: 20000;
76
+ };
77
+ readonly aboveThreshold: {
78
+ readonly inputPerMTok: 400000;
79
+ readonly outputPerMTok: 1800000;
80
+ readonly cachedInputPerMTok: 40000;
81
+ };
421
82
  };
422
83
  readonly "gemini-3.5-flash": {
423
- readonly displayName: "Gemini 3.5 Flash";
424
- readonly iconProvider: "google";
84
+ readonly kind: "flat";
85
+ readonly inputPerMTok: 150000;
86
+ readonly outputPerMTok: 900000;
87
+ readonly cachedInputPerMTok: 15000;
425
88
  };
426
89
  readonly "gemini-3.1-flash-lite": {
427
- readonly displayName: "Gemini 3.1 Flash Lite";
428
- readonly iconProvider: "google";
429
- };
430
- readonly "claude-sonnet-5": {
431
- readonly displayName: "Claude Sonnet 5";
432
- readonly iconProvider: "anthropic";
433
- };
434
- readonly "claude-fable-5-1": {
435
- readonly displayName: "Claude Fable 5.1";
436
- readonly iconProvider: "anthropic";
437
- };
438
- readonly "claude-fable-5": {
439
- readonly displayName: "Claude Fable 5";
440
- readonly iconProvider: "anthropic";
441
- };
442
- readonly "claude-opus-5": {
443
- readonly displayName: "Claude Opus 5";
444
- readonly iconProvider: "anthropic";
445
- };
446
- readonly "claude-opus-4-8": {
447
- readonly displayName: "Claude Opus 4.8";
448
- readonly iconProvider: "anthropic";
449
- };
450
- readonly "claude-opus-4-7": {
451
- readonly displayName: "Claude Opus 4.7";
452
- readonly iconProvider: "anthropic";
453
- };
454
- readonly "claude-sonnet-4-6": {
455
- readonly displayName: "Claude Sonnet 4.6";
456
- readonly iconProvider: "anthropic";
457
- };
458
- readonly "claude-opus-4-6": {
459
- readonly displayName: "Claude Opus 4.6";
460
- readonly iconProvider: "anthropic";
90
+ readonly kind: "flat";
91
+ readonly inputPerMTok: 25000;
92
+ readonly outputPerMTok: 150000;
93
+ readonly cachedInputPerMTok: 2500;
461
94
  };
462
- readonly "claude-haiku-4-5-20251001": {
463
- readonly displayName: "Claude Haiku 4.5";
464
- readonly iconProvider: "anthropic";
95
+ readonly "gpt-6-astra": {
96
+ readonly kind: "input-token-tiered";
97
+ readonly inputTokenThreshold: 272000;
98
+ readonly standard: {
99
+ readonly inputPerMTok: 1000000;
100
+ readonly outputPerMTok: 5000000;
101
+ readonly cachedInputPerMTok: 100000;
102
+ readonly cachedWriteInputPerMTok: 1250000;
103
+ };
104
+ readonly aboveThreshold: {
105
+ readonly inputPerMTok: 2000000;
106
+ readonly outputPerMTok: 7500000;
107
+ readonly cachedInputPerMTok: 200000;
108
+ readonly cachedWriteInputPerMTok: 2500000;
109
+ };
465
110
  };
466
111
  readonly "gpt-5.6": {
467
- readonly displayName: "GPT-5.6 Sol";
468
- readonly iconProvider: "openai";
112
+ readonly kind: "input-token-tiered";
113
+ readonly inputTokenThreshold: 272000;
114
+ readonly standard: {
115
+ readonly inputPerMTok: 400000;
116
+ readonly outputPerMTok: 2000000;
117
+ readonly cachedInputPerMTok: 40000;
118
+ readonly cachedWriteInputPerMTok: 500000;
119
+ };
120
+ readonly aboveThreshold: {
121
+ readonly inputPerMTok: 800000;
122
+ readonly outputPerMTok: 3000000;
123
+ readonly cachedInputPerMTok: 80000;
124
+ readonly cachedWriteInputPerMTok: 1000000;
125
+ };
469
126
  };
470
127
  readonly "gpt-5.6-terra": {
471
- readonly displayName: "GPT-5.6 Terra";
472
- readonly iconProvider: "openai";
128
+ readonly kind: "input-token-tiered";
129
+ readonly inputTokenThreshold: 272000;
130
+ readonly standard: {
131
+ readonly inputPerMTok: 200000;
132
+ readonly outputPerMTok: 1200000;
133
+ readonly cachedInputPerMTok: 20000;
134
+ readonly cachedWriteInputPerMTok: 250000;
135
+ };
136
+ readonly aboveThreshold: {
137
+ readonly inputPerMTok: 400000;
138
+ readonly outputPerMTok: 1800000;
139
+ readonly cachedInputPerMTok: 40000;
140
+ readonly cachedWriteInputPerMTok: 500000;
141
+ };
473
142
  };
474
143
  readonly "gpt-5.6-luna": {
475
- readonly displayName: "GPT-5.6 Luna";
476
- readonly iconProvider: "openai";
144
+ readonly kind: "input-token-tiered";
145
+ readonly inputTokenThreshold: 272000;
146
+ readonly standard: {
147
+ readonly inputPerMTok: 20000;
148
+ readonly outputPerMTok: 120000;
149
+ readonly cachedInputPerMTok: 2000;
150
+ readonly cachedWriteInputPerMTok: 25000;
151
+ };
152
+ readonly aboveThreshold: {
153
+ readonly inputPerMTok: 40000;
154
+ readonly outputPerMTok: 180000;
155
+ readonly cachedInputPerMTok: 4000;
156
+ readonly cachedWriteInputPerMTok: 50000;
157
+ };
477
158
  };
478
159
  readonly "gpt-5.5": {
479
- readonly displayName: "GPT-5.5";
480
- readonly iconProvider: "openai";
160
+ readonly kind: "input-token-tiered";
161
+ readonly inputTokenThreshold: 272000;
162
+ readonly standard: {
163
+ readonly inputPerMTok: 500000;
164
+ readonly outputPerMTok: 3000000;
165
+ readonly cachedInputPerMTok: 50000;
166
+ };
167
+ readonly aboveThreshold: {
168
+ readonly inputPerMTok: 1000000;
169
+ readonly outputPerMTok: 4500000;
170
+ readonly cachedInputPerMTok: 100000;
171
+ };
481
172
  };
482
173
  readonly "gpt-5.4": {
483
- readonly displayName: "GPT-5.4";
484
- readonly iconProvider: "openai";
174
+ readonly kind: "input-token-tiered";
175
+ readonly inputTokenThreshold: 272000;
176
+ readonly standard: {
177
+ readonly inputPerMTok: 250000;
178
+ readonly outputPerMTok: 1500000;
179
+ readonly cachedInputPerMTok: 25000;
180
+ };
181
+ readonly aboveThreshold: {
182
+ readonly inputPerMTok: 500000;
183
+ readonly outputPerMTok: 2250000;
184
+ readonly cachedInputPerMTok: 50000;
185
+ };
485
186
  };
486
187
  readonly "gpt-5.4-mini": {
487
- readonly displayName: "GPT-5.4 Mini";
488
- readonly iconProvider: "openai";
489
- };
490
- readonly "gpt-5.4-nano": {
491
- readonly displayName: "GPT-5.4 Nano";
492
- readonly iconProvider: "openai";
493
- };
494
- readonly "gpt-5.2": {
495
- readonly displayName: "GPT-5.2";
496
- readonly iconProvider: "openai";
497
- };
498
- readonly "openai/gpt-5.6-luna": {
499
- readonly displayName: "GPT-5.6 Luna";
500
- readonly iconProvider: "openai";
501
- };
502
- readonly "openai/gpt-5.6-terra": {
503
- readonly displayName: "GPT-5.6 Terra";
504
- readonly iconProvider: "openai";
505
- };
506
- readonly "google/gemini-3.8-flash": {
507
- readonly displayName: "Gemini 3.8 Flash";
508
- readonly iconProvider: "google";
509
- };
510
- readonly "google/gemini-3.7-flash": {
511
- readonly displayName: "Gemini 3.7 Flash";
512
- readonly iconProvider: "google";
513
- };
514
- readonly "google/gemini-3.6-flash": {
515
- readonly displayName: "Gemini 3.6 Flash";
516
- readonly iconProvider: "google";
188
+ readonly kind: "flat";
189
+ readonly inputPerMTok: 75000;
190
+ readonly outputPerMTok: 450000;
191
+ readonly cachedInputPerMTok: 7500;
517
192
  };
518
- readonly "google/gemini-3.5-flash-lite": {
519
- readonly displayName: "Gemini 3.5 Flash Lite";
520
- readonly iconProvider: "google";
193
+ readonly "gpt-5.4-nano": {
194
+ readonly kind: "flat";
195
+ readonly inputPerMTok: 20000;
196
+ readonly outputPerMTok: 125000;
197
+ readonly cachedInputPerMTok: 2000;
521
198
  };
522
- readonly "google/gemini-3.1-pro-preview": {
523
- readonly displayName: "Gemini 3.1 Pro Preview";
524
- readonly iconProvider: "google";
199
+ readonly "gpt-5.2": {
200
+ readonly kind: "flat";
201
+ readonly inputPerMTok: 175000;
202
+ readonly outputPerMTok: 1400000;
203
+ readonly cachedInputPerMTok: 17500;
525
204
  };
526
- readonly "google/gemini-3.5-flash": {
527
- readonly displayName: "Gemini 3.5 Flash";
528
- readonly iconProvider: "google";
205
+ readonly "claude-sonnet-5": {
206
+ readonly kind: "flat";
207
+ readonly inputPerMTok: 200000;
208
+ readonly outputPerMTok: 1000000;
209
+ readonly cachedInputPerMTok: 20000;
210
+ readonly cachedWriteInputPerMTok: 250000;
529
211
  };
530
- readonly "google/gemini-3.1-flash-lite": {
531
- readonly displayName: "Gemini 3.1 Flash Lite";
532
- readonly iconProvider: "google";
212
+ readonly "claude-fable-5-1": {
213
+ readonly kind: "flat";
214
+ readonly inputPerMTok: 1000000;
215
+ readonly outputPerMTok: 5000000;
216
+ readonly cachedInputPerMTok: 25000;
217
+ readonly cachedWriteInputPerMTok: 1250000;
533
218
  };
534
- readonly "anthropic/claude-sonnet-5": {
535
- readonly displayName: "Claude Sonnet 5";
536
- readonly iconProvider: "anthropic";
219
+ readonly "claude-fable-5": {
220
+ readonly kind: "flat";
221
+ readonly inputPerMTok: 1000000;
222
+ readonly outputPerMTok: 5000000;
223
+ readonly cachedInputPerMTok: 100000;
224
+ readonly cachedWriteInputPerMTok: 1250000;
537
225
  };
538
- readonly "anthropic/claude-opus-5": {
539
- readonly displayName: "Claude Opus 5";
540
- readonly iconProvider: "anthropic";
226
+ readonly "claude-opus-5": {
227
+ readonly kind: "flat";
228
+ readonly inputPerMTok: 500000;
229
+ readonly outputPerMTok: 2500000;
230
+ readonly cachedInputPerMTok: 50000;
231
+ readonly cachedWriteInputPerMTok: 625000;
541
232
  };
542
- readonly "anthropic/claude-opus-4.8": {
543
- readonly displayName: "Claude Opus 4.8";
544
- readonly iconProvider: "anthropic";
233
+ readonly "claude-opus-4-8": {
234
+ readonly kind: "flat";
235
+ readonly inputPerMTok: 500000;
236
+ readonly outputPerMTok: 2500000;
237
+ readonly cachedInputPerMTok: 50000;
238
+ readonly cachedWriteInputPerMTok: 625000;
545
239
  };
546
- readonly "anthropic/claude-sonnet-4.6": {
547
- readonly displayName: "Claude Sonnet 4.6";
548
- readonly iconProvider: "anthropic";
240
+ readonly "claude-opus-4-7": {
241
+ readonly kind: "flat";
242
+ readonly inputPerMTok: 500000;
243
+ readonly outputPerMTok: 2500000;
244
+ readonly cachedInputPerMTok: 50000;
245
+ readonly cachedWriteInputPerMTok: 625000;
549
246
  };
550
- readonly "openai/gpt-5.5": {
551
- readonly displayName: "GPT-5.5";
552
- readonly iconProvider: "openai";
247
+ readonly "claude-sonnet-4-6": {
248
+ readonly kind: "flat";
249
+ readonly inputPerMTok: 300000;
250
+ readonly outputPerMTok: 1500000;
251
+ readonly cachedInputPerMTok: 30000;
252
+ readonly cachedWriteInputPerMTok: 375000;
553
253
  };
554
- readonly "openai/gpt-5.4-mini": {
555
- readonly displayName: "GPT-5.4 Mini";
556
- readonly iconProvider: "openai";
254
+ readonly "claude-opus-4-6": {
255
+ readonly kind: "flat";
256
+ readonly inputPerMTok: 500000;
257
+ readonly outputPerMTok: 2500000;
258
+ readonly cachedInputPerMTok: 50000;
259
+ readonly cachedWriteInputPerMTok: 625000;
260
+ };
261
+ readonly "claude-haiku-4-5-20251001": {
262
+ readonly kind: "flat";
263
+ readonly inputPerMTok: 100000;
264
+ readonly outputPerMTok: 500000;
265
+ readonly cachedInputPerMTok: 10000;
266
+ readonly cachedWriteInputPerMTok: 125000;
557
267
  };
558
268
  readonly "us.anthropic.claude-sonnet-4-5-20250929-v1:0": {
559
- readonly displayName: "Claude Sonnet 4.5";
560
- readonly iconProvider: "anthropic";
269
+ readonly kind: "flat";
270
+ readonly inputPerMTok: 300000;
271
+ readonly outputPerMTok: 1500000;
272
+ readonly cachedInputPerMTok: 30000;
273
+ readonly cachedWriteInputPerMTok: 375000;
561
274
  };
562
275
  readonly "us.anthropic.claude-haiku-4-5-20251001-v1:0": {
563
- readonly displayName: "Claude Haiku 4.5";
564
- readonly iconProvider: "anthropic";
276
+ readonly kind: "flat";
277
+ readonly inputPerMTok: 100000;
278
+ readonly outputPerMTok: 500000;
279
+ readonly cachedInputPerMTok: 10000;
280
+ readonly cachedWriteInputPerMTok: 125000;
565
281
  };
566
282
  readonly "us.amazon.nova-pro-v1:0": {
567
- readonly displayName: "Amazon Nova Pro";
568
- readonly iconProvider: "bedrock";
283
+ readonly kind: "flat";
284
+ readonly inputPerMTok: 80000;
285
+ readonly outputPerMTok: 320000;
286
+ readonly cachedInputPerMTok: 20000;
569
287
  };
570
288
  readonly "us.amazon.nova-lite-v1:0": {
571
- readonly displayName: "Amazon Nova Lite";
572
- readonly iconProvider: "bedrock";
289
+ readonly kind: "flat";
290
+ readonly inputPerMTok: 6000;
291
+ readonly outputPerMTok: 24000;
292
+ readonly cachedInputPerMTok: 1500;
573
293
  };
574
294
  readonly "us.amazon.nova-micro-v1:0": {
575
- readonly displayName: "Amazon Nova Micro";
576
- readonly iconProvider: "bedrock";
295
+ readonly kind: "flat";
296
+ readonly inputPerMTok: 3500;
297
+ readonly outputPerMTok: 14000;
298
+ readonly cachedInputPerMTok: 875;
577
299
  };
578
300
  readonly "openai.gpt-oss-120b-1:0": {
579
- readonly displayName: "GPT OSS 120B";
580
- readonly iconProvider: "openai";
301
+ readonly kind: "flat";
302
+ readonly inputPerMTok: 15000;
303
+ readonly outputPerMTok: 60000;
581
304
  };
582
305
  readonly "openai.gpt-oss-20b-1:0": {
583
- readonly displayName: "GPT OSS 20B";
584
- readonly iconProvider: "openai";
306
+ readonly kind: "flat";
307
+ readonly inputPerMTok: 7000;
308
+ readonly outputPerMTok: 30000;
585
309
  };
586
310
  readonly "us.deepseek.r1-v1:0": {
587
- readonly displayName: "DeepSeek R1";
588
- readonly iconProvider: "bedrock";
311
+ readonly kind: "flat";
312
+ readonly inputPerMTok: 135000;
313
+ readonly outputPerMTok: 540000;
589
314
  };
590
315
  readonly "mistral-large-latest": {
591
- readonly displayName: "Mistral Large";
592
- readonly iconProvider: "mistral";
316
+ readonly kind: "flat";
317
+ readonly inputPerMTok: 50000;
318
+ readonly outputPerMTok: 150000;
593
319
  };
594
320
  readonly "mistral-medium-latest": {
595
- readonly displayName: "Mistral Medium";
596
- readonly iconProvider: "mistral";
321
+ readonly kind: "flat";
322
+ readonly inputPerMTok: 150000;
323
+ readonly outputPerMTok: 750000;
597
324
  };
598
325
  readonly "mistral-small-latest": {
599
- readonly displayName: "Mistral Small";
600
- readonly iconProvider: "mistral";
326
+ readonly kind: "flat";
327
+ readonly inputPerMTok: 15000;
328
+ readonly outputPerMTok: 60000;
601
329
  };
602
330
  readonly "magistral-medium-latest": {
603
- readonly displayName: "Magistral Medium";
604
- readonly iconProvider: "mistral";
331
+ readonly kind: "flat";
332
+ readonly inputPerMTok: 200000;
333
+ readonly outputPerMTok: 500000;
605
334
  };
606
335
  readonly "magistral-small": {
607
- readonly displayName: "Magistral Small";
608
- readonly iconProvider: "mistral";
336
+ readonly kind: "flat";
337
+ readonly inputPerMTok: 50000;
338
+ readonly outputPerMTok: 150000;
609
339
  };
610
340
  readonly "pixtral-large-latest": {
611
- readonly displayName: "Pixtral Large";
612
- readonly iconProvider: "mistral";
341
+ readonly kind: "flat";
342
+ readonly inputPerMTok: 200000;
343
+ readonly outputPerMTok: 600000;
344
+ };
345
+ readonly "gemini-2.5-flash": {
346
+ readonly kind: "flat";
347
+ readonly inputPerMTok: 30000;
348
+ readonly outputPerMTok: 250000;
349
+ readonly cachedInputPerMTok: 3000;
350
+ };
351
+ readonly "gemini-2.5-pro": {
352
+ readonly kind: "input-token-tiered";
353
+ readonly inputTokenThreshold: 200000;
354
+ readonly standard: {
355
+ readonly inputPerMTok: 125000;
356
+ readonly outputPerMTok: 1000000;
357
+ readonly cachedInputPerMTok: 12500;
358
+ };
359
+ readonly aboveThreshold: {
360
+ readonly inputPerMTok: 250000;
361
+ readonly outputPerMTok: 1500000;
362
+ readonly cachedInputPerMTok: 25000;
363
+ };
364
+ };
365
+ readonly "gpt-4o-mini": {
366
+ readonly kind: "flat";
367
+ readonly inputPerMTok: 15000;
368
+ readonly outputPerMTok: 60000;
369
+ readonly cachedInputPerMTok: 7500;
370
+ };
371
+ readonly "gpt-4o": {
372
+ readonly kind: "flat";
373
+ readonly inputPerMTok: 250000;
374
+ readonly outputPerMTok: 1000000;
375
+ readonly cachedInputPerMTok: 125000;
613
376
  };
614
377
  };
615
- declare const getModelDisplayMetadata: (modelId: string) => ModelDisplayMetadata | null;
378
+ //#endregion
379
+ //#region src/model-rate-policy.d.ts
380
+ declare const MODELS_DEV_RATE_PROVIDER_BY_CATALOG_PROVIDER: {
381
+ readonly google: "google";
382
+ readonly openai: "openai";
383
+ readonly anthropic: "anthropic";
384
+ readonly bedrock: "amazon-bedrock";
385
+ readonly mistral: "mistral";
386
+ };
387
+ type ModelsDevRateProvider = (typeof MODELS_DEV_RATE_PROVIDER_BY_CATALOG_PROVIDER)[keyof typeof MODELS_DEV_RATE_PROVIDER_BY_CATALOG_PROVIDER];
616
388
  /**
617
- * Offered models whose provider API accepts PDF/file content. Generated from
618
- * live models.dev input modalities plus dated, reviewed source corrections;
619
- * the nightly upstream check rejects drift.
389
+ * Explicit source coordinates for non-offered model IDs that remain valid in
390
+ * deployment overrides and usage attribution. Their numeric rates still come
391
+ * exclusively from models.dev.
620
392
  */
621
- declare const BYOK_DOCUMENT_INPUT_MODEL_OPTIONS: {
622
- readonly google: readonly ["gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash-lite", "gemini-3.1-pro-preview", "gemini-3.5-flash", "gemini-3.1-flash-lite"];
623
- readonly openrouter: readonly ["openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "google/gemini-3.8-flash", "google/gemini-3.7-flash", "google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "google/gemini-3.1-pro-preview", "google/gemini-3.5-flash", "google/gemini-3.1-flash-lite", "anthropic/claude-sonnet-5", "anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "anthropic/claude-sonnet-4.6", "openai/gpt-5.5", "openai/gpt-5.4-mini"];
624
- readonly openai: readonly ["gpt-5.6", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.2"];
625
- readonly anthropic: readonly ["claude-sonnet-5", "claude-fable-5-1", "claude-fable-5", "claude-opus-5", "claude-opus-4-8", "claude-opus-4-7", "claude-sonnet-4-6", "claude-opus-4-6", "claude-haiku-4-5-20251001"];
626
- readonly bedrock: readonly ["us.anthropic.claude-sonnet-4-5-20250929-v1:0", "us.anthropic.claude-haiku-4-5-20251001-v1:0", "us.amazon.nova-pro-v1:0", "us.amazon.nova-lite-v1:0"];
627
- readonly mistral: readonly [];
393
+ declare const RETAINED_MODELS_DEV_RATE_ENTRIES: {
394
+ readonly "gemini-2.5-flash": {
395
+ readonly modelId: "gemini-2.5-flash";
396
+ readonly provider: "google";
397
+ };
398
+ readonly "gemini-2.5-pro": {
399
+ readonly modelId: "gemini-2.5-pro";
400
+ readonly provider: "google";
401
+ };
402
+ readonly "gpt-4o-mini": {
403
+ readonly modelId: "gpt-4o-mini";
404
+ readonly provider: "openai";
405
+ };
406
+ readonly "gpt-4o": {
407
+ readonly modelId: "gpt-4o";
408
+ readonly provider: "openai";
409
+ };
628
410
  };
629
- declare const isBYOKProviderRoleSupported: ({ provider, role }: {
630
- provider: BYOKProvider;
631
- role: ModelRole;
632
- }) => boolean;
633
- declare const isBYOKModelRoleSupported: ({ provider, modelId, role }: {
634
- provider: BYOKProvider;
635
- modelId: string;
636
- role: ModelRole;
637
- }) => boolean;
638
411
  /**
639
- * Models whose provider adapter can receive a PDF `document` content part in a
640
- * chat turn without throwing. This is a narrower, runtime question than the
641
- * pdf ROLE (`BYOK_DOCUMENT_INPUT_MODEL_OPTIONS`, which curates model selection
642
- * for PDF-processing flows): it only asks "will the chat stream survive this
643
- * attachment." The Mistral text adapter maps PDF `document` parts to
644
- * `document_url`, so its
645
- * vision models accept PDF attachments even though Mistral is deliberately not
646
- * offered as a pdf-role provider. Mistral's `document_url` takes PDF but NOT
647
- * textual documents (docx/txt/csv/md), so those still gate on
648
- * `BYOK_DOCUMENT_INPUT_MODEL_OPTIONS` (which excludes Mistral). Superset
649
- * invariant: every pdf-role document model also accepts a PDF chat attachment.
412
+ * Exact mappings where Stella uses a provider routing ID while models.dev
413
+ * publishes pricing under the corresponding base model ID. Generation rejects
414
+ * a mapping once models.dev begins publishing the Stella ID directly.
650
415
  */
651
- declare const CHAT_PDF_ATTACHMENT_MODEL_OPTIONS: {
652
- readonly mistral: readonly ["mistral-medium-latest", "mistral-small-latest", "pixtral-large-latest"];
653
- readonly google: readonly ["gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash-lite", "gemini-3.1-pro-preview", "gemini-3.5-flash", "gemini-3.1-flash-lite"];
654
- readonly openrouter: readonly ["openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "google/gemini-3.8-flash", "google/gemini-3.7-flash", "google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "google/gemini-3.1-pro-preview", "google/gemini-3.5-flash", "google/gemini-3.1-flash-lite", "anthropic/claude-sonnet-5", "anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "anthropic/claude-sonnet-4.6", "openai/gpt-5.5", "openai/gpt-5.4-mini"];
655
- readonly openai: readonly ["gpt-5.6", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.2"];
656
- readonly anthropic: readonly ["claude-sonnet-5", "claude-fable-5-1", "claude-fable-5", "claude-opus-5", "claude-opus-4-8", "claude-opus-4-7", "claude-sonnet-4-6", "claude-opus-4-6", "claude-haiku-4-5-20251001"];
657
- readonly bedrock: readonly ["us.anthropic.claude-sonnet-4-5-20250929-v1:0", "us.anthropic.claude-haiku-4-5-20251001-v1:0", "us.amazon.nova-pro-v1:0", "us.amazon.nova-lite-v1:0"];
416
+ declare const MODELS_DEV_RATE_SOURCE_ALIASES: {
417
+ readonly "us.amazon.nova-pro-v1:0": {
418
+ readonly modelId: "amazon.nova-pro-v1:0";
419
+ readonly provider: "amazon-bedrock";
420
+ readonly reason: string;
421
+ readonly sourceUrl: "https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html";
422
+ };
423
+ readonly "us.amazon.nova-lite-v1:0": {
424
+ readonly modelId: "amazon.nova-lite-v1:0";
425
+ readonly provider: "amazon-bedrock";
426
+ readonly reason: string;
427
+ readonly sourceUrl: "https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html";
428
+ };
429
+ readonly "us.amazon.nova-micro-v1:0": {
430
+ readonly modelId: "amazon.nova-micro-v1:0";
431
+ readonly provider: "amazon-bedrock";
432
+ readonly reason: string;
433
+ readonly sourceUrl: "https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html";
434
+ };
658
435
  };
659
- declare const isChatPdfAttachmentModelSupported: ({ provider, modelId }: {
660
- provider: BYOKProvider;
661
- modelId: string;
662
- }) => boolean;
436
+ //#endregion
437
+ //#region src/capabilities-overrides.d.ts
663
438
  /**
664
- * Resolve a model id that will actually work for this provider+role,
665
- * keeping the SAME provider. Returns the caller's model unchanged when
666
- * it is still offered; otherwise falls back to the provider's per-role
667
- * default (`BYOK_DEFAULT_MODELS`). Returns `null` only when the
668
- * provider has no valid model for the role at all — the sole case
669
- * today is `mistral` + `pdf`, because the TanStack Mistral adapter
670
- * exposes no `document` input modality, so no Mistral model (not even
671
- * the default) can serve the PDF role.
672
- *
673
- * Used to auto-heal org AI configs whose pinned model was removed by a
674
- * catalog bump, so generation resolves to a supported model instead of
675
- * 400-ing (or forwarding a retired id to the provider).
439
+ * Hand-declared capabilities for offered models that models.dev does
440
+ * not cover. The capability generator
441
+ * (`packages/scripts/src/model-catalog-capabilities-gen.ts`) refuses
442
+ * an override for any model the upstream source covers, so manual
443
+ * data cannot shadow sourced data — this file can only ever fill
444
+ * genuine gaps, each with a dated justification.
676
445
  */
677
- declare const resolveWorkingBYOKModelForRole: ({ provider, modelId, role }: {
678
- provider: BYOKProvider;
679
- modelId: string;
680
- role: ModelRole;
681
- }) => string | null;
446
+ type CapabilityOverride = {
447
+ documentInput: boolean;
448
+ documentInputReason: string;
449
+ reasoningEfforts: readonly ReasoningEffort[] | null;
450
+ temperatureSupported: boolean;
451
+ /** Why the upstream source cannot answer for this model. Dated. */
452
+ reason: string;
453
+ };
454
+ declare const CAPABILITY_OVERRIDES: Partial<Record<OfferedBYOKModelId, CapabilityOverride>>;
455
+ //#endregion
456
+ //#region src/document-input-overrides.d.ts
457
+ type DocumentInputOverride = {
458
+ /** Whether the model accepts a PDF/file content part. */
459
+ supported: boolean;
460
+ /** Why the live catalogue cannot answer correctly. Dated. */
461
+ reason: string;
462
+ };
682
463
  /**
683
- * Anthropic models that use the adaptive-thinking request shape
684
- * (`thinking: { type: "adaptive" }`). Newer Claude models reject the
685
- * legacy budget-based form, so every Opus 4.6+/Sonnet 4.6/Fable entry
686
- * offered above must appear here or it will 400 on the reasoning role.
464
+ * Reviewed document-input corrections for models.dev records that exist but
465
+ * under-report the provider API's file-input support. The generator rejects an
466
+ * override once upstream agrees, so sourced data takes ownership automatically.
687
467
  */
688
- declare const ANTHROPIC_ADAPTIVE_THINKING_MODELS: readonly ["claude-sonnet-5", "claude-opus-5", "claude-sonnet-4-6", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8", "claude-fable-5", "claude-fable-5-1"];
468
+ declare const DOCUMENT_INPUT_OVERRIDES: Partial<Record<OfferedBYOKModelId, DocumentInputOverride>>;
469
+ //#endregion
470
+ //#region src/capabilities.gen.d.ts
689
471
  /**
690
- * Canonical reasoning-effort ladder, ordered weakest to strongest.
691
- * Union of every effort keyword the offered providers accept; no
692
- * single model accepts all of them, which is exactly why the
693
- * generated per-model `MODEL_REASONING_EFFORTS` exists.
472
+ * Reasoning-effort values each offered model accepts, `null` when the
473
+ * model exposes no effort-style reasoning control. A missing `"none"`
474
+ * means the model's reasoning cannot be disabled; consumers must go
475
+ * through `resolveReasoningEffort`.
694
476
  */
695
- declare const REASONING_EFFORTS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
696
- type ReasoningEffort = (typeof REASONING_EFFORTS)[number];
697
- declare const resolvedReasoningEffortSchema: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"], undefined>, v.BrandAction<"none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "ResolvedReasoningEffort">]>;
477
+ declare const MODEL_REASONING_EFFORTS: {
478
+ readonly "gemini-3.8-flash": readonly ["low", "medium", "high"];
479
+ readonly "gemini-3.7-flash": readonly ["low", "medium", "high"];
480
+ readonly "gemini-3.6-flash": readonly ["minimal", "low", "medium", "high"];
481
+ readonly "gemini-3.5-flash-lite": readonly ["minimal", "low", "medium", "high"];
482
+ readonly "gemini-3.1-pro-preview": readonly ["low", "medium", "high"];
483
+ readonly "gemini-3.5-flash": readonly ["minimal", "low", "medium", "high"];
484
+ readonly "gemini-3.1-flash-lite": readonly ["minimal", "low", "medium", "high"];
485
+ readonly "openai/gpt-6-astra": readonly ["low", "medium", "high", "xhigh", "max"];
486
+ readonly "openai/gpt-5.6-luna": readonly ["none", "low", "medium", "high", "xhigh", "max"];
487
+ readonly "openai/gpt-5.6-terra": readonly ["none", "low", "medium", "high", "xhigh", "max"];
488
+ readonly "google/gemini-3.8-flash": readonly ["low", "medium", "high"];
489
+ readonly "google/gemini-3.7-flash": readonly ["low", "medium", "high"];
490
+ readonly "google/gemini-3.6-flash": readonly ["minimal", "low", "medium", "high"];
491
+ readonly "google/gemini-3.5-flash-lite": readonly ["minimal", "low", "medium", "high"];
492
+ readonly "google/gemini-3.1-pro-preview": readonly ["low", "medium", "high"];
493
+ readonly "google/gemini-3.5-flash": readonly ["minimal", "low", "medium", "high"];
494
+ readonly "google/gemini-3.1-flash-lite": readonly ["none", "minimal", "low", "medium", "high"];
495
+ readonly "anthropic/claude-sonnet-5": readonly ["none", "low", "medium", "high", "xhigh", "max"];
496
+ readonly "anthropic/claude-opus-5": readonly ["none", "low", "medium", "high", "xhigh", "max"];
497
+ readonly "anthropic/claude-opus-4.8": readonly ["none", "low", "medium", "high", "xhigh", "max"];
498
+ readonly "anthropic/claude-sonnet-4.6": readonly ["none", "low", "medium", "high", "max"];
499
+ readonly "openai/gpt-5.5": readonly ["none", "low", "medium", "high", "xhigh"];
500
+ readonly "openai/gpt-5.4-mini": readonly ["none", "low", "medium", "high", "xhigh"];
501
+ readonly "gpt-6-astra": readonly ["low", "medium", "high", "xhigh", "max"];
502
+ readonly "gpt-5.6": readonly ["none", "low", "medium", "high", "xhigh", "max"];
503
+ readonly "gpt-5.6-terra": readonly ["none", "low", "medium", "high", "xhigh", "max"];
504
+ readonly "gpt-5.6-luna": readonly ["none", "low", "medium", "high", "xhigh", "max"];
505
+ readonly "gpt-5.5": readonly ["none", "low", "medium", "high", "xhigh"];
506
+ readonly "gpt-5.4": readonly ["none", "low", "medium", "high", "xhigh"];
507
+ readonly "gpt-5.4-mini": readonly ["none", "low", "medium", "high", "xhigh"];
508
+ readonly "gpt-5.4-nano": readonly ["none", "low", "medium", "high", "xhigh"];
509
+ readonly "gpt-5.2": readonly ["none", "low", "medium", "high", "xhigh"];
510
+ readonly "claude-sonnet-5": readonly ["none", "low", "medium", "high", "xhigh", "max"];
511
+ readonly "claude-fable-5-1": readonly ["low", "medium", "high", "xhigh", "max"];
512
+ readonly "claude-fable-5": readonly ["low", "medium", "high", "xhigh", "max"];
513
+ readonly "claude-opus-5": readonly ["low", "medium", "high", "xhigh", "max"];
514
+ readonly "claude-opus-4-8": readonly ["low", "medium", "high", "xhigh", "max"];
515
+ readonly "claude-opus-4-7": readonly ["low", "medium", "high", "xhigh", "max"];
516
+ readonly "claude-sonnet-4-6": readonly ["low", "medium", "high", "max"];
517
+ readonly "claude-opus-4-6": readonly ["low", "medium", "high", "max"];
518
+ readonly "claude-haiku-4-5-20251001": null;
519
+ readonly "us.anthropic.claude-sonnet-4-5-20250929-v1:0": null;
520
+ readonly "us.anthropic.claude-haiku-4-5-20251001-v1:0": null;
521
+ readonly "us.amazon.nova-pro-v1:0": null;
522
+ readonly "us.amazon.nova-lite-v1:0": null;
523
+ readonly "us.amazon.nova-micro-v1:0": null;
524
+ readonly "openai.gpt-oss-120b-1:0": readonly ["low", "medium", "high"];
525
+ readonly "openai.gpt-oss-20b-1:0": readonly ["low", "medium", "high"];
526
+ readonly "us.deepseek.r1-v1:0": null;
527
+ readonly "mistral-large-latest": null;
528
+ readonly "mistral-medium-latest": readonly ["none", "high"];
529
+ readonly "mistral-small-latest": readonly ["none", "high"];
530
+ readonly "magistral-medium-latest": null;
531
+ readonly "magistral-small": null;
532
+ readonly "pixtral-large-latest": null;
533
+ };
698
534
  /**
699
- * A reasoning effort proven to be accepted by the model it targets.
700
- * Only `resolveReasoningEffort` can produce this type, so option
701
- * builders cannot hand a provider a literal effort the model rejects
702
- * (e.g. `"none"` to a model whose reasoning cannot be disabled) —
703
- * that mistake now fails typecheck instead of 502-ing at runtime.
535
+ * Concrete provider-default effort where the upstream catalogue publishes
536
+ * one. OpenRouter is the source today; null means the provider does not expose
537
+ * a truthful named default, so clients must retain a separate Default choice.
704
538
  */
705
- type ResolvedReasoningEffort = v.InferOutput<typeof resolvedReasoningEffortSchema>;
539
+ declare const MODEL_DEFAULT_REASONING_EFFORTS: {
540
+ readonly "gemini-3.8-flash": null;
541
+ readonly "gemini-3.7-flash": null;
542
+ readonly "gemini-3.6-flash": null;
543
+ readonly "gemini-3.5-flash-lite": null;
544
+ readonly "gemini-3.1-pro-preview": null;
545
+ readonly "gemini-3.5-flash": null;
546
+ readonly "gemini-3.1-flash-lite": null;
547
+ readonly "openai/gpt-6-astra": "medium";
548
+ readonly "openai/gpt-5.6-luna": "medium";
549
+ readonly "openai/gpt-5.6-terra": "medium";
550
+ readonly "google/gemini-3.8-flash": "medium";
551
+ readonly "google/gemini-3.7-flash": "medium";
552
+ readonly "google/gemini-3.6-flash": "medium";
553
+ readonly "google/gemini-3.5-flash-lite": "minimal";
554
+ readonly "google/gemini-3.1-pro-preview": "medium";
555
+ readonly "google/gemini-3.5-flash": "medium";
556
+ readonly "google/gemini-3.1-flash-lite": "minimal";
557
+ readonly "anthropic/claude-sonnet-5": "high";
558
+ readonly "anthropic/claude-opus-5": "high";
559
+ readonly "anthropic/claude-opus-4.8": "high";
560
+ readonly "anthropic/claude-sonnet-4.6": "medium";
561
+ readonly "openai/gpt-5.5": "medium";
562
+ readonly "openai/gpt-5.4-mini": "medium";
563
+ readonly "gpt-6-astra": null;
564
+ readonly "gpt-5.6": null;
565
+ readonly "gpt-5.6-terra": null;
566
+ readonly "gpt-5.6-luna": null;
567
+ readonly "gpt-5.5": null;
568
+ readonly "gpt-5.4": null;
569
+ readonly "gpt-5.4-mini": null;
570
+ readonly "gpt-5.4-nano": null;
571
+ readonly "gpt-5.2": null;
572
+ readonly "claude-sonnet-5": null;
573
+ readonly "claude-fable-5-1": null;
574
+ readonly "claude-fable-5": null;
575
+ readonly "claude-opus-5": null;
576
+ readonly "claude-opus-4-8": null;
577
+ readonly "claude-opus-4-7": null;
578
+ readonly "claude-sonnet-4-6": null;
579
+ readonly "claude-opus-4-6": null;
580
+ readonly "claude-haiku-4-5-20251001": null;
581
+ readonly "us.anthropic.claude-sonnet-4-5-20250929-v1:0": null;
582
+ readonly "us.anthropic.claude-haiku-4-5-20251001-v1:0": null;
583
+ readonly "us.amazon.nova-pro-v1:0": null;
584
+ readonly "us.amazon.nova-lite-v1:0": null;
585
+ readonly "us.amazon.nova-micro-v1:0": null;
586
+ readonly "openai.gpt-oss-120b-1:0": null;
587
+ readonly "openai.gpt-oss-20b-1:0": null;
588
+ readonly "us.deepseek.r1-v1:0": null;
589
+ readonly "mistral-large-latest": null;
590
+ readonly "mistral-medium-latest": null;
591
+ readonly "mistral-small-latest": null;
592
+ readonly "magistral-medium-latest": null;
593
+ readonly "magistral-small": null;
594
+ readonly "pixtral-large-latest": null;
595
+ };
706
596
  /**
707
- * Provider-native IDs that are exact aliases of an offered catalog ID.
708
- * Every metadata lookup normalizes here, so instance/dev overrides cannot
709
- * bypass rates or capabilities and duplicated alias rows cannot drift apart.
597
+ * Whether stella should emit a `temperature` sampling override.
598
+ * `"omit"` covers rejected, deprecated, and accepted-but-ignored
599
+ * parameters. Consumers must go through `shouldEmitTemperature`.
710
600
  */
601
+ declare const MODEL_TEMPERATURE_POLICIES: {
602
+ readonly "gemini-3.8-flash": "omit";
603
+ readonly "gemini-3.7-flash": "omit";
604
+ readonly "gemini-3.6-flash": "omit";
605
+ readonly "gemini-3.5-flash-lite": "omit";
606
+ readonly "gemini-3.1-pro-preview": "emit";
607
+ readonly "gemini-3.5-flash": "emit";
608
+ readonly "gemini-3.1-flash-lite": "emit";
609
+ readonly "openai/gpt-6-astra": "omit";
610
+ readonly "openai/gpt-5.6-luna": "omit";
611
+ readonly "openai/gpt-5.6-terra": "omit";
612
+ readonly "google/gemini-3.8-flash": "omit";
613
+ readonly "google/gemini-3.7-flash": "omit";
614
+ readonly "google/gemini-3.6-flash": "omit";
615
+ readonly "google/gemini-3.5-flash-lite": "omit";
616
+ readonly "google/gemini-3.1-pro-preview": "emit";
617
+ readonly "google/gemini-3.5-flash": "emit";
618
+ readonly "google/gemini-3.1-flash-lite": "emit";
619
+ readonly "anthropic/claude-sonnet-5": "omit";
620
+ readonly "anthropic/claude-opus-5": "emit";
621
+ readonly "anthropic/claude-opus-4.8": "emit";
622
+ readonly "anthropic/claude-sonnet-4.6": "emit";
623
+ readonly "openai/gpt-5.5": "omit";
624
+ readonly "openai/gpt-5.4-mini": "omit";
625
+ readonly "gpt-6-astra": "omit";
626
+ readonly "gpt-5.6": "omit";
627
+ readonly "gpt-5.6-terra": "omit";
628
+ readonly "gpt-5.6-luna": "omit";
629
+ readonly "gpt-5.5": "omit";
630
+ readonly "gpt-5.4": "emit";
631
+ readonly "gpt-5.4-mini": "emit";
632
+ readonly "gpt-5.4-nano": "emit";
633
+ readonly "gpt-5.2": "emit";
634
+ readonly "claude-sonnet-5": "omit";
635
+ readonly "claude-fable-5-1": "omit";
636
+ readonly "claude-fable-5": "omit";
637
+ readonly "claude-opus-5": "omit";
638
+ readonly "claude-opus-4-8": "omit";
639
+ readonly "claude-opus-4-7": "omit";
640
+ readonly "claude-sonnet-4-6": "emit";
641
+ readonly "claude-opus-4-6": "emit";
642
+ readonly "claude-haiku-4-5-20251001": "emit";
643
+ readonly "us.anthropic.claude-sonnet-4-5-20250929-v1:0": "emit";
644
+ readonly "us.anthropic.claude-haiku-4-5-20251001-v1:0": "emit";
645
+ readonly "us.amazon.nova-pro-v1:0": "emit";
646
+ readonly "us.amazon.nova-lite-v1:0": "emit";
647
+ readonly "us.amazon.nova-micro-v1:0": "emit";
648
+ readonly "openai.gpt-oss-120b-1:0": "emit";
649
+ readonly "openai.gpt-oss-20b-1:0": "emit";
650
+ readonly "us.deepseek.r1-v1:0": "emit";
651
+ readonly "mistral-large-latest": "emit";
652
+ readonly "mistral-medium-latest": "emit";
653
+ readonly "mistral-small-latest": "emit";
654
+ readonly "magistral-medium-latest": "emit";
655
+ readonly "magistral-small": "emit";
656
+ readonly "pixtral-large-latest": "emit";
657
+ };
658
+ //#endregion
659
+ //#region src/index.d.ts
711
660
  /**
712
- * Per-provider model served when a user's included budget is exhausted
713
- * and no explicit selection overrides it. Falls back to each
714
- * provider's fast-role default; providers without a first-class
715
- * adapter path cannot serve the lane. Total over providers so a new
716
- * provider lands with an explicit decision.
661
+ * Logical model roles. Call sites declare *what* they need, not
662
+ * *which* model to use.
663
+ *
664
+ * - fast: classification, extraction, short generation
665
+ * - chat: conversational with tool use and streaming
666
+ * - reasoning: complex multi-step legal analysis
667
+ * - pdf: native PDF/image understanding
717
668
  */
718
- declare const FALLBACK_CHAT_MODEL_BY_PROVIDER: {
719
- readonly google: "gemini-3.7-flash";
720
- readonly openrouter: "openai/gpt-5.6-luna";
721
- readonly openai: "gpt-5.6-luna";
722
- readonly anthropic: "claude-opus-5";
723
- readonly bedrock: "us.amazon.nova-micro-v1:0";
724
- readonly mistral: "mistral-small-latest";
725
- readonly azure_foundry: null;
726
- readonly openai_compatible: null;
727
- readonly huggingface: null;
669
+ declare const MODEL_ROLES: readonly ["fast", "chat", "reasoning", "pdf"];
670
+ type ModelRole = (typeof MODEL_ROLES)[number];
671
+ declare const TEMPERATURE_POLICIES: readonly ["emit", "omit"];
672
+ type TemperaturePolicy = (typeof TEMPERATURE_POLICIES)[number];
673
+ declare const AI_PROVIDERS: readonly ["google", "openrouter", "openai", "azure_foundry", "anthropic", "bedrock", "mistral", "openai_compatible", "huggingface"];
674
+ type AIProvider = (typeof AI_PROVIDERS)[number];
675
+ declare const AI_PROVIDER_ADAPTER_KIND: {
676
+ readonly google: "tanstack";
677
+ readonly openrouter: "tanstack";
678
+ readonly openai: "tanstack";
679
+ readonly azure_foundry: "custom";
680
+ readonly anthropic: "tanstack";
681
+ readonly bedrock: "tanstack";
682
+ readonly mistral: "tanstack";
683
+ readonly openai_compatible: "custom";
684
+ readonly huggingface: "custom";
728
685
  };
729
- declare const MODEL_CATALOG_ID_ALIASES: {
730
- readonly "gpt-5.6-sol": "gpt-5.6";
731
- readonly "claude-opus-4.8": "claude-opus-4-8";
732
- readonly "claude-sonnet-4.6": "claude-sonnet-4-6";
686
+ type TanStackAIProvider = { [TProvider in AIProvider]: (typeof AI_PROVIDER_ADAPTER_KIND)[TProvider] extends "tanstack" ? TProvider : never; }[AIProvider];
687
+ declare const TANSTACK_AI_PROVIDERS: readonly ["google", "openrouter", "openai", "anthropic", "bedrock", "mistral"];
688
+ declare const MODEL_CATALOG_PROVIDER_KIND: {
689
+ readonly google: "first-party";
690
+ readonly openrouter: "aggregator";
691
+ readonly openai: "first-party";
692
+ readonly anthropic: "first-party";
693
+ readonly bedrock: "platform";
694
+ readonly mistral: "first-party";
733
695
  };
734
- declare const normalizeModelCatalogId: (modelId: string) => string;
735
- /**
736
- * Whether stella should emit a `temperature` override for this model.
737
- * This is deliberately stricter than provider acceptance: deprecated
738
- * parameters that are accepted but ignored resolve to `false`. Unknown ids
739
- * also resolve to `false` (send nothing; provider default). Callers must
740
- * never index `MODEL_TEMPERATURE_POLICIES` directly with
741
- * a runtime string.
742
- */
743
- declare const shouldEmitTemperature: (modelId: string) => boolean;
696
+ /** Providers whose picker IDs map directly to public first-party catalogs. */
697
+ type FirstPartyModelProvider = { [TProvider in TanStackAIProvider]: (typeof MODEL_CATALOG_PROVIDER_KIND)[TProvider] extends "first-party" ? TProvider : never; }[TanStackAIProvider];
698
+ declare const FIRST_PARTY_MODEL_PROVIDER_VALUES: readonly ["google", "openai", "anthropic", "mistral"];
744
699
  /**
745
- * Declared reasoning-effort values for a model ID, or `null` when the
746
- * model has no effort control or is not catalogued (custom deployments,
747
- * env overrides). Callers must never index `MODEL_REASONING_EFFORTS`
748
- * directly with a runtime string.
700
+ * Runtime form of the first-party provider union. The conditional annotation
701
+ * makes adding a first-party policy without adding its discovery implementation
702
+ * a compile error.
749
703
  */
750
- declare const getModelReasoningEfforts: (modelId: string) => readonly ReasoningEffort[] | null;
704
+ declare const FIRST_PARTY_MODEL_PROVIDERS: Exclude<FirstPartyModelProvider, (typeof FIRST_PARTY_MODEL_PROVIDER_VALUES)[number]> extends never ? typeof FIRST_PARTY_MODEL_PROVIDER_VALUES : never;
751
705
  /**
752
- * Concrete provider-default effort published for a model, or null when the
753
- * provider exposes no named default. Unknown ids also resolve to null.
706
+ * Per-role default model IDs for the BYOK-capable cloud providers.
707
+ * Shared between the instance default table (`DEFAULT_MODELS`) and the
708
+ * settings-UI default selection, so a default is defined exactly once.
754
709
  */
755
- declare const getModelDefaultReasoningEffort: (modelId: string) => ReasoningEffort | null;
756
- type ResolveReasoningEffortOptions = {
757
- modelId: string;
758
- requested: ReasoningEffort;
710
+ declare const BYOK_DEFAULT_MODELS: {
711
+ readonly google: {
712
+ readonly fast: "gemini-3.7-flash";
713
+ readonly chat: "gemini-3.7-flash";
714
+ readonly reasoning: "gemini-3.7-flash";
715
+ readonly pdf: "gemini-3.7-flash";
716
+ };
717
+ readonly openrouter: {
718
+ readonly fast: "openai/gpt-5.6-luna";
719
+ readonly chat: "openai/gpt-5.6-terra";
720
+ readonly reasoning: "openai/gpt-5.6-terra";
721
+ readonly pdf: "openai/gpt-5.6-terra";
722
+ };
723
+ readonly openai: {
724
+ readonly fast: "gpt-5.4-nano";
725
+ readonly chat: "gpt-5.4-mini";
726
+ readonly reasoning: "gpt-5.4";
727
+ readonly pdf: "gpt-5.4";
728
+ };
729
+ readonly anthropic: {
730
+ readonly fast: "claude-opus-5";
731
+ readonly chat: "claude-opus-5";
732
+ readonly reasoning: "claude-opus-5";
733
+ readonly pdf: "claude-opus-5";
734
+ };
735
+ readonly bedrock: {
736
+ readonly fast: "us.amazon.nova-micro-v1:0";
737
+ readonly chat: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
738
+ readonly reasoning: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
739
+ readonly pdf: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
740
+ };
741
+ readonly mistral: {
742
+ readonly fast: "mistral-small-latest";
743
+ readonly chat: "mistral-medium-latest";
744
+ readonly reasoning: "magistral-medium-latest";
745
+ readonly pdf: "mistral-large-latest";
746
+ };
759
747
  };
760
748
  /**
761
- * Clamp a requested reasoning effort into the target model's declared
762
- * capability.
763
- *
764
- * - Unknown model or no effort control → `null` (send no effort at
765
- * all; the provider default is the only universally safe choice).
766
- * - Requested value supported → returned unchanged.
767
- * - Otherwise → the supported value nearest on `REASONING_EFFORTS`,
768
- * preferring the weaker side on ties, so a "none" request against a
769
- * reasoning-mandatory model degrades to its weakest tier instead of
770
- * erroring, and requests above the model's ceiling clamp down to it.
749
+ * Instance-level default model IDs per provider. Extends the BYOK
750
+ * defaults with the providers that only the instance path uses
751
+ * (custom deployments and OpenAI-compatible endpoints).
771
752
  */
772
- declare const resolveReasoningEffort: ({ modelId, requested }: ResolveReasoningEffortOptions) => ResolvedReasoningEffort | null;
753
+ declare const DEFAULT_MODELS: {
754
+ readonly azure_foundry: {
755
+ readonly fast: "gpt-5.4-nano";
756
+ readonly chat: "gpt-5.4-mini";
757
+ readonly reasoning: "gpt-5.4";
758
+ readonly pdf: "gpt-5.4";
759
+ };
760
+ readonly openai_compatible: {
761
+ readonly fast: "default";
762
+ readonly chat: "default";
763
+ readonly reasoning: "default";
764
+ readonly pdf: "default";
765
+ };
766
+ readonly huggingface: {
767
+ readonly fast: "speakleash/Bielik-1.5B-v3.0-Instruct";
768
+ readonly chat: "speakleash/Bielik-11B-v2.3-Instruct";
769
+ readonly reasoning: "speakleash/Bielik-11B-v2.3-Instruct";
770
+ readonly pdf: "speakleash/Bielik-11B-v2.3-Instruct";
771
+ };
772
+ readonly google: {
773
+ readonly fast: "gemini-3.7-flash";
774
+ readonly chat: "gemini-3.7-flash";
775
+ readonly reasoning: "gemini-3.7-flash";
776
+ readonly pdf: "gemini-3.7-flash";
777
+ };
778
+ readonly openrouter: {
779
+ readonly fast: "openai/gpt-5.6-luna";
780
+ readonly chat: "openai/gpt-5.6-terra";
781
+ readonly reasoning: "openai/gpt-5.6-terra";
782
+ readonly pdf: "openai/gpt-5.6-terra";
783
+ };
784
+ readonly openai: {
785
+ readonly fast: "gpt-5.4-nano";
786
+ readonly chat: "gpt-5.4-mini";
787
+ readonly reasoning: "gpt-5.4";
788
+ readonly pdf: "gpt-5.4";
789
+ };
790
+ readonly anthropic: {
791
+ readonly fast: "claude-opus-5";
792
+ readonly chat: "claude-opus-5";
793
+ readonly reasoning: "claude-opus-5";
794
+ readonly pdf: "claude-opus-5";
795
+ };
796
+ readonly bedrock: {
797
+ readonly fast: "us.amazon.nova-micro-v1:0";
798
+ readonly chat: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
799
+ readonly reasoning: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
800
+ readonly pdf: "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
801
+ };
802
+ readonly mistral: {
803
+ readonly fast: "mistral-small-latest";
804
+ readonly chat: "mistral-medium-latest";
805
+ readonly reasoning: "magistral-medium-latest";
806
+ readonly pdf: "mistral-large-latest";
807
+ };
808
+ };
773
809
  /**
774
- * Per-model ledger rates, normalized micro-units per 1M tokens.
810
+ * BYOK-offered model IDs per provider — the curated catalog users pick
811
+ * from in org settings, and the server-side allowlist the API enforces.
812
+ * The frontend list is not a security boundary; this is what the API
813
+ * accepts.
775
814
  *
776
- * Keys are the canonical model IDs stella passes to provider adapters.
777
- * Consumers (`apps/api/src/lib/usage/unit-model.ts`) fall back to a
778
- * defensive default for unknown IDs. The nightly
779
- * `model-catalog-upstream` check validates that every offered
780
- * first-party model has an entry and that entries stay mutually
781
- * consistent with upstream catalog cost metadata, so a stale entry
782
- * fails CI instead of silently mis-attributing usage.
815
+ * Limited to providers the TanStack AI integration supports for BYOK.
816
+ * Providers without a first-class TanStack adapter path are intentionally
817
+ * not accepted at this boundary.
783
818
  */
784
- type ModelRateAmounts = {
785
- /** Normalized micro-units per 1M input tokens. */
786
- inputPerMTok: number;
787
- /** Normalized micro-units per 1M output tokens. */
788
- outputPerMTok: number;
789
- /**
790
- * Normalized micro-units per 1M cached input tokens, when the
791
- * provider offers a cache-read adjustment. Falls back to
792
- * `inputPerMTok` when undefined.
793
- */
794
- cachedInputPerMTok?: number;
819
+ declare const BYOK_MODEL_OPTIONS: {
820
+ readonly google: readonly ["gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash-lite", "gemini-3.1-pro-preview", "gemini-3.5-flash", "gemini-3.1-flash-lite"];
821
+ readonly anthropic: readonly ["claude-sonnet-5", "claude-fable-5-1", "claude-fable-5", "claude-opus-5", "claude-opus-4-8", "claude-opus-4-7", "claude-sonnet-4-6", "claude-opus-4-6", "claude-haiku-4-5-20251001"];
822
+ readonly openai: readonly ["gpt-6-astra", "gpt-5.6", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.2"];
823
+ readonly openrouter: readonly ["openai/gpt-6-astra", "openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "google/gemini-3.8-flash", "google/gemini-3.7-flash", "google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "google/gemini-3.1-pro-preview", "google/gemini-3.5-flash", "google/gemini-3.1-flash-lite", "anthropic/claude-sonnet-5", "anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "anthropic/claude-sonnet-4.6", "openai/gpt-5.5", "openai/gpt-5.4-mini"];
824
+ readonly bedrock: readonly ["us.anthropic.claude-sonnet-4-5-20250929-v1:0", "us.anthropic.claude-haiku-4-5-20251001-v1:0", "us.amazon.nova-pro-v1:0", "us.amazon.nova-lite-v1:0", "us.amazon.nova-micro-v1:0", "openai.gpt-oss-120b-1:0", "openai.gpt-oss-20b-1:0", "us.deepseek.r1-v1:0"];
825
+ readonly mistral: readonly ["mistral-large-latest", "mistral-medium-latest", "mistral-small-latest", "magistral-medium-latest", "magistral-small", "pixtral-large-latest"];
795
826
  };
796
- /**
797
- * A discriminated rate schedule. Consumers must resolve the schedule from the
798
- * request's total input tokens before reading any prices, so a model with a
799
- * long-context premium cannot accidentally be metered at its base rate.
800
- */
801
- type ModelRate = ({
802
- kind: "flat";
803
- } & ModelRateAmounts) | {
804
- kind: "input-token-tiered";
805
- /** The base tier applies at or below this total input-token count. */
806
- inputTokenThreshold: number;
807
- standard: ModelRateAmounts;
808
- /** Applies to the entire request once input exceeds the threshold. */
809
- aboveThreshold: ModelRateAmounts;
827
+ type BYOKProvider = keyof typeof BYOK_MODEL_OPTIONS;
828
+ type BYOKModelIdByProvider = { [TProvider in BYOKProvider]: (typeof BYOK_MODEL_OPTIONS)[TProvider][number]; };
829
+ type OfferedBYOKModelId = BYOKModelIdByProvider[BYOKProvider];
830
+ type ModelDisplayMetadata = {
831
+ /** Human-readable product name; model names are trademarks and stay untranslated. */
832
+ displayName: string;
833
+ /** Brand mark to show. This may differ from the routing provider. */
834
+ iconProvider: BYOKProvider;
810
835
  };
811
- declare const getStandardModelRate: (rate: ModelRate) => ModelRateAmounts;
812
- declare const resolveModelRate: (rate: ModelRate, inputTokens: number) => ModelRateAmounts;
813
836
  /**
814
- * Providers whose catalog entries are first-party API model IDs and so
815
- * must carry an explicit rate. Mirrors `MODELS_DEV_PROVIDER` in the
816
- * nightly check; `openrouter` (provider-prefixed slugs) and the
817
- * legacy/custom-deployment providers are metered by their underlying
818
- * model IDs or the fallback rate.
837
+ * Presentation metadata for every offered model. Keeping this exhaustive beside
838
+ * the allowlist prevents a newly offered model from leaking a raw provider ID
839
+ * into user-facing pickers. OpenRouter entries deliberately carry their model
840
+ * creator's icon while their routing provider remains available separately.
819
841
  */
820
- declare const MODEL_RATES: {
821
- readonly "gemini-2.5-flash": {
822
- readonly kind: "flat";
823
- readonly inputPerMTok: 30000;
824
- readonly outputPerMTok: 250000;
825
- readonly cachedInputPerMTok: 7500;
842
+ declare const MODEL_DISPLAY_METADATA: {
843
+ readonly "gemini-3.8-flash": {
844
+ readonly displayName: "Gemini 3.8 Flash";
845
+ readonly iconProvider: "google";
826
846
  };
827
- readonly "gemini-2.5-pro": {
828
- readonly kind: "flat";
829
- readonly inputPerMTok: 125000;
830
- readonly outputPerMTok: 1000000;
831
- readonly cachedInputPerMTok: 31250;
847
+ readonly "gemini-3.7-flash": {
848
+ readonly displayName: "Gemini 3.7 Flash";
849
+ readonly iconProvider: "google";
832
850
  };
833
- readonly "gemini-3.1-flash-lite": {
834
- readonly kind: "flat";
835
- readonly inputPerMTok: 25000;
836
- readonly outputPerMTok: 150000;
837
- readonly cachedInputPerMTok: 2500;
851
+ readonly "gemini-3.6-flash": {
852
+ readonly displayName: "Gemini 3.6 Flash";
853
+ readonly iconProvider: "google";
854
+ };
855
+ readonly "gemini-3.5-flash-lite": {
856
+ readonly displayName: "Gemini 3.5 Flash Lite";
857
+ readonly iconProvider: "google";
858
+ };
859
+ readonly "gemini-3.1-pro-preview": {
860
+ readonly displayName: "Gemini 3.1 Pro Preview";
861
+ readonly iconProvider: "google";
838
862
  };
839
863
  readonly "gemini-3.5-flash": {
840
- readonly kind: "flat";
841
- readonly inputPerMTok: 150000;
842
- readonly outputPerMTok: 900000;
843
- readonly cachedInputPerMTok: 15000;
864
+ readonly displayName: "Gemini 3.5 Flash";
865
+ readonly iconProvider: "google";
866
+ };
867
+ readonly "gemini-3.1-flash-lite": {
868
+ readonly displayName: "Gemini 3.1 Flash Lite";
869
+ readonly iconProvider: "google";
870
+ };
871
+ readonly "claude-sonnet-5": {
872
+ readonly displayName: "Claude Sonnet 5";
873
+ readonly iconProvider: "anthropic";
844
874
  };
845
- readonly "gemini-3.5-flash-lite": {
846
- readonly kind: "flat";
847
- readonly inputPerMTok: 30000;
848
- readonly outputPerMTok: 250000;
849
- readonly cachedInputPerMTok: 3000;
875
+ readonly "claude-fable-5-1": {
876
+ readonly displayName: "Claude Fable 5.1";
877
+ readonly iconProvider: "anthropic";
850
878
  };
851
- readonly "gemini-3.6-flash": {
852
- readonly kind: "flat";
853
- readonly inputPerMTok: 75000;
854
- readonly outputPerMTok: 375000;
855
- readonly cachedInputPerMTok: 7500;
879
+ readonly "claude-fable-5": {
880
+ readonly displayName: "Claude Fable 5";
881
+ readonly iconProvider: "anthropic";
856
882
  };
857
- readonly "gemini-3.7-flash": {
858
- readonly kind: "flat";
859
- readonly inputPerMTok: 75000;
860
- readonly outputPerMTok: 375000;
861
- readonly cachedInputPerMTok: 7500;
883
+ readonly "claude-opus-5": {
884
+ readonly displayName: "Claude Opus 5";
885
+ readonly iconProvider: "anthropic";
862
886
  };
863
- readonly "gemini-3.8-flash": {
864
- readonly kind: "flat";
865
- readonly inputPerMTok: 75000;
866
- readonly outputPerMTok: 375000;
867
- readonly cachedInputPerMTok: 7500;
887
+ readonly "claude-opus-4-8": {
888
+ readonly displayName: "Claude Opus 4.8";
889
+ readonly iconProvider: "anthropic";
868
890
  };
869
- readonly "gemini-3.1-pro-preview": {
870
- readonly kind: "input-token-tiered";
871
- readonly inputTokenThreshold: 200000;
872
- readonly standard: {
873
- readonly inputPerMTok: 200000;
874
- readonly outputPerMTok: 1200000;
875
- readonly cachedInputPerMTok: 20000;
876
- };
877
- readonly aboveThreshold: {
878
- readonly inputPerMTok: 400000;
879
- readonly outputPerMTok: 1800000;
880
- readonly cachedInputPerMTok: 40000;
881
- };
891
+ readonly "claude-opus-4-7": {
892
+ readonly displayName: "Claude Opus 4.7";
893
+ readonly iconProvider: "anthropic";
882
894
  };
883
- readonly "gpt-4o-mini": {
884
- readonly kind: "flat";
885
- readonly inputPerMTok: 15000;
886
- readonly outputPerMTok: 60000;
887
- readonly cachedInputPerMTok: 7500;
895
+ readonly "claude-sonnet-4-6": {
896
+ readonly displayName: "Claude Sonnet 4.6";
897
+ readonly iconProvider: "anthropic";
888
898
  };
889
- readonly "gpt-4o": {
890
- readonly kind: "flat";
891
- readonly inputPerMTok: 250000;
892
- readonly outputPerMTok: 1000000;
893
- readonly cachedInputPerMTok: 125000;
899
+ readonly "claude-opus-4-6": {
900
+ readonly displayName: "Claude Opus 4.6";
901
+ readonly iconProvider: "anthropic";
894
902
  };
895
- readonly "gpt-5.2": {
896
- readonly kind: "flat";
897
- readonly inputPerMTok: 175000;
898
- readonly outputPerMTok: 1400000;
899
- readonly cachedInputPerMTok: 17500;
903
+ readonly "claude-haiku-4-5-20251001": {
904
+ readonly displayName: "Claude Haiku 4.5";
905
+ readonly iconProvider: "anthropic";
900
906
  };
901
- readonly "gpt-5.4-nano": {
902
- readonly kind: "flat";
903
- readonly inputPerMTok: 20000;
904
- readonly outputPerMTok: 125000;
905
- readonly cachedInputPerMTok: 2000;
907
+ readonly "gpt-6-astra": {
908
+ readonly displayName: "GPT-6 Astra";
909
+ readonly iconProvider: "openai";
906
910
  };
907
- readonly "gpt-5.4-mini": {
908
- readonly kind: "flat";
909
- readonly inputPerMTok: 75000;
910
- readonly outputPerMTok: 450000;
911
- readonly cachedInputPerMTok: 7500;
911
+ readonly "gpt-5.6": {
912
+ readonly displayName: "GPT-5.6 Sol";
913
+ readonly iconProvider: "openai";
912
914
  };
913
- readonly "gpt-5.4": {
914
- readonly kind: "input-token-tiered";
915
- readonly inputTokenThreshold: 272000;
916
- readonly standard: {
917
- readonly inputPerMTok: 250000;
918
- readonly outputPerMTok: 1500000;
919
- readonly cachedInputPerMTok: 25000;
920
- };
921
- readonly aboveThreshold: {
922
- readonly inputPerMTok: 500000;
923
- readonly outputPerMTok: 2250000;
924
- readonly cachedInputPerMTok: 50000;
925
- };
915
+ readonly "gpt-5.6-terra": {
916
+ readonly displayName: "GPT-5.6 Terra";
917
+ readonly iconProvider: "openai";
918
+ };
919
+ readonly "gpt-5.6-luna": {
920
+ readonly displayName: "GPT-5.6 Luna";
921
+ readonly iconProvider: "openai";
926
922
  };
927
923
  readonly "gpt-5.5": {
928
- readonly kind: "input-token-tiered";
929
- readonly inputTokenThreshold: 272000;
930
- readonly standard: {
931
- readonly inputPerMTok: 500000;
932
- readonly outputPerMTok: 3000000;
933
- readonly cachedInputPerMTok: 50000;
934
- };
935
- readonly aboveThreshold: {
936
- readonly inputPerMTok: 1000000;
937
- readonly outputPerMTok: 4500000;
938
- readonly cachedInputPerMTok: 100000;
939
- };
924
+ readonly displayName: "GPT-5.5";
925
+ readonly iconProvider: "openai";
940
926
  };
941
- readonly "gpt-5.6": {
942
- readonly kind: "input-token-tiered";
943
- readonly inputTokenThreshold: 272000;
944
- readonly standard: {
945
- readonly inputPerMTok: 400000;
946
- readonly outputPerMTok: 2000000;
947
- readonly cachedInputPerMTok: 40000;
948
- };
949
- readonly aboveThreshold: {
950
- readonly inputPerMTok: 800000;
951
- readonly outputPerMTok: 3000000;
952
- readonly cachedInputPerMTok: 80000;
953
- };
927
+ readonly "gpt-5.4": {
928
+ readonly displayName: "GPT-5.4";
929
+ readonly iconProvider: "openai";
954
930
  };
955
- readonly "gpt-5.6-luna": {
956
- readonly kind: "input-token-tiered";
957
- readonly inputTokenThreshold: 272000;
958
- readonly standard: {
959
- readonly inputPerMTok: 20000;
960
- readonly outputPerMTok: 120000;
961
- readonly cachedInputPerMTok: 2000;
962
- };
963
- readonly aboveThreshold: {
964
- readonly inputPerMTok: 40000;
965
- readonly outputPerMTok: 180000;
966
- readonly cachedInputPerMTok: 4000;
967
- };
931
+ readonly "gpt-5.4-mini": {
932
+ readonly displayName: "GPT-5.4 Mini";
933
+ readonly iconProvider: "openai";
968
934
  };
969
- readonly "gpt-5.6-terra": {
970
- readonly kind: "input-token-tiered";
971
- readonly inputTokenThreshold: 272000;
972
- readonly standard: {
973
- readonly inputPerMTok: 200000;
974
- readonly outputPerMTok: 1200000;
975
- readonly cachedInputPerMTok: 20000;
976
- };
977
- readonly aboveThreshold: {
978
- readonly inputPerMTok: 400000;
979
- readonly outputPerMTok: 1800000;
980
- readonly cachedInputPerMTok: 40000;
981
- };
935
+ readonly "gpt-5.4-nano": {
936
+ readonly displayName: "GPT-5.4 Nano";
937
+ readonly iconProvider: "openai";
982
938
  };
983
- readonly "claude-haiku-4-5-20251001": {
984
- readonly kind: "flat";
985
- readonly inputPerMTok: 100000;
986
- readonly outputPerMTok: 500000;
987
- readonly cachedInputPerMTok: 10000;
939
+ readonly "gpt-5.2": {
940
+ readonly displayName: "GPT-5.2";
941
+ readonly iconProvider: "openai";
988
942
  };
989
- readonly "claude-sonnet-4-6": {
990
- readonly kind: "flat";
991
- readonly inputPerMTok: 300000;
992
- readonly outputPerMTok: 1500000;
993
- readonly cachedInputPerMTok: 30000;
943
+ readonly "openai/gpt-6-astra": {
944
+ readonly displayName: "GPT-6 Astra";
945
+ readonly iconProvider: "openai";
994
946
  };
995
- readonly "claude-sonnet-5": {
996
- readonly kind: "flat";
997
- readonly inputPerMTok: 200000;
998
- readonly outputPerMTok: 1000000;
999
- readonly cachedInputPerMTok: 20000;
947
+ readonly "openai/gpt-5.6-luna": {
948
+ readonly displayName: "GPT-5.6 Luna";
949
+ readonly iconProvider: "openai";
1000
950
  };
1001
- readonly "claude-opus-4-6": {
1002
- readonly kind: "flat";
1003
- readonly inputPerMTok: 500000;
1004
- readonly outputPerMTok: 2500000;
1005
- readonly cachedInputPerMTok: 50000;
951
+ readonly "openai/gpt-5.6-terra": {
952
+ readonly displayName: "GPT-5.6 Terra";
953
+ readonly iconProvider: "openai";
1006
954
  };
1007
- readonly "claude-opus-4-7": {
1008
- readonly kind: "flat";
1009
- readonly inputPerMTok: 500000;
1010
- readonly outputPerMTok: 2500000;
1011
- readonly cachedInputPerMTok: 50000;
955
+ readonly "google/gemini-3.8-flash": {
956
+ readonly displayName: "Gemini 3.8 Flash";
957
+ readonly iconProvider: "google";
1012
958
  };
1013
- readonly "claude-opus-4-8": {
1014
- readonly kind: "flat";
1015
- readonly inputPerMTok: 500000;
1016
- readonly outputPerMTok: 2500000;
1017
- readonly cachedInputPerMTok: 50000;
959
+ readonly "google/gemini-3.7-flash": {
960
+ readonly displayName: "Gemini 3.7 Flash";
961
+ readonly iconProvider: "google";
1018
962
  };
1019
- readonly "claude-opus-5": {
1020
- readonly kind: "flat";
1021
- readonly inputPerMTok: 500000;
1022
- readonly outputPerMTok: 2500000;
1023
- readonly cachedInputPerMTok: 50000;
963
+ readonly "google/gemini-3.6-flash": {
964
+ readonly displayName: "Gemini 3.6 Flash";
965
+ readonly iconProvider: "google";
1024
966
  };
1025
- readonly "claude-fable-5": {
1026
- readonly kind: "flat";
1027
- readonly inputPerMTok: 1000000;
1028
- readonly outputPerMTok: 5000000;
1029
- readonly cachedInputPerMTok: 100000;
967
+ readonly "google/gemini-3.5-flash-lite": {
968
+ readonly displayName: "Gemini 3.5 Flash Lite";
969
+ readonly iconProvider: "google";
1030
970
  };
1031
- readonly "claude-fable-5-1": {
1032
- readonly kind: "flat";
1033
- readonly inputPerMTok: 1000000;
1034
- readonly outputPerMTok: 5000000;
1035
- readonly cachedInputPerMTok: 25000;
971
+ readonly "google/gemini-3.1-pro-preview": {
972
+ readonly displayName: "Gemini 3.1 Pro Preview";
973
+ readonly iconProvider: "google";
1036
974
  };
1037
- readonly "mistral-small-latest": {
1038
- readonly kind: "flat";
1039
- readonly inputPerMTok: 15000;
1040
- readonly outputPerMTok: 60000;
975
+ readonly "google/gemini-3.5-flash": {
976
+ readonly displayName: "Gemini 3.5 Flash";
977
+ readonly iconProvider: "google";
1041
978
  };
1042
- readonly "mistral-large-latest": {
1043
- readonly kind: "flat";
1044
- readonly inputPerMTok: 50000;
1045
- readonly outputPerMTok: 150000;
979
+ readonly "google/gemini-3.1-flash-lite": {
980
+ readonly displayName: "Gemini 3.1 Flash Lite";
981
+ readonly iconProvider: "google";
1046
982
  };
1047
- readonly "mistral-medium-latest": {
1048
- readonly kind: "flat";
1049
- readonly inputPerMTok: 150000;
1050
- readonly outputPerMTok: 750000;
983
+ readonly "anthropic/claude-sonnet-5": {
984
+ readonly displayName: "Claude Sonnet 5";
985
+ readonly iconProvider: "anthropic";
1051
986
  };
1052
- readonly "mistral-medium-3-5": {
1053
- readonly kind: "flat";
1054
- readonly inputPerMTok: 150000;
1055
- readonly outputPerMTok: 750000;
987
+ readonly "anthropic/claude-opus-5": {
988
+ readonly displayName: "Claude Opus 5";
989
+ readonly iconProvider: "anthropic";
1056
990
  };
1057
- readonly "magistral-medium-latest": {
1058
- readonly kind: "flat";
1059
- readonly inputPerMTok: 200000;
1060
- readonly outputPerMTok: 500000;
991
+ readonly "anthropic/claude-opus-4.8": {
992
+ readonly displayName: "Claude Opus 4.8";
993
+ readonly iconProvider: "anthropic";
1061
994
  };
1062
- readonly "magistral-small": {
1063
- readonly kind: "flat";
1064
- readonly inputPerMTok: 50000;
1065
- readonly outputPerMTok: 150000;
995
+ readonly "anthropic/claude-sonnet-4.6": {
996
+ readonly displayName: "Claude Sonnet 4.6";
997
+ readonly iconProvider: "anthropic";
1066
998
  };
1067
- readonly "magistral-small-latest": {
1068
- readonly kind: "flat";
1069
- readonly inputPerMTok: 50000;
1070
- readonly outputPerMTok: 150000;
999
+ readonly "openai/gpt-5.5": {
1000
+ readonly displayName: "GPT-5.5";
1001
+ readonly iconProvider: "openai";
1071
1002
  };
1072
- readonly "pixtral-large-latest": {
1073
- readonly kind: "flat";
1074
- readonly inputPerMTok: 200000;
1075
- readonly outputPerMTok: 600000;
1003
+ readonly "openai/gpt-5.4-mini": {
1004
+ readonly displayName: "GPT-5.4 Mini";
1005
+ readonly iconProvider: "openai";
1076
1006
  };
1077
1007
  readonly "us.anthropic.claude-sonnet-4-5-20250929-v1:0": {
1078
- readonly kind: "flat";
1079
- readonly inputPerMTok: 300000;
1080
- readonly outputPerMTok: 1500000;
1081
- readonly cachedInputPerMTok: 30000;
1008
+ readonly displayName: "Claude Sonnet 4.5";
1009
+ readonly iconProvider: "anthropic";
1082
1010
  };
1083
1011
  readonly "us.anthropic.claude-haiku-4-5-20251001-v1:0": {
1084
- readonly kind: "flat";
1085
- readonly inputPerMTok: 100000;
1086
- readonly outputPerMTok: 500000;
1087
- readonly cachedInputPerMTok: 10000;
1012
+ readonly displayName: "Claude Haiku 4.5";
1013
+ readonly iconProvider: "anthropic";
1088
1014
  };
1089
1015
  readonly "us.amazon.nova-pro-v1:0": {
1090
- readonly kind: "flat";
1091
- readonly inputPerMTok: 80000;
1092
- readonly outputPerMTok: 320000;
1016
+ readonly displayName: "Amazon Nova Pro";
1017
+ readonly iconProvider: "bedrock";
1093
1018
  };
1094
1019
  readonly "us.amazon.nova-lite-v1:0": {
1095
- readonly kind: "flat";
1096
- readonly inputPerMTok: 6000;
1097
- readonly outputPerMTok: 24000;
1020
+ readonly displayName: "Amazon Nova Lite";
1021
+ readonly iconProvider: "bedrock";
1098
1022
  };
1099
1023
  readonly "us.amazon.nova-micro-v1:0": {
1100
- readonly kind: "flat";
1101
- readonly inputPerMTok: 3500;
1102
- readonly outputPerMTok: 14000;
1024
+ readonly displayName: "Amazon Nova Micro";
1025
+ readonly iconProvider: "bedrock";
1103
1026
  };
1104
1027
  readonly "openai.gpt-oss-120b-1:0": {
1105
- readonly kind: "flat";
1106
- readonly inputPerMTok: 15000;
1107
- readonly outputPerMTok: 60000;
1028
+ readonly displayName: "GPT OSS 120B";
1029
+ readonly iconProvider: "openai";
1108
1030
  };
1109
1031
  readonly "openai.gpt-oss-20b-1:0": {
1110
- readonly kind: "flat";
1111
- readonly inputPerMTok: 7000;
1112
- readonly outputPerMTok: 30000;
1032
+ readonly displayName: "GPT OSS 20B";
1033
+ readonly iconProvider: "openai";
1113
1034
  };
1114
1035
  readonly "us.deepseek.r1-v1:0": {
1115
- readonly kind: "flat";
1116
- readonly inputPerMTok: 135000;
1117
- readonly outputPerMTok: 540000;
1036
+ readonly displayName: "DeepSeek R1";
1037
+ readonly iconProvider: "bedrock";
1038
+ };
1039
+ readonly "mistral-large-latest": {
1040
+ readonly displayName: "Mistral Large";
1041
+ readonly iconProvider: "mistral";
1042
+ };
1043
+ readonly "mistral-medium-latest": {
1044
+ readonly displayName: "Mistral Medium";
1045
+ readonly iconProvider: "mistral";
1046
+ };
1047
+ readonly "mistral-small-latest": {
1048
+ readonly displayName: "Mistral Small";
1049
+ readonly iconProvider: "mistral";
1050
+ };
1051
+ readonly "magistral-medium-latest": {
1052
+ readonly displayName: "Magistral Medium";
1053
+ readonly iconProvider: "mistral";
1054
+ };
1055
+ readonly "magistral-small": {
1056
+ readonly displayName: "Magistral Small";
1057
+ readonly iconProvider: "mistral";
1058
+ };
1059
+ readonly "pixtral-large-latest": {
1060
+ readonly displayName: "Pixtral Large";
1061
+ readonly iconProvider: "mistral";
1118
1062
  };
1119
1063
  };
1064
+ declare const getModelDisplayMetadata: (modelId: string) => ModelDisplayMetadata | null;
1065
+ /**
1066
+ * Offered models whose provider API accepts PDF/file content. Generated from
1067
+ * live models.dev input modalities plus dated, reviewed source corrections;
1068
+ * the nightly upstream check rejects drift.
1069
+ */
1070
+ declare const BYOK_DOCUMENT_INPUT_MODEL_OPTIONS: {
1071
+ readonly google: readonly ["gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash-lite", "gemini-3.1-pro-preview", "gemini-3.5-flash", "gemini-3.1-flash-lite"];
1072
+ readonly openrouter: readonly ["openai/gpt-6-astra", "openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "google/gemini-3.8-flash", "google/gemini-3.7-flash", "google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "google/gemini-3.1-pro-preview", "google/gemini-3.5-flash", "google/gemini-3.1-flash-lite", "anthropic/claude-sonnet-5", "anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "anthropic/claude-sonnet-4.6", "openai/gpt-5.5", "openai/gpt-5.4-mini"];
1073
+ readonly openai: readonly ["gpt-6-astra", "gpt-5.6", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.2"];
1074
+ readonly anthropic: readonly ["claude-sonnet-5", "claude-fable-5-1", "claude-fable-5", "claude-opus-5", "claude-opus-4-8", "claude-opus-4-7", "claude-sonnet-4-6", "claude-opus-4-6", "claude-haiku-4-5-20251001"];
1075
+ readonly bedrock: readonly ["us.anthropic.claude-sonnet-4-5-20250929-v1:0", "us.anthropic.claude-haiku-4-5-20251001-v1:0", "us.amazon.nova-pro-v1:0", "us.amazon.nova-lite-v1:0"];
1076
+ readonly mistral: readonly [];
1077
+ };
1078
+ declare const isBYOKProviderRoleSupported: ({ provider, role }: {
1079
+ provider: BYOKProvider;
1080
+ role: ModelRole;
1081
+ }) => boolean;
1082
+ declare const isBYOKModelRoleSupported: ({ provider, modelId, role }: {
1083
+ provider: BYOKProvider;
1084
+ modelId: string;
1085
+ role: ModelRole;
1086
+ }) => boolean;
1087
+ /**
1088
+ * Models whose provider adapter can receive a PDF `document` content part in a
1089
+ * chat turn without throwing. This is a narrower, runtime question than the
1090
+ * pdf ROLE (`BYOK_DOCUMENT_INPUT_MODEL_OPTIONS`, which curates model selection
1091
+ * for PDF-processing flows): it only asks "will the chat stream survive this
1092
+ * attachment." The Mistral text adapter maps PDF `document` parts to
1093
+ * `document_url`, so its
1094
+ * vision models accept PDF attachments even though Mistral is deliberately not
1095
+ * offered as a pdf-role provider. Mistral's `document_url` takes PDF but NOT
1096
+ * textual documents (docx/txt/csv/md), so those still gate on
1097
+ * `BYOK_DOCUMENT_INPUT_MODEL_OPTIONS` (which excludes Mistral). Superset
1098
+ * invariant: every pdf-role document model also accepts a PDF chat attachment.
1099
+ */
1100
+ declare const CHAT_PDF_ATTACHMENT_MODEL_OPTIONS: {
1101
+ readonly mistral: readonly ["mistral-medium-latest", "mistral-small-latest", "pixtral-large-latest"];
1102
+ readonly google: readonly ["gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash-lite", "gemini-3.1-pro-preview", "gemini-3.5-flash", "gemini-3.1-flash-lite"];
1103
+ readonly openrouter: readonly ["openai/gpt-6-astra", "openai/gpt-5.6-luna", "openai/gpt-5.6-terra", "google/gemini-3.8-flash", "google/gemini-3.7-flash", "google/gemini-3.6-flash", "google/gemini-3.5-flash-lite", "google/gemini-3.1-pro-preview", "google/gemini-3.5-flash", "google/gemini-3.1-flash-lite", "anthropic/claude-sonnet-5", "anthropic/claude-opus-5", "anthropic/claude-opus-4.8", "anthropic/claude-sonnet-4.6", "openai/gpt-5.5", "openai/gpt-5.4-mini"];
1104
+ readonly openai: readonly ["gpt-6-astra", "gpt-5.6", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.2"];
1105
+ readonly anthropic: readonly ["claude-sonnet-5", "claude-fable-5-1", "claude-fable-5", "claude-opus-5", "claude-opus-4-8", "claude-opus-4-7", "claude-sonnet-4-6", "claude-opus-4-6", "claude-haiku-4-5-20251001"];
1106
+ readonly bedrock: readonly ["us.anthropic.claude-sonnet-4-5-20250929-v1:0", "us.anthropic.claude-haiku-4-5-20251001-v1:0", "us.amazon.nova-pro-v1:0", "us.amazon.nova-lite-v1:0"];
1107
+ };
1108
+ declare const isChatPdfAttachmentModelSupported: ({ provider, modelId }: {
1109
+ provider: BYOKProvider;
1110
+ modelId: string;
1111
+ }) => boolean;
1112
+ /**
1113
+ * Resolve a model id that will actually work for this provider+role,
1114
+ * keeping the SAME provider. Returns the caller's model unchanged when
1115
+ * it is still offered; otherwise falls back to the provider's per-role
1116
+ * default (`BYOK_DEFAULT_MODELS`). Returns `null` only when the
1117
+ * provider has no valid model for the role at all — the sole case
1118
+ * today is `mistral` + `pdf`, because the TanStack Mistral adapter
1119
+ * exposes no `document` input modality, so no Mistral model (not even
1120
+ * the default) can serve the PDF role.
1121
+ *
1122
+ * Used to auto-heal org AI configs whose pinned model was removed by a
1123
+ * catalog bump, so generation resolves to a supported model instead of
1124
+ * 400-ing (or forwarding a retired id to the provider).
1125
+ */
1126
+ declare const resolveWorkingBYOKModelForRole: ({ provider, modelId, role }: {
1127
+ provider: BYOKProvider;
1128
+ modelId: string;
1129
+ role: ModelRole;
1130
+ }) => string | null;
1131
+ /**
1132
+ * Anthropic models that use the adaptive-thinking request shape
1133
+ * (`thinking: { type: "adaptive" }`). Newer Claude models reject the
1134
+ * legacy budget-based form, so every Opus 4.6+/Sonnet 4.6/Fable entry
1135
+ * offered above must appear here or it will 400 on the reasoning role.
1136
+ */
1137
+ declare const ANTHROPIC_ADAPTIVE_THINKING_MODELS: readonly ["claude-sonnet-5", "claude-opus-5", "claude-sonnet-4-6", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8", "claude-fable-5", "claude-fable-5-1"];
1138
+ /**
1139
+ * Canonical reasoning-effort ladder, ordered weakest to strongest.
1140
+ * Union of every effort keyword the offered providers accept; no
1141
+ * single model accepts all of them, which is exactly why the
1142
+ * generated per-model `MODEL_REASONING_EFFORTS` exists.
1143
+ */
1144
+ declare const REASONING_EFFORTS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
1145
+ type ReasoningEffort = (typeof REASONING_EFFORTS)[number];
1146
+ declare const resolvedReasoningEffortSchema: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"], undefined>, v.BrandAction<"none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "ResolvedReasoningEffort">]>;
1147
+ /**
1148
+ * A reasoning effort proven to be accepted by the model it targets.
1149
+ * Only `resolveReasoningEffort` can produce this type, so option
1150
+ * builders cannot hand a provider a literal effort the model rejects
1151
+ * (e.g. `"none"` to a model whose reasoning cannot be disabled) —
1152
+ * that mistake now fails typecheck instead of 502-ing at runtime.
1153
+ */
1154
+ type ResolvedReasoningEffort = v.InferOutput<typeof resolvedReasoningEffortSchema>;
1155
+ /**
1156
+ * Per-provider model served when a user's included budget is exhausted
1157
+ * and no explicit selection overrides it. Falls back to each
1158
+ * provider's fast-role default; providers without a first-class
1159
+ * adapter path cannot serve the lane. Total over providers so a new
1160
+ * provider lands with an explicit decision.
1161
+ */
1162
+ declare const FALLBACK_CHAT_MODEL_BY_PROVIDER: {
1163
+ readonly google: "gemini-3.7-flash";
1164
+ readonly openrouter: "openai/gpt-5.6-luna";
1165
+ readonly openai: "gpt-5.6-luna";
1166
+ readonly anthropic: "claude-opus-5";
1167
+ readonly bedrock: "us.amazon.nova-micro-v1:0";
1168
+ readonly mistral: "mistral-small-latest";
1169
+ readonly azure_foundry: null;
1170
+ readonly openai_compatible: null;
1171
+ readonly huggingface: null;
1172
+ };
1173
+ /**
1174
+ * Provider-native IDs that are exact aliases of an offered catalog ID.
1175
+ * Every metadata lookup normalizes here, so instance/dev overrides cannot
1176
+ * bypass rates or capabilities and duplicated alias rows cannot drift apart.
1177
+ */
1178
+ declare const MODEL_CATALOG_ID_ALIASES: {
1179
+ readonly "gpt-5.6-sol": "gpt-5.6";
1180
+ readonly "claude-opus-4.8": "claude-opus-4-8";
1181
+ readonly "claude-sonnet-4.6": "claude-sonnet-4-6";
1182
+ };
1183
+ declare const normalizeModelCatalogId: (modelId: string) => string;
1184
+ /**
1185
+ * Whether stella should emit a `temperature` override for this model.
1186
+ * This is deliberately stricter than provider acceptance: deprecated
1187
+ * parameters that are accepted but ignored resolve to `false`. Unknown ids
1188
+ * also resolve to `false` (send nothing; provider default). Callers must
1189
+ * never index `MODEL_TEMPERATURE_POLICIES` directly with
1190
+ * a runtime string.
1191
+ */
1192
+ declare const shouldEmitTemperature: (modelId: string) => boolean;
1193
+ /**
1194
+ * Declared reasoning-effort values for a model ID, or `null` when the
1195
+ * model has no effort control or is not catalogued (custom deployments,
1196
+ * env overrides). Callers must never index `MODEL_REASONING_EFFORTS`
1197
+ * directly with a runtime string.
1198
+ */
1199
+ declare const getModelReasoningEfforts: (modelId: string) => readonly ReasoningEffort[] | null;
1200
+ /**
1201
+ * Concrete provider-default effort published for a model, or null when the
1202
+ * provider exposes no named default. Unknown ids also resolve to null.
1203
+ */
1204
+ declare const getModelDefaultReasoningEffort: (modelId: string) => ReasoningEffort | null;
1205
+ type ResolveReasoningEffortOptions = {
1206
+ modelId: string;
1207
+ requested: ReasoningEffort;
1208
+ };
1209
+ /**
1210
+ * Clamp a requested reasoning effort into the target model's declared
1211
+ * capability.
1212
+ *
1213
+ * - Unknown model or no effort control → `null` (send no effort at
1214
+ * all; the provider default is the only universally safe choice).
1215
+ * - Requested value supported → returned unchanged.
1216
+ * - Otherwise → the supported value nearest on `REASONING_EFFORTS`,
1217
+ * preferring the weaker side on ties, so a "none" request against a
1218
+ * reasoning-mandatory model degrades to its weakest tier instead of
1219
+ * erroring, and requests above the model's ceiling clamp down to it.
1220
+ */
1221
+ declare const resolveReasoningEffort: ({ modelId, requested }: ResolveReasoningEffortOptions) => ResolvedReasoningEffort | null;
1120
1222
  declare const getModelRate: (modelId: string) => ModelRate | undefined;
1121
1223
  /**
1122
1224
  * Documented input context-window sizes (in tokens) per model ID.
@@ -1152,6 +1254,7 @@ declare const CONTEXT_WINDOW_TOKENS: {
1152
1254
  readonly "gpt-5.4-mini": 400000;
1153
1255
  readonly "gpt-5.4": 400000;
1154
1256
  readonly "gpt-5.5": 400000;
1257
+ readonly "gpt-6-astra": 922000;
1155
1258
  readonly "gpt-5.6": 922000;
1156
1259
  readonly "gpt-5.6-luna": 922000;
1157
1260
  readonly "gpt-5.6-terra": 922000;
@@ -1183,6 +1286,7 @@ declare const CONTEXT_WINDOW_TOKENS: {
1183
1286
  readonly "anthropic/claude-opus-5": 1000000;
1184
1287
  readonly "anthropic/claude-opus-4.8": 200000;
1185
1288
  readonly "anthropic/claude-sonnet-4.6": 200000;
1289
+ readonly "openai/gpt-6-astra": 922000;
1186
1290
  readonly "openai/gpt-5.6-luna": 922000;
1187
1291
  readonly "openai/gpt-5.6-terra": 922000;
1188
1292
  readonly "openai/gpt-5.5": 400000;
@@ -1209,4 +1313,4 @@ declare const DEFAULT_CONTEXT_WINDOW_TOKENS = 128000;
1209
1313
  */
1210
1314
  declare const getContextWindowTokens: (modelId: string) => number;
1211
1315
  //#endregion
1212
- export { AIProvider, AI_PROVIDERS, ANTHROPIC_ADAPTIVE_THINKING_MODELS, BYOKModelIdByProvider, BYOKProvider, BYOK_DEFAULT_MODELS, BYOK_DOCUMENT_INPUT_MODEL_OPTIONS, BYOK_MODEL_OPTIONS, CAPABILITY_OVERRIDES, CHAT_PDF_ATTACHMENT_MODEL_OPTIONS, CONTEXT_WINDOW_TOKENS, type CapabilityOverride, DEFAULT_CONTEXT_WINDOW_TOKENS, DEFAULT_MODELS, DOCUMENT_INPUT_OVERRIDES, type DocumentInputOverride, FALLBACK_CHAT_MODEL_BY_PROVIDER, FIRST_PARTY_MODEL_PROVIDERS, FirstPartyModelProvider, MODEL_CATALOG_ID_ALIASES, MODEL_CATALOG_PROVIDER_KIND, MODEL_DEFAULT_REASONING_EFFORTS, MODEL_DISPLAY_METADATA, MODEL_RATES, MODEL_REASONING_EFFORTS, MODEL_ROLES, MODEL_TEMPERATURE_POLICIES, ModelDisplayMetadata, ModelRate, ModelRateAmounts, ModelRole, OfferedBYOKModelId, REASONING_EFFORTS, ReasoningEffort, ResolveReasoningEffortOptions, ResolvedReasoningEffort, TANSTACK_AI_PROVIDERS, TEMPERATURE_POLICIES, TanStackAIProvider, TemperaturePolicy, getContextWindowTokens, getModelDefaultReasoningEffort, getModelDisplayMetadata, getModelRate, getModelReasoningEfforts, getStandardModelRate, isBYOKModelRoleSupported, isBYOKProviderRoleSupported, isChatPdfAttachmentModelSupported, normalizeModelCatalogId, resolveModelRate, resolveReasoningEffort, resolveWorkingBYOKModelForRole, shouldEmitTemperature };
1316
+ export { AIProvider, AI_PROVIDERS, ANTHROPIC_ADAPTIVE_THINKING_MODELS, BYOKModelIdByProvider, BYOKProvider, BYOK_DEFAULT_MODELS, BYOK_DOCUMENT_INPUT_MODEL_OPTIONS, BYOK_MODEL_OPTIONS, CAPABILITY_OVERRIDES, CHAT_PDF_ATTACHMENT_MODEL_OPTIONS, CONTEXT_WINDOW_TOKENS, type CapabilityOverride, DEFAULT_CONTEXT_WINDOW_TOKENS, DEFAULT_MODELS, DOCUMENT_INPUT_OVERRIDES, type DocumentInputOverride, FALLBACK_CHAT_MODEL_BY_PROVIDER, FIRST_PARTY_MODEL_PROVIDERS, FirstPartyModelProvider, MODELS_DEV_RATE_PROVIDER_BY_CATALOG_PROVIDER, MODELS_DEV_RATE_SOURCE_ALIASES, MODEL_CATALOG_ID_ALIASES, MODEL_CATALOG_PROVIDER_KIND, MODEL_DEFAULT_REASONING_EFFORTS, MODEL_DISPLAY_METADATA, MODEL_RATES, MODEL_RATE_UNITS_PER_USD, MODEL_REASONING_EFFORTS, MODEL_ROLES, MODEL_TEMPERATURE_POLICIES, ModelDisplayMetadata, type ModelRate, type ModelRateAmounts, ModelRole, type ModelsDevRateProvider, OfferedBYOKModelId, REASONING_EFFORTS, RETAINED_MODELS_DEV_RATE_ENTRIES, ReasoningEffort, ResolveReasoningEffortOptions, ResolvedReasoningEffort, TANSTACK_AI_PROVIDERS, TEMPERATURE_POLICIES, TanStackAIProvider, TemperaturePolicy, getContextWindowTokens, getModelDefaultReasoningEffort, getModelDisplayMetadata, getModelRate, getModelReasoningEfforts, getStandardModelRate, isBYOKModelRoleSupported, isBYOKProviderRoleSupported, isChatPdfAttachmentModelSupported, normalizeModelCatalogId, resolveModelRate, resolveReasoningEffort, resolveWorkingBYOKModelForRole, shouldEmitTemperature };