@cherrystudio/provider-registry 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +166 -2
  3. package/data/models.json +22694 -0
  4. package/data/provider-models.json +41090 -0
  5. package/data/providers.json +2722 -0
  6. package/dist/bundled-catalog.cjs +12 -0
  7. package/dist/bundled-catalog.d.cts +5 -0
  8. package/dist/bundled-catalog.d.mts +5 -0
  9. package/dist/bundled-catalog.mjs +11 -0
  10. package/dist/bundled-models--P3b6A6o.mjs +25220 -0
  11. package/dist/bundled-models-uS9C7ldF.cjs +25224 -0
  12. package/dist/bundled-models.cjs +3 -0
  13. package/dist/bundled-models.d.cts +5 -0
  14. package/dist/bundled-models.d.mts +5 -0
  15. package/dist/bundled-models.mjs +2 -0
  16. package/dist/bundled-provider-models-CT2Ha5w2.cjs +37586 -0
  17. package/dist/bundled-provider-models-y-RYjBUH.mjs +37582 -0
  18. package/dist/bundled-provider-models.cjs +3 -0
  19. package/dist/bundled-provider-models.d.cts +5 -0
  20. package/dist/bundled-provider-models.d.mts +5 -0
  21. package/dist/bundled-provider-models.mjs +2 -0
  22. package/dist/bundled-providers-BcszhEy2.mjs +2172 -0
  23. package/dist/bundled-providers-Bv_iM9AO.cjs +2176 -0
  24. package/dist/bundled-providers.cjs +3 -0
  25. package/dist/bundled-providers.d.cts +5 -0
  26. package/dist/bundled-providers.d.mts +5 -0
  27. package/dist/bundled-providers.mjs +2 -0
  28. package/dist/catalog-DElG_l-8.mjs +369 -0
  29. package/dist/catalog-DurdOhD0.cjs +442 -0
  30. package/dist/catalog-XJyrtwI9.d.cts +53 -0
  31. package/dist/catalog-XJyrtwI9.d.mts +53 -0
  32. package/dist/index.cjs +2620 -0
  33. package/dist/index.d.cts +3932 -0
  34. package/dist/index.d.mts +3932 -0
  35. package/dist/index.mjs +2549 -0
  36. package/dist/model-NFEbqWMs.mjs +665 -0
  37. package/dist/model-kwW2vWDI.cjs +855 -0
  38. package/dist/provider-D14qMZsE.mjs +431 -0
  39. package/dist/provider-DkSIaann.cjs +527 -0
  40. package/dist/provider-models-BjKC53mr.cjs +85 -0
  41. package/dist/provider-models-BkxD9T17.mjs +67 -0
  42. package/dist/provider-models-DuZBXGmP.d.cts +28692 -0
  43. package/dist/provider-models-DuZBXGmP.d.mts +28692 -0
  44. package/dist/registry-BjETdicx.d.mts +35 -0
  45. package/dist/registry-Di5ULW6Z.d.cts +35 -0
  46. package/dist/registry-loader.cjs +170 -0
  47. package/dist/registry-loader.d.cts +64 -0
  48. package/dist/registry-loader.d.mts +64 -0
  49. package/dist/registry-loader.mjs +156 -0
  50. package/package.json +146 -3
package/dist/index.mjs ADDED
@@ -0,0 +1,2549 @@
1
+ import { a as REMOTE_REGISTRY_FILES, c as normalizeModelId, d as stripDateSnapshot, f as stripVariantQuantDateSuffixes, i as REGISTRY_SCHEMA_VERSION, l as stripBedrockDottedVendorPrefix, n as REGISTRY_FILES, o as ModelIndex, r as REGISTRY_MIN_APP_VERSION, s as ProviderModelIndex, t as CatalogManifestSchema, u as stripBedrockRevision } from "./catalog-DElG_l-8.mjs";
2
+ import { C as REASONING_EFFORT, D as objectValues, E as SERVER_TOOL_MODEL_SCOPE, S as MODEL_CAPABILITY, T as SERVER_TOOL, a as ModelConfigSchema, b as ENDPOINT_TYPE, l as ReasoningControlSchema, n as ImageGenerationSupportSchema, o as ModelListSchema, t as ImageGenerationModeSchema, v as CANONICAL_PARAM_KEY, w as REASONING_EFFORT_ORDER, x as MODALITY, y as CURRENCY } from "./model-NFEbqWMs.mjs";
3
+ import { a as REASONING_FORMAT_TYPES, c as ServiceTierOptionsSchema, d as REASONING_WIRE_TARGETS, f as ReasoningFormatWireProfileSchema, g as matchVendor, h as isVendor, i as ProviderListSchema, l as ServiceTierRequestControlSchema, m as VENDOR_PATTERNS, n as ProviderConfigSchema, o as ServerToolConfigSchema, p as ReasoningWireProfileSchema, r as ProviderEditionSchema, s as ServiceTierDeliverySchema, t as FastModeTransportSchema, u as ServiceTierSelectionSchema } from "./provider-D14qMZsE.mjs";
4
+ import { n as ProviderModelOverrideSchema, r as ProviderModelReasoningContractSchema, t as ProviderModelListSchema } from "./provider-models-BkxD9T17.mjs";
5
+ import * as z from "zod";
6
+ //#region src/registry.ts
7
+ /** Parse untrusted model metadata; provider routing is supplied separately by the application. */
8
+ function parseModelSnapshot(input) {
9
+ return {
10
+ models: ModelListSchema.parse(input.models),
11
+ providerModels: ProviderModelListSchema.parse(input.providerModels)
12
+ };
13
+ }
14
+ /** Build a query view over a validated catalog. Treat the input and returned records as read-only. */
15
+ function createRegistry(catalog) {
16
+ const models = [...catalog.models.models];
17
+ const providers = [...catalog.providers.providers];
18
+ const modelIndex = new ModelIndex(models);
19
+ const overrideIndex = new ProviderModelIndex(catalog.providerModels.overrides);
20
+ return {
21
+ listModels: () => models,
22
+ listProviders: () => providers,
23
+ findProvider: (id) => providers.find((provider) => provider.id === id) ?? null,
24
+ findModel: (id) => modelIndex.findModel(id),
25
+ findOverride: (providerId, modelId) => overrideIndex.findOverride(providerId, modelId),
26
+ getOverridesForProvider: (providerId) => overrideIndex.getOverridesForProvider(providerId)
27
+ };
28
+ }
29
+ //#endregion
30
+ //#region src/schemas/imageParamCatalog.ts
31
+ /**
32
+ * Central image-generation parameter catalog.
33
+ *
34
+ * The single source of truth for each canonical param's **value type** (the
35
+ * zod `schema`) and its **vendor wire field name** (`wire` — see {@link wireName}).
36
+ * Per-model `supports` (in the registry data) keeps only the per-model constraints
37
+ * — options / default / range — and is composed with this catalog by
38
+ * `buildParamsSchema`. The renderer derives its control kind from `SupportSpec.type`
39
+ * (`imageGenerationToFields`), so no control kind lives here.
40
+ *
41
+ * Two invariants:
42
+ * - The catalog is **exhaustive** over `CanonicalParamKey`
43
+ * (`satisfies Record<CanonicalParamKey, …>`): a missing key is a compile
44
+ * error, an unknown key is a compile error. A runtime test additionally
45
+ * locks key-set equality with `CANONICAL_PARAM_KEY`.
46
+ * - The wire name is the **vendor API field name** (`negative_prompt`, …) — a
47
+ * vendor convention, NOT AI-SDK knowledge, so it belongs here. Only the
48
+ * AI-SDK-native routing (`n`/`size`/`seed`/`aspectRatio`) stays app-layer in
49
+ * `AI_SDK_NATIVE_BINDINGS`.
50
+ */
51
+ /**
52
+ * Normalize only finite numbers and numeric strings from form controls.
53
+ * Other JavaScript-coercible values (booleans and arrays) stay invalid instead
54
+ * of silently becoming `0`, `1`, or another number at submission time.
55
+ */
56
+ function normalizeImageParamNumber(value) {
57
+ if (value == null) return void 0;
58
+ if (typeof value === "number") return value;
59
+ if (typeof value !== "string") return value;
60
+ const trimmed = value.trim();
61
+ if (!trimmed) return void 0;
62
+ const numeric = Number(trimmed);
63
+ return Number.isFinite(numeric) ? numeric : value;
64
+ }
65
+ const optString = z.string().optional();
66
+ const optBool = z.boolean().optional();
67
+ const optNumber = z.preprocess(normalizeImageParamNumber, z.number().finite().optional());
68
+ const optInt = z.preprocess(normalizeImageParamNumber, z.number().finite().int().optional());
69
+ /**
70
+ * Catalog. Plain object literal + `as const satisfies` so per-key schema types
71
+ * survive for {@link ParamValue} (annotating the object would widen them).
72
+ */
73
+ const IMAGE_PARAM_CATALOG = {
74
+ addWatermark: {
75
+ schema: optBool,
76
+ wire: "watermark"
77
+ },
78
+ aspectRatio: { schema: optString },
79
+ background: { schema: optString },
80
+ bottomScale: { schema: optNumber },
81
+ cfg: { schema: optNumber },
82
+ customSize: { schema: optString },
83
+ detail: { schema: optNumber },
84
+ enableInterleave: { schema: optBool },
85
+ function: { schema: optString },
86
+ guidanceScale: { schema: optNumber },
87
+ imageResolution: {
88
+ schema: optString,
89
+ wire: "size"
90
+ },
91
+ imageWeight: { schema: optNumber },
92
+ isSketch: { schema: optBool },
93
+ leftScale: { schema: optNumber },
94
+ magicPromptOption: { schema: optBool },
95
+ maxImages: { schema: optInt },
96
+ moderation: { schema: optString },
97
+ negativePrompt: { schema: optString },
98
+ numImages: { schema: optInt },
99
+ numInferenceSteps: { schema: optInt },
100
+ outputFormat: { schema: optString },
101
+ outputCompression: { schema: optInt },
102
+ personGeneration: { schema: optString },
103
+ promptEnhancement: { schema: optBool },
104
+ promptExtend: { schema: optBool },
105
+ quality: { schema: optString },
106
+ resolution: { schema: optString },
107
+ refMode: { schema: optString },
108
+ refStrength: { schema: optNumber },
109
+ renderingSpeed: { schema: optString },
110
+ resemblance: { schema: optNumber },
111
+ rightScale: { schema: optNumber },
112
+ safetyTolerance: { schema: optInt },
113
+ seed: { schema: optInt },
114
+ sequentialImageGeneration: { schema: optString },
115
+ size: { schema: optString },
116
+ sourceLang: { schema: optString },
117
+ strength: { schema: optNumber },
118
+ style: { schema: optString },
119
+ styleType: { schema: optString },
120
+ targetLang: { schema: optString },
121
+ thinkingMode: { schema: optBool },
122
+ topScale: { schema: optNumber },
123
+ upscaleFactor: { schema: optNumber }
124
+ };
125
+ /** Parse one dynamic form value through its canonical catalog schema. */
126
+ function parseImageParamValue(key, value) {
127
+ const entry = IMAGE_PARAM_CATALOG[key];
128
+ if (!entry) return void 0;
129
+ const parsed = entry.schema.safeParse(value);
130
+ return parsed.success ? parsed.data : void 0;
131
+ }
132
+ /**
133
+ * Catalog value schema — every canonical key's value schema as a single typed
134
+ * `z.object` whose `z.infer` is exactly {@link ParamValues}. The one `as` is on
135
+ * the dynamic `Object.fromEntries` SHAPE (provably the catalog keys → their
136
+ * schemas); the output type then flows without a cast. Consumers (the
137
+ * `ai.image.generate` IPC payload) use this to validate + coerce the bag with zod
138
+ * AT THE BOUNDARY — non-catalog keys are stripped, per-model option/range
139
+ * constraints stay in the renderer's `buildParamsSchema`.
140
+ */
141
+ const imageParamsSchema = z.object(Object.fromEntries(Object.entries(IMAGE_PARAM_CATALOG).map(([key, entry]) => [key, entry.schema])));
142
+ /** The catalog entry for `key`. */
143
+ function paramCatalogEntry(key) {
144
+ return IMAGE_PARAM_CATALOG[key];
145
+ }
146
+ /** `camelCase` → `snake_case` (the default vendor wire spelling). */
147
+ function autoSnakeCase(key) {
148
+ return key.replace(/[A-Z]/g, (m) => `_${m.toLowerCase()}`);
149
+ }
150
+ /**
151
+ * The vendor wire field name for a canonical param: the catalog `wire` override
152
+ * when set, else the auto camelCase→snake_case form. This is the SINGLE source
153
+ * of the canonical→wire rename — every flat-body provider (silicon / dashscope /
154
+ * dmxapi / aihubmix / …) derives its field name from here instead of repeating
155
+ * the rename. Native params (`n`/`size`/`seed`/`aspectRatio`) are routed by
156
+ * `AI_SDK_NATIVE_BINDINGS` and don't go through this.
157
+ */
158
+ function wireName(key) {
159
+ return paramCatalogEntry(key).wire ?? autoSnakeCase(key);
160
+ }
161
+ /** Every canonical key the catalog covers (for the exhaustiveness lock test). */
162
+ const IMAGE_PARAM_CATALOG_KEYS = Object.keys(IMAGE_PARAM_CATALOG);
163
+ //#endregion
164
+ //#region src/utils/buildParamsSchema.ts
165
+ /**
166
+ * Compose a per-(model, mode) param validation schema from the central
167
+ * {@link IMAGE_PARAM_CATALOG} (value types) and the model's registry
168
+ * `supports` block (per-model constraints: options / range).
169
+ *
170
+ * The catalog owns each param's coercion + value type; the per-model
171
+ * `SupportSpec` is layered on top as additive `.refine` constraints — we never
172
+ * rebuild a fresh zod from the spec (that would lose the catalog's coercion).
173
+ * Each field is `.catch(undefined)` and the object is `.loose()` so one bad /
174
+ * legacy / uncatalogued value never fails the whole submit — the caller treats
175
+ * a parse failure as non-fatal during migration.
176
+ */
177
+ function resolveModeSupports(support, mode) {
178
+ const modes = support?.modes;
179
+ if (!modes) return void 0;
180
+ return (modes[mode] ?? Object.values(modes)[0])?.supports;
181
+ }
182
+ /** Layer the per-model constraint onto the catalog's base value schema. */
183
+ function applyConstraints(base, spec) {
184
+ switch (spec.type) {
185
+ case "enum": return base.refine((v) => v == null || v === "custom" || spec.options.includes(String(v)), { message: "value not in supported options" });
186
+ case "range": return base.refine((v) => v == null || Number(v) >= spec.min && Number(v) <= spec.max, { message: "value out of range" });
187
+ default: return base;
188
+ }
189
+ }
190
+ function buildParamsSchema(support, mode = "generate") {
191
+ const shape = {};
192
+ for (const [key, entry] of Object.entries(IMAGE_PARAM_CATALOG)) shape[key] = entry.schema.catch(void 0);
193
+ const supports = resolveModeSupports(support, mode);
194
+ if (!supports) return z.object(shape).loose();
195
+ for (const [key, spec] of Object.entries(supports)) {
196
+ const entry = IMAGE_PARAM_CATALOG[key];
197
+ if (!entry) continue;
198
+ shape[key] = applyConstraints(entry.schema, spec).catch(void 0);
199
+ if (spec.type === "size") {
200
+ const side = z.preprocess(normalizeImageParamNumber, z.number().finite().min(spec.minSide).max(spec.maxSide).optional());
201
+ shape[`${key}_width`] = side.catch(void 0);
202
+ shape[`${key}_height`] = side.catch(void 0);
203
+ }
204
+ }
205
+ return z.object(shape).loose();
206
+ }
207
+ //#endregion
208
+ //#region src/reasoningProfiles.ts
209
+ const literal = (target, value) => ({
210
+ target,
211
+ value: {
212
+ source: "literal",
213
+ value
214
+ }
215
+ });
216
+ const effort = (target) => ({
217
+ target,
218
+ value: { source: "effort" }
219
+ });
220
+ const summary = (target) => ({
221
+ target,
222
+ value: { source: "assistant-summary" }
223
+ });
224
+ const mode = (operations, rest = {}) => ({
225
+ operations,
226
+ ...rest
227
+ });
228
+ /** Budget-dialect operation — writes the resolved thinking-token count. */
229
+ const budgetTokens = (target) => ({
230
+ target,
231
+ value: { source: "budget" }
232
+ });
233
+ /**
234
+ * Gemini 2.x budget dialect: `thinkingBudget` in tokens (0 = off, -1 = dynamic).
235
+ * These models hard-reject the Gemini 3 `thinkingLevel` field, so every provider
236
+ * proxying them over `google-generate-content` lands here via `wireDialect`.
237
+ */
238
+ const geminiBudgetWire = {
239
+ off: mode([literal("thinkingConfig.includeThoughts", false), literal("thinkingConfig.thinkingBudget", 0)]),
240
+ auto: mode([literal("thinkingConfig.includeThoughts", true), literal("thinkingConfig.thinkingBudget", -1)]),
241
+ effort: {
242
+ operations: [literal("thinkingConfig.includeThoughts", true), budgetTokens("thinkingConfig.thinkingBudget")],
243
+ budget: { missing: {
244
+ type: "fallback",
245
+ value: -1
246
+ } }
247
+ }
248
+ };
249
+ /**
250
+ * Claude <=4.5 budget dialect: `thinking.type=enabled` + `budget_tokens`.
251
+ * `adaptive` is 4.6+, so pre-adaptive SKUs resolve here. `auto` and `effort` are
252
+ * deliberately identical — the dialect has no effort knob on the wire, so a
253
+ * selected effort tier is expressed purely as a token budget.
254
+ */
255
+ const anthropicEnabledBudget = {
256
+ operations: [
257
+ literal("thinking.type", "enabled"),
258
+ budgetTokens("thinking.budgetTokens"),
259
+ literal("sendReasoning", true)
260
+ ],
261
+ budget: {
262
+ missing: {
263
+ type: "fallback",
264
+ value: 13312
265
+ },
266
+ clampToMaxTokens: true
267
+ }
268
+ };
269
+ const anthropicBudgetWire = {
270
+ off: mode([literal("thinking.type", "disabled")]),
271
+ auto: anthropicEnabledBudget,
272
+ effort: anthropicEnabledBudget
273
+ };
274
+ const anthropicAdaptiveWire = {
275
+ auto: mode([literal("thinking.type", "adaptive"), literal("thinking.display", "summarized")]),
276
+ effort: mode([
277
+ literal("thinking.type", "adaptive"),
278
+ literal("thinking.display", "summarized"),
279
+ effort("effort")
280
+ ], { effortMap: { minimal: "low" } })
281
+ };
282
+ const anthropicAlwaysOnWire = {
283
+ ...anthropicAdaptiveWire,
284
+ default: anthropicAdaptiveWire.auto
285
+ };
286
+ const genericEffort = (summaryTarget) => {
287
+ const suffix = summaryTarget ? [summary(summaryTarget)] : [];
288
+ return {
289
+ off: mode([literal("reasoningEffort", "none"), ...suffix]),
290
+ auto: mode([effort("reasoningEffort"), ...suffix], { effortMap: { auto: "medium" } }),
291
+ effort: mode([effort("reasoningEffort"), ...suffix])
292
+ };
293
+ };
294
+ const REASONING_SUMMARY_OPERATIONS = [literal("reasoningSummary", "auto"), summary("reasoningSummary")];
295
+ function stripReasoningSummary(mode) {
296
+ if (!mode) return void 0;
297
+ const operations = mode.operations.filter((operation) => operation.target !== "reasoningSummary");
298
+ return operations.length > 0 ? {
299
+ ...mode,
300
+ operations
301
+ } : void 0;
302
+ }
303
+ /** Apply a user's explicit compatibility choice to an OpenAI Responses wire. */
304
+ function configureOpenAIResponsesSummary(profile, enabled) {
305
+ if (profile.disabled) return profile;
306
+ const configured = { ...profile };
307
+ for (const key of [
308
+ "default",
309
+ "auto",
310
+ "effort"
311
+ ]) {
312
+ const mode = stripReasoningSummary(configured[key]);
313
+ if (enabled) configured[key] = {
314
+ ...mode,
315
+ operations: [...mode?.operations ?? [], ...REASONING_SUMMARY_OPERATIONS]
316
+ };
317
+ else if (mode) configured[key] = mode;
318
+ else delete configured[key];
319
+ }
320
+ return configured;
321
+ }
322
+ /**
323
+ * OpenAI's own Responses reasoning wire. Third-party hosts opt in through an
324
+ * endpoint dialect override because some reject `reasoning.summary`.
325
+ */
326
+ const openaiResponsesSummaryWire = configureOpenAIResponsesSummary(genericEffort(), true);
327
+ const REASONING_FORMAT_PROFILES = {
328
+ "openai-chat": { wire: genericEffort() },
329
+ "openai-responses": { wire: genericEffort() },
330
+ anthropic: {
331
+ wire: {
332
+ ...anthropicAdaptiveWire,
333
+ off: mode([literal("thinking.type", "disabled")])
334
+ },
335
+ budgetWire: anthropicBudgetWire,
336
+ alwaysOnWire: anthropicAlwaysOnWire,
337
+ betweenToolsWire: {
338
+ ...anthropicAlwaysOnWire,
339
+ off: mode([literal("thinking.type", "between_tools")])
340
+ }
341
+ },
342
+ gemini: {
343
+ wire: {
344
+ off: mode([literal("thinkingConfig.includeThoughts", false), literal("thinkingConfig.thinkingLevel", "minimal")]),
345
+ auto: mode([literal("thinkingConfig.includeThoughts", true)]),
346
+ effort: mode([literal("thinkingConfig.includeThoughts", true), effort("thinkingConfig.thinkingLevel")])
347
+ },
348
+ budgetWire: geminiBudgetWire
349
+ },
350
+ ollama: { wire: {
351
+ off: mode([literal("think", false)]),
352
+ auto: mode([literal("think", true)]),
353
+ effort: mode([effort("think")])
354
+ } },
355
+ none: { wire: { disabled: true } }
356
+ };
357
+ /** Select a generation's native wire only when the serving format supports it. */
358
+ function selectFormatWire(profile, dialect) {
359
+ if (dialect === "budget" && profile.budgetWire) return profile.budgetWire;
360
+ if (dialect === "adaptive-always" && profile.alwaysOnWire) return profile.alwaysOnWire;
361
+ if (dialect === "adaptive-between-tools" && profile.betweenToolsWire) return profile.betweenToolsWire;
362
+ return profile.wire;
363
+ }
364
+ //#endregion
365
+ //#region src/utils/reasoningControls.ts
366
+ function deriveLegacyReasoningFields(controls) {
367
+ const effort = controls.find((c) => c.kind === "effort");
368
+ const budget = controls.find((c) => c.kind === "budget");
369
+ const toggle = controls.find((c) => c.kind === "toggle");
370
+ let supportedEfforts = effort ? [...effort.values] : toggle ? ["none", "auto"].slice() : void 0;
371
+ if (effort && toggle && supportedEfforts && !supportedEfforts.includes("none")) supportedEfforts = [...supportedEfforts, "none"];
372
+ return {
373
+ supportedEfforts,
374
+ thinkingTokenLimits: budget ? {
375
+ min: budget.min,
376
+ max: budget.max,
377
+ ...budget.default != null ? { default: budget.default } : {}
378
+ } : void 0,
379
+ defaultEffort: effort?.default
380
+ };
381
+ }
382
+ //#endregion
383
+ //#region src/registry-utils.ts
384
+ /**
385
+ * Pure registry utilities — no fs or Node.js dependency.
386
+ * Safe to import from browser/renderer contexts.
387
+ */
388
+ /**
389
+ * Look up a model's preset data and provider-specific override from loaded registry data.
390
+ * Pure function — no caching, no side effects.
391
+ */
392
+ function lookupRegistryModel(models, providerModels, providerId, modelId) {
393
+ const registryOverride = new ProviderModelIndex(providerModels).findOverride(providerId, modelId);
394
+ return {
395
+ presetModel: new ModelIndex(models).findModel(registryOverride?.modelId ?? modelId),
396
+ registryOverride
397
+ };
398
+ }
399
+ /**
400
+ * Find a provider config by ID from loaded registry data.
401
+ */
402
+ function lookupRegistryProvider(providers, providerId) {
403
+ return providers.find((p) => p.id === providerId) ?? null;
404
+ }
405
+ function wireCarriesReasoningSummary(config) {
406
+ const wire = config.reasoningFormat?.wire;
407
+ if (!wire || wire.disabled) return false;
408
+ return [
409
+ wire.default,
410
+ wire.auto,
411
+ wire.effort
412
+ ].some((mode) => mode?.operations.some((operation) => operation.value.source === "assistant-summary"));
413
+ }
414
+ /**
415
+ * Project registry endpoint configs onto the connection facts persisted in
416
+ * user_provider. Main-only reasoning profiles deliberately stay in registry
417
+ * memory and never cross this boundary.
418
+ */
419
+ function buildPersistedEndpointConfigs(registryConfigs) {
420
+ if (!registryConfigs || Object.keys(registryConfigs).length === 0) return null;
421
+ const configs = {};
422
+ for (const [k, regConfig] of Object.entries(registryConfigs)) {
423
+ const config = {};
424
+ if (regConfig.baseUrl) config.baseUrl = regConfig.baseUrl;
425
+ if (regConfig.modelsApiUrls) config.modelsApiUrls = regConfig.modelsApiUrls;
426
+ if (regConfig.adapterFamily) config.adapterFamily = regConfig.adapterFamily;
427
+ const dialect = { ...regConfig.dialect };
428
+ if (dialect.reasoningSummary === void 0 && wireCarriesReasoningSummary(regConfig)) dialect.reasoningSummary = true;
429
+ if (Object.keys(dialect).length > 0) config.dialect = dialect;
430
+ if (Object.keys(config).length > 0) configs[k] = config;
431
+ }
432
+ return Object.keys(configs).length > 0 ? configs : null;
433
+ }
434
+ /**
435
+ * Default AI SDK adapter family per endpoint type. Used when the catalog
436
+ * doesn't specify one and no more-specific signal (e.g. legacy provider type)
437
+ * is available. The mapping is purely protocol-derived — any endpoint that
438
+ * speaks anthropic-messages format needs the `anthropic` adapter, etc.
439
+ */
440
+ const ENDPOINT_TYPE_TO_DEFAULT_ADAPTER_FAMILY = {
441
+ [ENDPOINT_TYPE.ANTHROPIC_MESSAGES]: "anthropic",
442
+ [ENDPOINT_TYPE.GOOGLE_GENERATE_CONTENT]: "google",
443
+ [ENDPOINT_TYPE.OLLAMA_CHAT]: "ollama",
444
+ [ENDPOINT_TYPE.OLLAMA_GENERATE]: "ollama",
445
+ [ENDPOINT_TYPE.JINA_RERANK]: "jina-rerank",
446
+ [ENDPOINT_TYPE.OPENAI_RESPONSES]: "openai"
447
+ };
448
+ /**
449
+ * Compute the AI SDK adapter family for an endpoint. Single source of truth
450
+ * for seeder / migrator / UI creation paths — `adapterFamily` is a derived,
451
+ * write-time value; the runtime resolver only reads it.
452
+ *
453
+ * 1. Catalog `adapterFamily` wins when present (encodes vendor-specific
454
+ * relay routing like `aihubmix` for anthropic-messages on AiHubMix).
455
+ * 2. Otherwise, fall back to the endpoint-type default
456
+ * (`anthropic-messages` → `anthropic`, etc.).
457
+ * 3. Final fallback `openai-compatible` covers `openai-chat-completions`
458
+ * and any future openai-protocol endpoint without a more specific match.
459
+ */
460
+ function inferAdapterFamily(endpointType, catalogConfig) {
461
+ if (catalogConfig?.adapterFamily) return catalogConfig.adapterFamily;
462
+ return ENDPOINT_TYPE_TO_DEFAULT_ADAPTER_FAMILY[endpointType] ?? "openai-compatible";
463
+ }
464
+ /**
465
+ * Capability-exclusive endpoints imply a model capability: a model whose primary
466
+ * endpoint is `jina-rerank` can only rerank, `openai-embeddings` can only embed,
467
+ * and dedicated image/audio/video endpoints can only serve their named media task.
468
+ * Single source of truth for deriving a capability from a model's endpoint when
469
+ * the catalog has no entry for it (e.g. opaque gateway/NewAPI model ids).
470
+ * Chat/completions endpoints are general-purpose and imply nothing, so they're
471
+ * absent from the map.
472
+ */
473
+ const ENDPOINT_IMPLIED_CAPABILITY = {
474
+ [ENDPOINT_TYPE.JINA_RERANK]: MODEL_CAPABILITY.RERANK,
475
+ [ENDPOINT_TYPE.OPENAI_AUDIO_TRANSCRIPTION]: MODEL_CAPABILITY.AUDIO_TRANSCRIPT,
476
+ [ENDPOINT_TYPE.OPENAI_AUDIO_TRANSLATION]: MODEL_CAPABILITY.AUDIO_TRANSCRIPT,
477
+ [ENDPOINT_TYPE.OPENAI_EMBEDDINGS]: MODEL_CAPABILITY.EMBEDDING,
478
+ [ENDPOINT_TYPE.OPENAI_IMAGE_GENERATION]: MODEL_CAPABILITY.IMAGE_GENERATION,
479
+ [ENDPOINT_TYPE.OPENAI_IMAGE_EDIT]: MODEL_CAPABILITY.IMAGE_GENERATION,
480
+ [ENDPOINT_TYPE.OPENAI_TEXT_TO_SPEECH]: MODEL_CAPABILITY.AUDIO_GENERATION,
481
+ [ENDPOINT_TYPE.OPENAI_VIDEO_GENERATION]: MODEL_CAPABILITY.VIDEO_GENERATION
482
+ };
483
+ /** Capability implied by a capability-exclusive endpoint, or `undefined` for general-purpose endpoints. */
484
+ function endpointImpliedCapability(endpointType) {
485
+ return endpointType ? ENDPOINT_IMPLIED_CAPABILITY[endpointType] : void 0;
486
+ }
487
+ //#endregion
488
+ //#region src/patterns/reasoning-families.ts
489
+ /** Lowercase and strip a namespace prefix (`deepseek/deepseek-r1` → `deepseek-r1`). */
490
+ function baseName(rawModelId) {
491
+ const lower = rawModelId.toLowerCase();
492
+ return lower.slice(lower.lastIndexOf("/") + 1);
493
+ }
494
+ const regexCache$1 = /* @__PURE__ */ new Map();
495
+ function ruleRegex(pattern) {
496
+ let regex = regexCache$1.get(pattern);
497
+ if (!regex) {
498
+ regex = new RegExp(pattern, "i");
499
+ regexCache$1.set(pattern, regex);
500
+ }
501
+ return regex;
502
+ }
503
+ /**
504
+ * Infer a model's reasoning controls from its id against a rule list.
505
+ * Returns `undefined` when nothing matches — callers gate on the model
506
+ * actually being reasoning-capable; rules only know the KNOBS.
507
+ */
508
+ function matchReasoningControls(rawModelId, rules) {
509
+ const id = baseName(rawModelId);
510
+ let vocabularyRule;
511
+ let budgetRule;
512
+ for (const rule of rules) {
513
+ const declaresVocabulary = rule.effort !== void 0 || rule.toggle !== void 0;
514
+ if (!vocabularyRule && declaresVocabulary && ruleRegex(rule.pattern).test(id)) vocabularyRule = rule;
515
+ if (!budgetRule && rule.budget && ruleRegex(rule.pattern).test(id)) budgetRule = rule;
516
+ if (vocabularyRule && budgetRule) break;
517
+ }
518
+ const controls = [];
519
+ if (vocabularyRule?.effort) controls.push({
520
+ kind: "effort",
521
+ values: [...vocabularyRule.effort]
522
+ });
523
+ if (budgetRule?.budget) controls.push({
524
+ kind: "budget",
525
+ min: budgetRule.budget.min,
526
+ max: budgetRule.budget.max
527
+ });
528
+ if (vocabularyRule?.toggle) controls.push({ kind: "toggle" });
529
+ return controls.length ? controls : void 0;
530
+ }
531
+ //#endregion
532
+ //#region src/patterns/reasoning-families.gen.ts
533
+ const REASONING_FAMILY_RULES = [
534
+ {
535
+ pattern: "^qwen3-(?=.*(?:coder|instruct))",
536
+ toggle: false,
537
+ template: true
538
+ },
539
+ {
540
+ pattern: "^qwen3(?:-vl)?-.*thinking",
541
+ toggle: false
542
+ },
543
+ {
544
+ pattern: "^qwen3[.-]8-max-preview",
545
+ toggle: false
546
+ },
547
+ {
548
+ pattern: "^qwen3[.-]8-flash$",
549
+ effort: [
550
+ "low",
551
+ "medium",
552
+ "xhigh"
553
+ ],
554
+ budget: {
555
+ min: 0,
556
+ max: 262144
557
+ },
558
+ toggle: true
559
+ },
560
+ {
561
+ pattern: "^qwq|^qvq",
562
+ toggle: false
563
+ },
564
+ {
565
+ pattern: "^qwen",
566
+ toggle: true,
567
+ template: true
568
+ },
569
+ {
570
+ pattern: "qwen3-235b-a22b-thinking-2507$",
571
+ budget: {
572
+ min: 0,
573
+ max: 81920
574
+ },
575
+ template: true
576
+ },
577
+ {
578
+ pattern: "qwen3-30b-a3b-thinking-2507$",
579
+ budget: {
580
+ min: 0,
581
+ max: 81920
582
+ },
583
+ template: true
584
+ },
585
+ {
586
+ pattern: "qwen3-vl-235b-a22b-thinking$",
587
+ budget: {
588
+ min: 0,
589
+ max: 81920
590
+ },
591
+ template: true
592
+ },
593
+ {
594
+ pattern: "qwen3-vl-30b-a3b-thinking$",
595
+ budget: {
596
+ min: 0,
597
+ max: 81920
598
+ },
599
+ template: true
600
+ },
601
+ {
602
+ pattern: "qwen-plus-2025-07-14$",
603
+ budget: {
604
+ min: 0,
605
+ max: 38912
606
+ },
607
+ template: true
608
+ },
609
+ {
610
+ pattern: "qwen-plus-2025-04-28$",
611
+ budget: {
612
+ min: 0,
613
+ max: 38912
614
+ },
615
+ template: true
616
+ },
617
+ {
618
+ pattern: "qwen3-1[.-]7b$",
619
+ budget: {
620
+ min: 0,
621
+ max: 30720
622
+ },
623
+ template: true
624
+ },
625
+ {
626
+ pattern: "qwen3-0[.-]6b$",
627
+ budget: {
628
+ min: 0,
629
+ max: 30720
630
+ },
631
+ template: true
632
+ },
633
+ {
634
+ pattern: "qwen-plus.*$",
635
+ budget: {
636
+ min: 0,
637
+ max: 81920
638
+ },
639
+ template: true
640
+ },
641
+ {
642
+ pattern: "qwen-turbo.*$",
643
+ budget: {
644
+ min: 0,
645
+ max: 38912
646
+ },
647
+ template: true
648
+ },
649
+ {
650
+ pattern: "qwen-flash.*$",
651
+ budget: {
652
+ min: 0,
653
+ max: 81920
654
+ },
655
+ template: true
656
+ },
657
+ {
658
+ pattern: "qwen3-max(-.*)?$",
659
+ budget: {
660
+ min: 0,
661
+ max: 81920
662
+ },
663
+ template: true
664
+ },
665
+ {
666
+ pattern: "qwen-max-latest$",
667
+ budget: {
668
+ min: 0,
669
+ max: 81920
670
+ },
671
+ template: true
672
+ },
673
+ {
674
+ pattern: "^qwen3[.-][5-7](?!\\d)",
675
+ budget: {
676
+ min: 0,
677
+ max: 81920
678
+ },
679
+ template: true
680
+ },
681
+ {
682
+ pattern: "qwen3-(?!max)(?!\\d+[.-]max).*$",
683
+ budget: {
684
+ min: 1024,
685
+ max: 38912
686
+ },
687
+ template: true
688
+ },
689
+ { pattern: "^qwen3.*thinking" },
690
+ { pattern: "qwq|qvq" },
691
+ { pattern: "^(?!.*(?:coder|asr|tts|reranker|embedding|instruct|thinking))qwen-?3[.-][5-9](?!\\d)" },
692
+ { pattern: "^(?!.*(?:coder|asr|tts|reranker|embedding|instruct|thinking))(?:qwen3-max(?!-2025-09-23)|qwen-max-latest)(?:-|$)" },
693
+ { pattern: "^(?!.*(?:coder|asr|tts|reranker|embedding|instruct|thinking))qwen(?:3[.-][5-9])?-(?:plus|flash|turbo)(?:-|$)" },
694
+ { pattern: "^(?!.*(?:coder|asr|tts|reranker|embedding|instruct|thinking))qwen-?3-\\d" },
695
+ { pattern: "^(?!.*(?:coder|instruct))qwen-?3-(?:vl|omni|next)" },
696
+ { pattern: "^nova-2" },
697
+ {
698
+ pattern: "^(?:(?:[\\w-]+\\.)?anthropic\\.)?claude-haiku-5[.-]5(?:$|[\\[ @:-])",
699
+ effort: [
700
+ "low",
701
+ "medium",
702
+ "high",
703
+ "xhigh",
704
+ "max"
705
+ ],
706
+ toggle: true,
707
+ wireDialect: "effort"
708
+ },
709
+ {
710
+ pattern: "^(?:(?:[\\w-]+\\.)?anthropic\\.)?claude-sonnet-5[.-]5(?:$|[\\[ @:-])",
711
+ effort: [
712
+ "low",
713
+ "medium",
714
+ "high",
715
+ "xhigh",
716
+ "max"
717
+ ],
718
+ toggle: true,
719
+ wireDialect: "adaptive-between-tools"
720
+ },
721
+ {
722
+ pattern: "^(?:(?:[\\w-]+\\.)?anthropic\\.)?claude-opus-5[.-]5(?:$|[\\[ @:-])",
723
+ effort: [
724
+ "low",
725
+ "medium",
726
+ "high",
727
+ "xhigh",
728
+ "max"
729
+ ],
730
+ toggle: false,
731
+ wireDialect: "adaptive-always"
732
+ },
733
+ {
734
+ pattern: "^(?:anthropic\\.)?claude-fable",
735
+ effort: [
736
+ "low",
737
+ "medium",
738
+ "high",
739
+ "max"
740
+ ],
741
+ toggle: false,
742
+ wireDialect: "effort"
743
+ },
744
+ {
745
+ pattern: "^(?:anthropic\\.)?claude-(?:(?:opus|sonnet|haiku)-(?:4[.-][6-9]|[5-9])(?!\\d)|(?:opus|sonnet|haiku)-latest)",
746
+ effort: [
747
+ "low",
748
+ "medium",
749
+ "high",
750
+ "max"
751
+ ],
752
+ toggle: true,
753
+ wireDialect: "effort"
754
+ },
755
+ {
756
+ pattern: "^(?:anthropic\\.)?claude",
757
+ toggle: true,
758
+ wireDialect: "budget",
759
+ template: true
760
+ },
761
+ {
762
+ pattern: "(?:anthropic\\.)?claude-opus-4[.-]7(?:[@\\-:][\\w\\-:]+)?$",
763
+ budget: {
764
+ min: 1024,
765
+ max: 128e3
766
+ },
767
+ template: true
768
+ },
769
+ {
770
+ pattern: "(?:anthropic\\.)?claude-opus-4[.-]6(?:[@\\-:][\\w\\-:]+)?$",
771
+ budget: {
772
+ min: 1024,
773
+ max: 128e3
774
+ },
775
+ template: true
776
+ },
777
+ {
778
+ pattern: "(?:anthropic\\.)?claude-(:?sonnet|haiku)-4[.-]6.*(?:-v\\d+:\\d+)?$",
779
+ budget: {
780
+ min: 1024,
781
+ max: 64e3
782
+ },
783
+ template: true
784
+ },
785
+ {
786
+ pattern: "(?:anthropic\\.)?claude-(:?haiku|sonnet|opus)-4[.-]5.*(?:-v\\d+:\\d+)?$",
787
+ budget: {
788
+ min: 1024,
789
+ max: 64e3
790
+ },
791
+ template: true
792
+ },
793
+ {
794
+ pattern: "(?:anthropic\\.)?claude-opus-4[.-]1.*(?:-v\\d+:\\d+)?$",
795
+ budget: {
796
+ min: 1024,
797
+ max: 32e3
798
+ },
799
+ template: true
800
+ },
801
+ {
802
+ pattern: "(?:anthropic\\.)?claude-sonnet-4(?:[.-]0)?(?:[@-](?:\\d{4,}|[a-z][\\w-]*))?(?:-v\\d+:\\d+)?$",
803
+ budget: {
804
+ min: 1024,
805
+ max: 64e3
806
+ },
807
+ template: true
808
+ },
809
+ {
810
+ pattern: "(?:anthropic\\.)?claude-opus-4(?:[.-]0)?(?:[@-](?:\\d{4,}|[a-z][\\w-]*))?(?:-v\\d+:\\d+)?$",
811
+ budget: {
812
+ min: 1024,
813
+ max: 32e3
814
+ },
815
+ template: true
816
+ },
817
+ {
818
+ pattern: "(?:anthropic\\.)?claude-3[.-]7.*sonnet.*(?:-v\\d+:\\d+)?$",
819
+ budget: {
820
+ min: 1024,
821
+ max: 64e3
822
+ },
823
+ template: true
824
+ },
825
+ { pattern: "claude-3-7-sonnet|claude-3\\.7-sonnet" },
826
+ { pattern: "claude-(?:sonnet|opus|haiku)-4" },
827
+ {
828
+ pattern: "baichuan-m2$",
829
+ budget: {
830
+ min: 0,
831
+ max: 3e4
832
+ },
833
+ template: true
834
+ },
835
+ {
836
+ pattern: "baichuan-m3$",
837
+ budget: {
838
+ min: 0,
839
+ max: 3e4
840
+ },
841
+ template: true
842
+ },
843
+ { pattern: "^baichuan-m[23]$" },
844
+ { pattern: "ring-(?:1t|mini|flash)" },
845
+ { pattern: "^ling-3[.-]0-flash" },
846
+ { pattern: "^inkling" },
847
+ {
848
+ pattern: "doubao-seed-1-6-(?:lite-)?251015|doubao-seed-2[.-]\\d|doubao-seed-1[.-]8",
849
+ effort: [
850
+ "minimal",
851
+ "low",
852
+ "medium",
853
+ "high"
854
+ ]
855
+ },
856
+ {
857
+ pattern: "doubao-(1-5-thinking-pro-m|seed-1[.-]6)(?!-(?:flash|thinking)(?:-|$))(?:-lite)?(?!-251015)(?:-\\d+)?$",
858
+ effort: [
859
+ "none",
860
+ "auto",
861
+ "high"
862
+ ]
863
+ },
864
+ {
865
+ pattern: "doubao-(?:1[.-]5-thinking-vision-pro|1[.-]5-thinking-pro-m|seed-1[.-][68](?:-flash)?(?!-thinking(?:-|$))|seed-code(?:-preview)?(?:-\\d+)?|seed-2[.-]\\d(?:-[\\w-]+)?)(?:-[\\w-]+)*",
866
+ effort: ["none", "high"],
867
+ budget: {
868
+ min: 0,
869
+ max: 30720
870
+ }
871
+ },
872
+ { pattern: "doubao-(?:1[.-]5-thinking-vision-pro|1[.-]5-thinking-pro-m|seed-1[.-][68](?:-flash)?(?!-thinking(?:-|$))|seed-code(?:-preview)?(?:-\\d+)?|seed-2[.-]\\d(?:-[\\w-]+)?)(?:-[\\w-]+)*" },
873
+ { pattern: "seed-oss" },
874
+ { pattern: "^seed-[12][.-]\\d" },
875
+ { pattern: "^command-a-plus" },
876
+ { pattern: "^north-mini-code" },
877
+ {
878
+ pattern: "^deepseek-v(?:[4-9]\\d*|[1-9]\\d{1,})(?:\\.\\d+)?",
879
+ effort: [
880
+ "none",
881
+ "low",
882
+ "high",
883
+ "max"
884
+ ]
885
+ },
886
+ {
887
+ pattern: "^deepseek-flash",
888
+ effort: [
889
+ "none",
890
+ "low",
891
+ "high",
892
+ "max"
893
+ ]
894
+ },
895
+ {
896
+ pattern: "deepseek-(?:chat|v3(?:\\.\\d|-\\d))",
897
+ toggle: true,
898
+ template: true
899
+ },
900
+ { pattern: "(\\w+-)?deepseek-v3(?:\\.\\d|-\\d)(?:(\\.|-)(?!speciale$)\\w+)?$" },
901
+ { pattern: "deepseek-chat" },
902
+ { pattern: "deepseek-v(?:[4-9]\\d*|[1-9]\\d{1,})(?:\\.\\d+)?(?:-[\\w]+)*(?=$|[:/])" },
903
+ { pattern: "deepseek-v3\\.2-speciale" },
904
+ {
905
+ pattern: "^gemini-2",
906
+ wireDialect: "budget",
907
+ template: true
908
+ },
909
+ {
910
+ pattern: "^gemini-omni",
911
+ wireDialect: "budget",
912
+ template: true
913
+ },
914
+ {
915
+ pattern: "^gemini-robotics",
916
+ wireDialect: "budget",
917
+ template: true
918
+ },
919
+ {
920
+ pattern: "^gemini-(?:3|flash-latest|pro-latest|flash-lite-latest)",
921
+ wireDialect: "effort",
922
+ template: true
923
+ },
924
+ {
925
+ pattern: "^gemma-?4",
926
+ toggle: true
927
+ },
928
+ {
929
+ pattern: "^gemini-3(?:\\.\\d+)?-flash|^gemini-3\\.1-flash-lite|^gemini-flash-latest",
930
+ effort: [
931
+ "minimal",
932
+ "low",
933
+ "medium",
934
+ "high"
935
+ ]
936
+ },
937
+ {
938
+ pattern: "^gemini-3-pro",
939
+ effort: ["low", "high"]
940
+ },
941
+ {
942
+ pattern: "^gemini-3\\.\\d+-pro|^gemini-pro-latest",
943
+ effort: [
944
+ "low",
945
+ "medium",
946
+ "high"
947
+ ]
948
+ },
949
+ {
950
+ pattern: "^gemini-robotics",
951
+ toggle: true
952
+ },
953
+ {
954
+ pattern: "^gemini-[\\d.]+.*flash",
955
+ toggle: true,
956
+ template: true
957
+ },
958
+ {
959
+ pattern: "gemini-2[.-]5-flash-lite.*$",
960
+ budget: {
961
+ min: 512,
962
+ max: 24576
963
+ },
964
+ template: true
965
+ },
966
+ {
967
+ pattern: "gemini-flash-lite-latest$",
968
+ budget: {
969
+ min: 512,
970
+ max: 24576
971
+ },
972
+ template: true
973
+ },
974
+ {
975
+ pattern: "gemini-flash-latest$",
976
+ budget: {
977
+ min: 0,
978
+ max: 24576
979
+ },
980
+ template: true
981
+ },
982
+ {
983
+ pattern: "gemini-pro-latest$",
984
+ budget: {
985
+ min: 128,
986
+ max: 32768
987
+ },
988
+ template: true
989
+ },
990
+ {
991
+ pattern: "gemini-.*-flash.*$",
992
+ budget: {
993
+ min: 0,
994
+ max: 24576
995
+ },
996
+ template: true
997
+ },
998
+ {
999
+ pattern: "gemini-.*-pro.*$",
1000
+ budget: {
1001
+ min: 128,
1002
+ max: 32768
1003
+ },
1004
+ template: true
1005
+ },
1006
+ { pattern: "^gemini.*thinking" },
1007
+ { pattern: "gemini-3(?:[.-]\\d+)?-pro-image" },
1008
+ { pattern: "^gemini-3(?:[.-]\\d+)?-flash-tts" },
1009
+ { pattern: "^(?!.*tts).*gemini-(?:2[.-]5.*(?:-latest)?|3(?:[.-]\\d+)?-(?:flash|pro)(?:-preview)?|flash-latest|pro-latest|flash-lite-latest)(?:-[\\w-]+)*$" },
1010
+ { pattern: "^gemini-omni-flash" },
1011
+ { pattern: "^gemini-robotics" },
1012
+ { pattern: "gemma-?4" },
1013
+ {
1014
+ pattern: "^xopdeepseekv3\\d",
1015
+ toggle: true
1016
+ },
1017
+ {
1018
+ pattern: "^xopdeepseekv[4-9]",
1019
+ effort: [
1020
+ "none",
1021
+ "high",
1022
+ "max"
1023
+ ]
1024
+ },
1025
+ {
1026
+ pattern: "^xopkimik(?:2[5-9]\\d*|[3-9]\\d*)",
1027
+ toggle: true
1028
+ },
1029
+ {
1030
+ pattern: "^xopqwen3[5-9]\\d*",
1031
+ budget: {
1032
+ min: 0,
1033
+ max: 81920
1034
+ }
1035
+ },
1036
+ {
1037
+ pattern: "^xopqwen3[5-9]\\d*",
1038
+ toggle: true
1039
+ },
1040
+ {
1041
+ pattern: "^xopglmv?(?:4[5-7]|5\\d*)",
1042
+ toggle: true
1043
+ },
1044
+ {
1045
+ pattern: "^xsparkx2",
1046
+ toggle: true
1047
+ },
1048
+ { pattern: "^mercury-2" },
1049
+ {
1050
+ pattern: "^longcat-2[.-]0$",
1051
+ toggle: true
1052
+ },
1053
+ { pattern: "^muse-spark" },
1054
+ {
1055
+ pattern: "^minimax-m3[.-]1-flash-preview$",
1056
+ effort: [
1057
+ "low",
1058
+ "medium",
1059
+ "high",
1060
+ "xhigh",
1061
+ "max"
1062
+ ],
1063
+ toggle: false
1064
+ },
1065
+ { pattern: "minimax-m\\d" },
1066
+ {
1067
+ pattern: "^mistral-small-2603",
1068
+ effort: ["none", "high"]
1069
+ },
1070
+ { pattern: "magistral" },
1071
+ { pattern: "mistral-small-2603" },
1072
+ { pattern: "^mistral-(?:small|medium)(?!.*instruct)" },
1073
+ {
1074
+ pattern: "^kimi-k2[.-]7-code",
1075
+ toggle: false
1076
+ },
1077
+ {
1078
+ pattern: "^kimi-k3$",
1079
+ effort: [
1080
+ "low",
1081
+ "high",
1082
+ "max"
1083
+ ],
1084
+ toggle: true
1085
+ },
1086
+ {
1087
+ pattern: "^kimi-k3-fast$",
1088
+ effort: [
1089
+ "low",
1090
+ "high",
1091
+ "max"
1092
+ ]
1093
+ },
1094
+ {
1095
+ pattern: "^kimi-k2[.-][5-9]\\d*",
1096
+ toggle: true
1097
+ },
1098
+ {
1099
+ pattern: "kimi-k2[.-][5-9]\\d*",
1100
+ budget: {
1101
+ min: 0,
1102
+ max: 30720
1103
+ },
1104
+ template: true
1105
+ },
1106
+ { pattern: "^kimi-k2-thinking(?:-turbo)?$|^kimi-k(?:2[.-][5-9]\\d*|[3-9]\\d*(?:[.-]\\d+)?)(?:-[\\w-]+)?$" },
1107
+ { pattern: "(?:llama-3-1-)?nemotron-(?:\\d+(?:-\\d+)*-)?(?:nano|super|ultra|lightning)" },
1108
+ { pattern: "^muse-glimmer" },
1109
+ {
1110
+ pattern: "^gpt-6[.-]1-sol(?:$|-)",
1111
+ effort: [
1112
+ "low",
1113
+ "medium",
1114
+ "high",
1115
+ "xhigh",
1116
+ "max"
1117
+ ]
1118
+ },
1119
+ {
1120
+ pattern: "^gpt-6-astra",
1121
+ effort: [
1122
+ "low",
1123
+ "medium",
1124
+ "high",
1125
+ "xhigh",
1126
+ "max"
1127
+ ]
1128
+ },
1129
+ {
1130
+ pattern: "^(?:o\\d|gpt).*deep[-_]?research",
1131
+ effort: ["medium"]
1132
+ },
1133
+ {
1134
+ pattern: "^gpt-5[.-]1-codex-max",
1135
+ effort: [
1136
+ "medium",
1137
+ "high",
1138
+ "xhigh"
1139
+ ]
1140
+ },
1141
+ {
1142
+ pattern: "^gpt-5[.-]1-codex",
1143
+ effort: ["medium", "high"]
1144
+ },
1145
+ {
1146
+ pattern: "^gpt-5[.-]1(?!\\d)(?!.*chat)",
1147
+ effort: [
1148
+ "none",
1149
+ "low",
1150
+ "medium",
1151
+ "high"
1152
+ ]
1153
+ },
1154
+ {
1155
+ pattern: "^gpt-5-pro",
1156
+ effort: ["high"]
1157
+ },
1158
+ {
1159
+ pattern: "^gpt-5[.-]\\d+-pro",
1160
+ effort: [
1161
+ "medium",
1162
+ "high",
1163
+ "xhigh"
1164
+ ]
1165
+ },
1166
+ {
1167
+ pattern: "^gpt-5-codex",
1168
+ effort: [
1169
+ "low",
1170
+ "medium",
1171
+ "high"
1172
+ ]
1173
+ },
1174
+ {
1175
+ pattern: "^gpt-5[.-]\\d+-codex",
1176
+ effort: [
1177
+ "low",
1178
+ "medium",
1179
+ "high",
1180
+ "xhigh"
1181
+ ]
1182
+ },
1183
+ {
1184
+ pattern: "^gpt-5[.-]\\d+(?!.*chat)",
1185
+ effort: [
1186
+ "none",
1187
+ "low",
1188
+ "medium",
1189
+ "high",
1190
+ "xhigh"
1191
+ ]
1192
+ },
1193
+ {
1194
+ pattern: "^gpt-5(?![.-]\\d)(?!.*chat)",
1195
+ effort: [
1196
+ "minimal",
1197
+ "low",
1198
+ "medium",
1199
+ "high"
1200
+ ]
1201
+ },
1202
+ {
1203
+ pattern: "^gpt-6",
1204
+ effort: [
1205
+ "none",
1206
+ "low",
1207
+ "medium",
1208
+ "high",
1209
+ "xhigh",
1210
+ "max"
1211
+ ]
1212
+ },
1213
+ {
1214
+ pattern: "^gpt-oss",
1215
+ effort: [
1216
+ "low",
1217
+ "medium",
1218
+ "high"
1219
+ ]
1220
+ },
1221
+ {
1222
+ pattern: "^o1(?!-preview|-mini)|^o3|^o4",
1223
+ effort: [
1224
+ "low",
1225
+ "medium",
1226
+ "high"
1227
+ ]
1228
+ },
1229
+ { pattern: "^o\\d+(?:-[\\w-]+)?$" },
1230
+ { pattern: "^(?!.*o1-(?:preview|mini)).*o1" },
1231
+ { pattern: "^(?!.*o3-mini).*o3" },
1232
+ { pattern: "gpt-oss" },
1233
+ { pattern: "^(?!.*chat).*gpt-5" },
1234
+ { pattern: "^gpt-realtime-2" },
1235
+ {
1236
+ pattern: "^sonar-reasoning|^sonar-deep-research",
1237
+ effort: [
1238
+ "low",
1239
+ "medium",
1240
+ "high"
1241
+ ]
1242
+ },
1243
+ { pattern: "sonar-deep-research" },
1244
+ { pattern: "step-3" },
1245
+ { pattern: "step-r1-v-mini" },
1246
+ {
1247
+ pattern: "^hunyuan-a13b",
1248
+ toggle: true
1249
+ },
1250
+ {
1251
+ pattern: "hunyuan-a13b",
1252
+ budget: {
1253
+ min: 0,
1254
+ max: 30720
1255
+ },
1256
+ template: true
1257
+ },
1258
+ { pattern: "hunyuan-t1" },
1259
+ { pattern: "hunyuan-a13b" },
1260
+ { pattern: "^hy[34]" },
1261
+ { pattern: "^solar-pro-?[2-9]" },
1262
+ { pattern: "^muse-spark" },
1263
+ { pattern: "^interfaze" },
1264
+ { pattern: "^laguna-s" },
1265
+ {
1266
+ pattern: "^grok-4\\.3(?!.*non-reasoning)",
1267
+ effort: [
1268
+ "none",
1269
+ "low",
1270
+ "medium",
1271
+ "high"
1272
+ ]
1273
+ },
1274
+ {
1275
+ pattern: "^grok-4[.-][67](?!.*non-reasoning)",
1276
+ effort: [
1277
+ "low",
1278
+ "medium",
1279
+ "high",
1280
+ "xhigh"
1281
+ ]
1282
+ },
1283
+ {
1284
+ pattern: "^grok-3-mini",
1285
+ effort: ["low", "high"]
1286
+ },
1287
+ { pattern: "\\bgrok-(?:3-mini|4|4-fast)(?:-[\\w-]+)?\\b" },
1288
+ { pattern: "grok-build" },
1289
+ {
1290
+ pattern: "mimo-v2[.-]5(?:-pro)?(?!-)|mimo-v2[.-]6-(?:flash|pro|pro-ultraspeed)(?!-)|mimo-v2-(?:flash|pro|omni)",
1291
+ toggle: true
1292
+ },
1293
+ { pattern: "mimo-v2[.-]5-pro-ultraspeed" },
1294
+ {
1295
+ pattern: "glm-5[.-]3(?:-|$)",
1296
+ effort: [
1297
+ "low",
1298
+ "high",
1299
+ "max"
1300
+ ],
1301
+ toggle: false
1302
+ },
1303
+ {
1304
+ pattern: "glm-?5|glm-4[.-][567]",
1305
+ toggle: true
1306
+ },
1307
+ { pattern: "glm-zero-preview" },
1308
+ { pattern: "glm-z1" }
1309
+ ];
1310
+ //#endregion
1311
+ //#region src/patterns/reasoning-membership.ts
1312
+ /**
1313
+ * Creator-agnostic id shapes that mark a reasoning model regardless of
1314
+ * vendor: generic reasoning words, DeepSeek-R1-style `-rN` revisions.
1315
+ * `pangu-pro-moe` is an unattributed residue — Huawei has no creator entry
1316
+ * to carry it; move it there if one ever exists.
1317
+ */
1318
+ const GENERIC_REASONING_SHAPES = [
1319
+ "\\b(?:reasoning|reasoner|thinking|think)\\b",
1320
+ "-r\\d+",
1321
+ "pangu-pro-moe"
1322
+ ];
1323
+ /** Explicit non-reasoning marker — vetoes every pattern (generic and creator). */
1324
+ const NON_REASONING_GUARD = /-non-reasoning\b/i;
1325
+ const regexCache = /* @__PURE__ */ new Map();
1326
+ function membershipRegex(pattern) {
1327
+ let regex = regexCache.get(pattern);
1328
+ if (!regex) {
1329
+ regex = new RegExp(pattern, "i");
1330
+ regexCache.set(pattern, regex);
1331
+ }
1332
+ return regex;
1333
+ }
1334
+ /**
1335
+ * Normalize a raw id the way the legacy gate did (`getLowerBaseModelName`):
1336
+ * lowercase, Fireworks `1p5` → `1.5`, strip the namespace prefix and the
1337
+ * `:free` / `(free)` / `:cloud` listing suffixes.
1338
+ */
1339
+ function membershipBaseName(rawModelId) {
1340
+ const lower = (rawModelId.toLowerCase().startsWith("accounts/fireworks/models/") ? rawModelId.replace(/(\d)p(?=\d)/g, "$1.") : rawModelId).toLowerCase();
1341
+ let base = lower.slice(lower.lastIndexOf("/") + 1);
1342
+ if (base.endsWith(":free")) base = base.slice(0, -5);
1343
+ if (base.endsWith("(free)")) base = base.slice(0, -6);
1344
+ if (base.endsWith(":cloud")) base = base.slice(0, -6);
1345
+ return base;
1346
+ }
1347
+ /** Test an id against the rule table: profile rules + generic shapes grant membership. */
1348
+ function matchReasoningMembership(rawModelId, rules) {
1349
+ const id = membershipBaseName(rawModelId);
1350
+ if (NON_REASONING_GUARD.test(id)) return false;
1351
+ return rules.some((rule) => rule.template !== true && membershipRegex(rule.pattern).test(id)) || GENERIC_REASONING_SHAPES.some((pattern) => membershipRegex(pattern).test(id));
1352
+ }
1353
+ //#endregion
1354
+ //#region src/patterns/reasoning-heuristics.ts
1355
+ const VENDOR_TO_CREATOR = {
1356
+ anthropic: "anthropic",
1357
+ gemini: "google",
1358
+ gemma: "google",
1359
+ grok: "xai",
1360
+ openai: "openai",
1361
+ qwen: "alibaba",
1362
+ doubao: "bytedance",
1363
+ hunyuan: "tencent",
1364
+ kimi: "moonshot",
1365
+ deepseek: "deepseek",
1366
+ perplexity: "perplexity",
1367
+ baichuan: "baichuan",
1368
+ mimo: "xiaomi",
1369
+ ling: "bailing",
1370
+ minimax: "minimax",
1371
+ step: "stepfun",
1372
+ zhipu: "zhipu",
1373
+ mistral: "mistral"
1374
+ };
1375
+ /**
1376
+ * Is this id a reasoning model at all? The ingest MEMBERSHIP gate consulted
1377
+ * before `inferReasoningControls` supplies the knobs. Membership is implied
1378
+ * by the same rule table: PROFILE rules grant it, TEMPLATE rules (broad
1379
+ * knob-shape carriers like the `^qwen` toggle) don't. Skip it when the
1380
+ * model's REASONING capability is already declared.
1381
+ */
1382
+ function inferReasoningMembership(rawModelId) {
1383
+ return matchReasoningMembership(rawModelId, REASONING_FAMILY_RULES);
1384
+ }
1385
+ /**
1386
+ * Infer a model's reasoning controls from its id. Returns `undefined` when no
1387
+ * family rule matches — callers gate on the model actually being
1388
+ * reasoning-capable; rules only know the KNOBS. The wire dialect is NOT part
1389
+ * of the result: it follows the serving provider's endpoint declaration.
1390
+ */
1391
+ function inferReasoningControls(rawModelId) {
1392
+ return matchReasoningControls(rawModelId, REASONING_FAMILY_RULES);
1393
+ }
1394
+ /** Infer canonical creator metadata once for an unmatched/custom model. */
1395
+ function inferReasoningOwnedBy(rawModelId) {
1396
+ const lower = rawModelId.toLowerCase();
1397
+ const base = lower.slice(lower.lastIndexOf("/") + 1);
1398
+ const vendor = matchVendor(base);
1399
+ return vendor ? VENDOR_TO_CREATOR[vendor] : void 0;
1400
+ }
1401
+ //#endregion
1402
+ //#region src/patterns/server-tool-constraints.gen.ts
1403
+ /**
1404
+ * GENERATED FILE — DO NOT EDIT.
1405
+ *
1406
+ * Compiled from `Creator.serverToolFunctionMixing` and `Creator.webSearchUnsupportedEfforts`
1407
+ * declarations by scripts/generate-catalog.ts — edit the creator and run `pnpm generate`.
1408
+ */
1409
+ /** Models whose provider-native tools coexist with function declarations in one request. */
1410
+ const SERVER_TOOL_FUNCTION_MIXING_MODEL_IDS = [
1411
+ "gemini-3-1-flash-image",
1412
+ "gemini-3-1-flash-image-preview",
1413
+ "gemini-3-1-flash-lite",
1414
+ "gemini-3-1-flash-lite-image",
1415
+ "gemini-3-1-flash-lite-preview",
1416
+ "gemini-3-1-flash-live-preview",
1417
+ "gemini-3-1-flash-tts-preview",
1418
+ "gemini-3-1-pro-preview",
1419
+ "gemini-3-1-pro-preview-customtools",
1420
+ "gemini-3-5-flash",
1421
+ "gemini-3-5-flash-lite",
1422
+ "gemini-3-5-live-translate-preview",
1423
+ "gemini-3-5-transcribe",
1424
+ "gemini-3-5-transcribe-live",
1425
+ "gemini-3-6-flash",
1426
+ "gemini-3-7-flash",
1427
+ "gemini-3-8-flash",
1428
+ "gemini-3-flash",
1429
+ "gemini-3-flash-preview",
1430
+ "gemini-3-pro-image",
1431
+ "gemini-3-pro-image-preview",
1432
+ "gemini-flash-latest",
1433
+ "gemini-pro-latest"
1434
+ ];
1435
+ /** Reasoning efforts the provider-native web-search tool rejects, by model id. */
1436
+ const WEB_SEARCH_UNSUPPORTED_EFFORTS = {
1437
+ "gpt-5": ["minimal"],
1438
+ "gpt-5-codex": ["minimal"],
1439
+ "gpt-5-image": ["minimal"],
1440
+ "gpt-5-image-mini": ["minimal"],
1441
+ "gpt-5-mini": ["minimal"],
1442
+ "gpt-5-nano": ["minimal"],
1443
+ "gpt-5-pro": ["minimal"]
1444
+ };
1445
+ //#endregion
1446
+ //#region src/patterns/serverToolConstraints.ts
1447
+ /**
1448
+ * Per-model provider-native tool constraints compiled from creator data.
1449
+ * Same runtime contract as `serverToolModelEligibility`: exact-id lookups
1450
+ * over generated tables, never generic model capabilities or runtime regex.
1451
+ */
1452
+ const MIXING_MODEL_IDS = new Set(SERVER_TOOL_FUNCTION_MIXING_MODEL_IDS);
1453
+ /** Whether the model's provider-native tools coexist with function declarations (absent ⇒ conflict-prone). */
1454
+ function supportsServerToolFunctionMixing(rawModelId) {
1455
+ return MIXING_MODEL_IDS.has(normalizeModelId(rawModelId, { keepParameterSize: true })) || MIXING_MODEL_IDS.has(normalizeModelId(rawModelId));
1456
+ }
1457
+ /** Whether the provider-native web-search tool rejects this reasoning effort on this model. */
1458
+ function isWebSearchEffortUnsupported(rawModelId, effort) {
1459
+ return (WEB_SEARCH_UNSUPPORTED_EFFORTS[normalizeModelId(rawModelId, { keepParameterSize: true })] ?? WEB_SEARCH_UNSUPPORTED_EFFORTS[normalizeModelId(rawModelId)])?.includes(effort) ?? false;
1460
+ }
1461
+ //#endregion
1462
+ //#region src/patterns/serverToolModelEligibility.ts
1463
+ const ELIGIBLE_MODEL_IDS = new Map(Object.entries({
1464
+ cherryin: {
1465
+ "web-search": [
1466
+ "claude-haiku-4-5",
1467
+ "claude-opus-4",
1468
+ "claude-opus-4-1",
1469
+ "claude-opus-4-5",
1470
+ "claude-opus-4-6",
1471
+ "claude-opus-4-6-v1",
1472
+ "claude-opus-4-7",
1473
+ "claude-opus-4-8",
1474
+ "claude-opus-4-8-fast",
1475
+ "claude-sonnet-4",
1476
+ "claude-sonnet-4-5",
1477
+ "claude-sonnet-4-6",
1478
+ "gemini-2-5-computer-use-preview-10-2025",
1479
+ "gemini-2-5-flash",
1480
+ "gemini-2-5-flash-lite",
1481
+ "gemini-2-5-pro",
1482
+ "gemini-2-5-pro-preview",
1483
+ "gemini-2-5-pro-preview-05-06",
1484
+ "gemini-3-1-flash-lite",
1485
+ "gemini-3-1-flash-lite-preview",
1486
+ "gemini-3-1-flash-live-preview",
1487
+ "gemini-3-1-pro-preview",
1488
+ "gemini-3-1-pro-preview-customtools",
1489
+ "gemini-3-5-flash",
1490
+ "gemini-3-5-flash-lite",
1491
+ "gemini-3-6-flash",
1492
+ "gemini-3-7-flash",
1493
+ "gemini-3-8-flash",
1494
+ "gemini-3-flash",
1495
+ "gemini-3-flash-preview",
1496
+ "gemini-3-pro-image",
1497
+ "gemini-3-pro-image-preview",
1498
+ "gemini-flash-latest",
1499
+ "gemini-flash-lite-latest",
1500
+ "gemini-pro-latest",
1501
+ "gpt-4-1",
1502
+ "gpt-4-1-mini",
1503
+ "gpt-4-1-nano",
1504
+ "gpt-4o",
1505
+ "gpt-4o-mini",
1506
+ "gpt-5",
1507
+ "gpt-5-1",
1508
+ "gpt-5-1-codex",
1509
+ "gpt-5-1-codex-max",
1510
+ "gpt-5-1-codex-mini",
1511
+ "gpt-5-2",
1512
+ "gpt-5-2-chat",
1513
+ "gpt-5-2-chat-latest",
1514
+ "gpt-5-2-codex",
1515
+ "gpt-5-2-pro",
1516
+ "gpt-5-3-chat-latest",
1517
+ "gpt-5-3-codex",
1518
+ "gpt-5-3-codex-spark",
1519
+ "gpt-5-4",
1520
+ "gpt-5-4-mini",
1521
+ "gpt-5-4-nano",
1522
+ "gpt-5-4-pro",
1523
+ "gpt-5-5",
1524
+ "gpt-5-5-pro",
1525
+ "gpt-5-6",
1526
+ "gpt-5-6-luna",
1527
+ "gpt-5-6-luna-pro",
1528
+ "gpt-5-6-sol",
1529
+ "gpt-5-6-sol-pro",
1530
+ "gpt-5-6-terra",
1531
+ "gpt-5-6-terra-pro",
1532
+ "gpt-5-chat",
1533
+ "gpt-5-codex",
1534
+ "gpt-5-mini",
1535
+ "gpt-5-nano",
1536
+ "gpt-5-pro",
1537
+ "o3",
1538
+ "o3-mini",
1539
+ "o3-pro",
1540
+ "o4-mini"
1541
+ ],
1542
+ "url-context": [
1543
+ "claude-haiku-4-5",
1544
+ "claude-opus-4",
1545
+ "claude-opus-4-1",
1546
+ "claude-opus-4-5",
1547
+ "claude-opus-4-6",
1548
+ "claude-opus-4-6-v1",
1549
+ "claude-opus-4-7",
1550
+ "claude-opus-4-8",
1551
+ "claude-opus-4-8-fast",
1552
+ "claude-sonnet-4",
1553
+ "claude-sonnet-4-5",
1554
+ "claude-sonnet-4-6",
1555
+ "gemini-2-5-computer-use-preview-10-2025",
1556
+ "gemini-2-5-flash",
1557
+ "gemini-2-5-flash-image",
1558
+ "gemini-2-5-flash-image-preview",
1559
+ "gemini-2-5-flash-lite",
1560
+ "gemini-2-5-pro",
1561
+ "gemini-2-5-pro-preview",
1562
+ "gemini-2-5-pro-preview-05-06",
1563
+ "gemini-3-1-flash-image",
1564
+ "gemini-3-1-flash-image-preview",
1565
+ "gemini-3-1-flash-lite",
1566
+ "gemini-3-1-flash-lite-image",
1567
+ "gemini-3-1-flash-lite-preview",
1568
+ "gemini-3-1-flash-live-preview",
1569
+ "gemini-3-1-pro-preview",
1570
+ "gemini-3-1-pro-preview-customtools",
1571
+ "gemini-3-5-flash",
1572
+ "gemini-3-5-flash-lite",
1573
+ "gemini-3-6-flash",
1574
+ "gemini-3-7-flash",
1575
+ "gemini-3-8-flash",
1576
+ "gemini-3-flash",
1577
+ "gemini-3-flash-preview",
1578
+ "gemini-3-pro-image",
1579
+ "gemini-3-pro-image-preview",
1580
+ "gemini-flash-latest",
1581
+ "gemini-flash-lite-latest",
1582
+ "gemini-pro-latest"
1583
+ ]
1584
+ },
1585
+ aihubmix: {
1586
+ "web-search": [
1587
+ "claude-fable-5",
1588
+ "claude-fable-5-1",
1589
+ "claude-haiku-4-5",
1590
+ "claude-opus-4",
1591
+ "claude-opus-4-1",
1592
+ "claude-opus-4-5",
1593
+ "claude-opus-4-6",
1594
+ "claude-opus-4-6-v1",
1595
+ "claude-opus-4-7",
1596
+ "claude-opus-4-8",
1597
+ "claude-opus-4-8-fast",
1598
+ "claude-opus-5",
1599
+ "claude-opus-5-5",
1600
+ "claude-opus-5-fast",
1601
+ "claude-sonnet-4",
1602
+ "claude-sonnet-4-5",
1603
+ "claude-sonnet-4-6",
1604
+ "gemini-2-5-computer-use-preview-10-2025",
1605
+ "gemini-2-5-flash",
1606
+ "gemini-2-5-flash-lite",
1607
+ "gemini-2-5-pro",
1608
+ "gemini-2-5-pro-preview",
1609
+ "gemini-2-5-pro-preview-05-06",
1610
+ "gemini-3-1-flash-lite",
1611
+ "gemini-3-1-flash-lite-preview",
1612
+ "gemini-3-1-flash-live-preview",
1613
+ "gemini-3-1-pro-preview",
1614
+ "gemini-3-1-pro-preview-customtools",
1615
+ "gemini-3-5-flash",
1616
+ "gemini-3-5-flash-lite",
1617
+ "gemini-3-6-flash",
1618
+ "gemini-3-7-flash",
1619
+ "gemini-3-8-flash",
1620
+ "gemini-3-flash",
1621
+ "gemini-3-flash-preview",
1622
+ "gemini-3-pro-image",
1623
+ "gemini-3-pro-image-preview",
1624
+ "gemini-flash-latest",
1625
+ "gemini-flash-lite-latest",
1626
+ "gemini-pro-latest",
1627
+ "gpt-4-1",
1628
+ "gpt-4-1-mini",
1629
+ "gpt-4-1-nano",
1630
+ "gpt-4o",
1631
+ "gpt-4o-mini",
1632
+ "gpt-5",
1633
+ "gpt-5-1",
1634
+ "gpt-5-1-codex",
1635
+ "gpt-5-1-codex-max",
1636
+ "gpt-5-1-codex-mini",
1637
+ "gpt-5-2",
1638
+ "gpt-5-2-chat",
1639
+ "gpt-5-2-chat-latest",
1640
+ "gpt-5-2-codex",
1641
+ "gpt-5-2-pro",
1642
+ "gpt-5-3-chat-latest",
1643
+ "gpt-5-3-codex",
1644
+ "gpt-5-3-codex-spark",
1645
+ "gpt-5-4",
1646
+ "gpt-5-4-mini",
1647
+ "gpt-5-4-nano",
1648
+ "gpt-5-4-pro",
1649
+ "gpt-5-5",
1650
+ "gpt-5-5-pro",
1651
+ "gpt-5-6",
1652
+ "gpt-5-6-luna",
1653
+ "gpt-5-6-luna-pro",
1654
+ "gpt-5-6-sol",
1655
+ "gpt-5-6-sol-pro",
1656
+ "gpt-5-6-terra",
1657
+ "gpt-5-6-terra-pro",
1658
+ "gpt-5-chat",
1659
+ "gpt-5-codex",
1660
+ "gpt-5-mini",
1661
+ "gpt-5-nano",
1662
+ "gpt-5-pro",
1663
+ "gpt-6-1-sol",
1664
+ "gpt-6-astra",
1665
+ "gpt-6-astra-pro",
1666
+ "gpt-6-luna",
1667
+ "gpt-6-sol",
1668
+ "o3",
1669
+ "o3-mini",
1670
+ "o3-pro",
1671
+ "o4-mini"
1672
+ ],
1673
+ "url-context": [
1674
+ "claude-fable-5",
1675
+ "claude-fable-5-1",
1676
+ "claude-haiku-4-5",
1677
+ "claude-opus-4",
1678
+ "claude-opus-4-1",
1679
+ "claude-opus-4-5",
1680
+ "claude-opus-4-6",
1681
+ "claude-opus-4-6-v1",
1682
+ "claude-opus-4-7",
1683
+ "claude-opus-4-8",
1684
+ "claude-opus-4-8-fast",
1685
+ "claude-opus-5",
1686
+ "claude-opus-5-5",
1687
+ "claude-opus-5-fast",
1688
+ "claude-sonnet-4",
1689
+ "claude-sonnet-4-5",
1690
+ "claude-sonnet-4-6",
1691
+ "gemini-2-5-computer-use-preview-10-2025",
1692
+ "gemini-2-5-flash",
1693
+ "gemini-2-5-flash-image",
1694
+ "gemini-2-5-flash-image-preview",
1695
+ "gemini-2-5-flash-lite",
1696
+ "gemini-2-5-pro",
1697
+ "gemini-2-5-pro-preview",
1698
+ "gemini-2-5-pro-preview-05-06",
1699
+ "gemini-3-1-flash-image",
1700
+ "gemini-3-1-flash-image-preview",
1701
+ "gemini-3-1-flash-lite",
1702
+ "gemini-3-1-flash-lite-image",
1703
+ "gemini-3-1-flash-lite-preview",
1704
+ "gemini-3-1-flash-live-preview",
1705
+ "gemini-3-1-pro-preview",
1706
+ "gemini-3-1-pro-preview-customtools",
1707
+ "gemini-3-5-flash",
1708
+ "gemini-3-5-flash-lite",
1709
+ "gemini-3-6-flash",
1710
+ "gemini-3-7-flash",
1711
+ "gemini-3-8-flash",
1712
+ "gemini-3-flash",
1713
+ "gemini-3-flash-preview",
1714
+ "gemini-3-pro-image",
1715
+ "gemini-3-pro-image-preview",
1716
+ "gemini-flash-latest",
1717
+ "gemini-flash-lite-latest",
1718
+ "gemini-pro-latest"
1719
+ ]
1720
+ },
1721
+ zhipu: { "web-search": [
1722
+ "glm-4",
1723
+ "glm-4-1v",
1724
+ "glm-4-5",
1725
+ "glm-4-5-air",
1726
+ "glm-4-5-flash",
1727
+ "glm-4-5v",
1728
+ "glm-4-6",
1729
+ "glm-4-6v",
1730
+ "glm-4-7",
1731
+ "glm-4-7-flash",
1732
+ "glm-4-7-flashx",
1733
+ "glm-4-7-maas",
1734
+ "glm-4-air",
1735
+ "glm-4-airx",
1736
+ "glm-4-flash",
1737
+ "glm-4-flashx",
1738
+ "glm-4-long",
1739
+ "glm-4-plus",
1740
+ "glm-5",
1741
+ "glm-5-1",
1742
+ "glm-5-2",
1743
+ "glm-5-2-fast",
1744
+ "glm-5-3",
1745
+ "glm-5-3-fast",
1746
+ "glm-5-3-flash",
1747
+ "glm-5-maas",
1748
+ "glm-5-turbo"
1749
+ ] },
1750
+ deepseek: { "web-search": [
1751
+ "deepseek-flash",
1752
+ "deepseek-flash-latest",
1753
+ "deepseek-v4-pro"
1754
+ ] },
1755
+ "new-api": {
1756
+ "web-search": [
1757
+ "claude-haiku-4-5",
1758
+ "claude-opus-4",
1759
+ "claude-opus-4-1",
1760
+ "claude-opus-4-5",
1761
+ "claude-opus-4-6",
1762
+ "claude-opus-4-6-v1",
1763
+ "claude-opus-4-7",
1764
+ "claude-opus-4-8",
1765
+ "claude-opus-4-8-fast",
1766
+ "claude-sonnet-4",
1767
+ "claude-sonnet-4-5",
1768
+ "claude-sonnet-4-6",
1769
+ "gemini-2-5-computer-use-preview-10-2025",
1770
+ "gemini-2-5-flash",
1771
+ "gemini-2-5-flash-lite",
1772
+ "gemini-2-5-pro",
1773
+ "gemini-2-5-pro-preview",
1774
+ "gemini-2-5-pro-preview-05-06",
1775
+ "gemini-3-1-flash-lite",
1776
+ "gemini-3-1-flash-lite-preview",
1777
+ "gemini-3-1-flash-live-preview",
1778
+ "gemini-3-1-pro-preview",
1779
+ "gemini-3-1-pro-preview-customtools",
1780
+ "gemini-3-5-flash",
1781
+ "gemini-3-5-flash-lite",
1782
+ "gemini-3-6-flash",
1783
+ "gemini-3-7-flash",
1784
+ "gemini-3-8-flash",
1785
+ "gemini-3-flash",
1786
+ "gemini-3-flash-preview",
1787
+ "gemini-3-pro-image",
1788
+ "gemini-3-pro-image-preview",
1789
+ "gemini-flash-latest",
1790
+ "gemini-flash-lite-latest",
1791
+ "gemini-pro-latest",
1792
+ "gpt-4-1",
1793
+ "gpt-4-1-mini",
1794
+ "gpt-4-1-nano",
1795
+ "gpt-4o",
1796
+ "gpt-4o-mini",
1797
+ "gpt-5",
1798
+ "gpt-5-1",
1799
+ "gpt-5-1-codex",
1800
+ "gpt-5-1-codex-max",
1801
+ "gpt-5-1-codex-mini",
1802
+ "gpt-5-2",
1803
+ "gpt-5-2-chat",
1804
+ "gpt-5-2-chat-latest",
1805
+ "gpt-5-2-codex",
1806
+ "gpt-5-2-pro",
1807
+ "gpt-5-3-chat-latest",
1808
+ "gpt-5-3-codex",
1809
+ "gpt-5-3-codex-spark",
1810
+ "gpt-5-4",
1811
+ "gpt-5-4-mini",
1812
+ "gpt-5-4-nano",
1813
+ "gpt-5-4-pro",
1814
+ "gpt-5-5",
1815
+ "gpt-5-5-pro",
1816
+ "gpt-5-6",
1817
+ "gpt-5-6-luna",
1818
+ "gpt-5-6-luna-pro",
1819
+ "gpt-5-6-sol",
1820
+ "gpt-5-6-sol-pro",
1821
+ "gpt-5-6-terra",
1822
+ "gpt-5-6-terra-pro",
1823
+ "gpt-5-chat",
1824
+ "gpt-5-codex",
1825
+ "gpt-5-mini",
1826
+ "gpt-5-nano",
1827
+ "gpt-5-pro",
1828
+ "o3",
1829
+ "o3-mini",
1830
+ "o3-pro",
1831
+ "o4-mini"
1832
+ ],
1833
+ "url-context": [
1834
+ "claude-haiku-4-5",
1835
+ "claude-opus-4",
1836
+ "claude-opus-4-1",
1837
+ "claude-opus-4-5",
1838
+ "claude-opus-4-6",
1839
+ "claude-opus-4-6-v1",
1840
+ "claude-opus-4-7",
1841
+ "claude-opus-4-8",
1842
+ "claude-opus-4-8-fast",
1843
+ "claude-sonnet-4",
1844
+ "claude-sonnet-4-5",
1845
+ "claude-sonnet-4-6",
1846
+ "gemini-2-5-computer-use-preview-10-2025",
1847
+ "gemini-2-5-flash",
1848
+ "gemini-2-5-flash-image",
1849
+ "gemini-2-5-flash-image-preview",
1850
+ "gemini-2-5-flash-lite",
1851
+ "gemini-2-5-pro",
1852
+ "gemini-2-5-pro-preview",
1853
+ "gemini-2-5-pro-preview-05-06",
1854
+ "gemini-3-1-flash-image",
1855
+ "gemini-3-1-flash-image-preview",
1856
+ "gemini-3-1-flash-lite",
1857
+ "gemini-3-1-flash-lite-image",
1858
+ "gemini-3-1-flash-lite-preview",
1859
+ "gemini-3-1-flash-live-preview",
1860
+ "gemini-3-1-pro-preview",
1861
+ "gemini-3-1-pro-preview-customtools",
1862
+ "gemini-3-5-flash",
1863
+ "gemini-3-5-flash-lite",
1864
+ "gemini-3-6-flash",
1865
+ "gemini-3-7-flash",
1866
+ "gemini-3-8-flash",
1867
+ "gemini-3-flash",
1868
+ "gemini-3-flash-preview",
1869
+ "gemini-3-pro-image",
1870
+ "gemini-3-pro-image-preview",
1871
+ "gemini-flash-latest",
1872
+ "gemini-flash-lite-latest",
1873
+ "gemini-pro-latest"
1874
+ ]
1875
+ },
1876
+ anthropic: {
1877
+ "web-search": [
1878
+ "claude-haiku-4-5",
1879
+ "claude-haiku-5-5",
1880
+ "claude-opus-4",
1881
+ "claude-opus-4-1",
1882
+ "claude-opus-4-5",
1883
+ "claude-opus-4-6",
1884
+ "claude-opus-4-6-v1",
1885
+ "claude-opus-4-7",
1886
+ "claude-opus-4-8",
1887
+ "claude-opus-4-8-fast",
1888
+ "claude-opus-5-5",
1889
+ "claude-sonnet-4",
1890
+ "claude-sonnet-4-5",
1891
+ "claude-sonnet-4-6",
1892
+ "claude-sonnet-5-5"
1893
+ ],
1894
+ "url-context": [
1895
+ "claude-haiku-4-5",
1896
+ "claude-haiku-5-5",
1897
+ "claude-opus-4",
1898
+ "claude-opus-4-1",
1899
+ "claude-opus-4-5",
1900
+ "claude-opus-4-6",
1901
+ "claude-opus-4-6-v1",
1902
+ "claude-opus-4-7",
1903
+ "claude-opus-4-8",
1904
+ "claude-opus-4-8-fast",
1905
+ "claude-opus-5-5",
1906
+ "claude-sonnet-4",
1907
+ "claude-sonnet-4-5",
1908
+ "claude-sonnet-4-6",
1909
+ "claude-sonnet-5-5"
1910
+ ]
1911
+ },
1912
+ "claude-code": { "url-context": [
1913
+ "claude-haiku-4-5",
1914
+ "claude-haiku-5-5",
1915
+ "claude-opus-4",
1916
+ "claude-opus-4-1",
1917
+ "claude-opus-4-5",
1918
+ "claude-opus-4-6",
1919
+ "claude-opus-4-6-v1",
1920
+ "claude-opus-4-7",
1921
+ "claude-opus-4-8",
1922
+ "claude-opus-4-8-fast",
1923
+ "claude-sonnet-4",
1924
+ "claude-sonnet-4-5",
1925
+ "claude-sonnet-4-6",
1926
+ "claude-sonnet-5-5"
1927
+ ] },
1928
+ openai: { "web-search": [
1929
+ "gpt-4-1",
1930
+ "gpt-4-1-mini",
1931
+ "gpt-4-1-nano",
1932
+ "gpt-4o",
1933
+ "gpt-4o-mini",
1934
+ "gpt-5",
1935
+ "gpt-5-1",
1936
+ "gpt-5-1-codex",
1937
+ "gpt-5-1-codex-max",
1938
+ "gpt-5-1-codex-mini",
1939
+ "gpt-5-2",
1940
+ "gpt-5-2-chat",
1941
+ "gpt-5-2-chat-latest",
1942
+ "gpt-5-2-codex",
1943
+ "gpt-5-2-pro",
1944
+ "gpt-5-3-chat-latest",
1945
+ "gpt-5-3-codex",
1946
+ "gpt-5-3-codex-spark",
1947
+ "gpt-5-4",
1948
+ "gpt-5-4-mini",
1949
+ "gpt-5-4-nano",
1950
+ "gpt-5-4-pro",
1951
+ "gpt-5-5",
1952
+ "gpt-5-5-pro",
1953
+ "gpt-5-6",
1954
+ "gpt-5-6-luna",
1955
+ "gpt-5-6-luna-pro",
1956
+ "gpt-5-6-sol",
1957
+ "gpt-5-6-sol-pro",
1958
+ "gpt-5-6-terra",
1959
+ "gpt-5-6-terra-pro",
1960
+ "gpt-5-chat",
1961
+ "gpt-5-codex",
1962
+ "gpt-5-mini",
1963
+ "gpt-5-nano",
1964
+ "gpt-5-pro",
1965
+ "gpt-6-1-sol",
1966
+ "gpt-6-astra",
1967
+ "gpt-6-luna",
1968
+ "gpt-6-sol",
1969
+ "o3",
1970
+ "o3-mini",
1971
+ "o3-pro",
1972
+ "o4-mini"
1973
+ ] },
1974
+ "azure-openai": {
1975
+ "web-search": [
1976
+ "claude-haiku-4-5",
1977
+ "claude-opus-4",
1978
+ "claude-opus-4-1",
1979
+ "claude-opus-4-5",
1980
+ "claude-opus-4-6",
1981
+ "claude-opus-4-6-v1",
1982
+ "claude-opus-4-7",
1983
+ "claude-opus-4-8",
1984
+ "claude-opus-4-8-fast",
1985
+ "claude-sonnet-4",
1986
+ "claude-sonnet-4-5",
1987
+ "claude-sonnet-4-6",
1988
+ "gpt-4-1",
1989
+ "gpt-4-1-mini",
1990
+ "gpt-4-1-nano",
1991
+ "gpt-4o",
1992
+ "gpt-4o-mini",
1993
+ "gpt-5",
1994
+ "gpt-5-1",
1995
+ "gpt-5-1-codex",
1996
+ "gpt-5-1-codex-max",
1997
+ "gpt-5-1-codex-mini",
1998
+ "gpt-5-2",
1999
+ "gpt-5-2-chat",
2000
+ "gpt-5-2-chat-latest",
2001
+ "gpt-5-2-codex",
2002
+ "gpt-5-2-pro",
2003
+ "gpt-5-3-chat-latest",
2004
+ "gpt-5-3-codex",
2005
+ "gpt-5-3-codex-spark",
2006
+ "gpt-5-4",
2007
+ "gpt-5-4-mini",
2008
+ "gpt-5-4-nano",
2009
+ "gpt-5-4-pro",
2010
+ "gpt-5-5",
2011
+ "gpt-5-5-pro",
2012
+ "gpt-5-6",
2013
+ "gpt-5-6-luna",
2014
+ "gpt-5-6-luna-pro",
2015
+ "gpt-5-6-sol",
2016
+ "gpt-5-6-sol-pro",
2017
+ "gpt-5-6-terra",
2018
+ "gpt-5-6-terra-pro",
2019
+ "gpt-5-chat",
2020
+ "gpt-5-codex",
2021
+ "gpt-5-mini",
2022
+ "gpt-5-nano",
2023
+ "gpt-5-pro",
2024
+ "o3",
2025
+ "o3-mini",
2026
+ "o3-pro",
2027
+ "o4-mini"
2028
+ ],
2029
+ "url-context": [
2030
+ "claude-haiku-4-5",
2031
+ "claude-opus-4",
2032
+ "claude-opus-4-1",
2033
+ "claude-opus-4-5",
2034
+ "claude-opus-4-6",
2035
+ "claude-opus-4-6-v1",
2036
+ "claude-opus-4-7",
2037
+ "claude-opus-4-8",
2038
+ "claude-opus-4-8-fast",
2039
+ "claude-sonnet-4",
2040
+ "claude-sonnet-4-5",
2041
+ "claude-sonnet-4-6"
2042
+ ]
2043
+ },
2044
+ gemini: {
2045
+ "web-search": [
2046
+ "gemini-2-5-computer-use-preview-10-2025",
2047
+ "gemini-2-5-flash",
2048
+ "gemini-2-5-flash-lite",
2049
+ "gemini-2-5-pro",
2050
+ "gemini-2-5-pro-preview",
2051
+ "gemini-2-5-pro-preview-05-06",
2052
+ "gemini-3-1-flash-lite",
2053
+ "gemini-3-1-flash-lite-preview",
2054
+ "gemini-3-1-flash-live-preview",
2055
+ "gemini-3-1-pro-preview",
2056
+ "gemini-3-1-pro-preview-customtools",
2057
+ "gemini-3-5-flash",
2058
+ "gemini-3-5-flash-lite",
2059
+ "gemini-3-6-flash",
2060
+ "gemini-3-7-flash",
2061
+ "gemini-3-8-flash",
2062
+ "gemini-3-flash",
2063
+ "gemini-3-flash-preview",
2064
+ "gemini-3-pro-image",
2065
+ "gemini-3-pro-image-preview",
2066
+ "gemini-flash-latest",
2067
+ "gemini-flash-lite-latest",
2068
+ "gemini-pro-latest"
2069
+ ],
2070
+ "url-context": [
2071
+ "gemini-2-5-computer-use-preview-10-2025",
2072
+ "gemini-2-5-flash",
2073
+ "gemini-2-5-flash-image",
2074
+ "gemini-2-5-flash-image-preview",
2075
+ "gemini-2-5-flash-lite",
2076
+ "gemini-2-5-pro",
2077
+ "gemini-2-5-pro-preview",
2078
+ "gemini-2-5-pro-preview-05-06",
2079
+ "gemini-3-1-flash-image",
2080
+ "gemini-3-1-flash-image-preview",
2081
+ "gemini-3-1-flash-lite",
2082
+ "gemini-3-1-flash-lite-image",
2083
+ "gemini-3-1-flash-lite-preview",
2084
+ "gemini-3-1-flash-live-preview",
2085
+ "gemini-3-1-pro-preview",
2086
+ "gemini-3-1-pro-preview-customtools",
2087
+ "gemini-3-5-flash",
2088
+ "gemini-3-5-flash-lite",
2089
+ "gemini-3-6-flash",
2090
+ "gemini-3-7-flash",
2091
+ "gemini-3-8-flash",
2092
+ "gemini-3-flash",
2093
+ "gemini-3-flash-preview",
2094
+ "gemini-3-pro-image",
2095
+ "gemini-3-pro-image-preview",
2096
+ "gemini-flash-latest",
2097
+ "gemini-flash-lite-latest",
2098
+ "gemini-pro-latest"
2099
+ ]
2100
+ },
2101
+ vertexai: {
2102
+ "web-search": [
2103
+ "claude-haiku-4-5",
2104
+ "claude-opus-4",
2105
+ "claude-opus-4-1",
2106
+ "claude-opus-4-5",
2107
+ "claude-opus-4-6",
2108
+ "claude-opus-4-6-v1",
2109
+ "claude-opus-4-7",
2110
+ "claude-opus-4-8",
2111
+ "claude-opus-4-8-fast",
2112
+ "claude-sonnet-4",
2113
+ "claude-sonnet-4-5",
2114
+ "claude-sonnet-4-6",
2115
+ "gemini-2-5-computer-use-preview-10-2025",
2116
+ "gemini-2-5-flash",
2117
+ "gemini-2-5-flash-lite",
2118
+ "gemini-2-5-pro",
2119
+ "gemini-2-5-pro-preview",
2120
+ "gemini-2-5-pro-preview-05-06",
2121
+ "gemini-3-1-flash-lite",
2122
+ "gemini-3-1-flash-lite-preview",
2123
+ "gemini-3-1-flash-live-preview",
2124
+ "gemini-3-1-pro-preview",
2125
+ "gemini-3-1-pro-preview-customtools",
2126
+ "gemini-3-5-flash",
2127
+ "gemini-3-5-flash-lite",
2128
+ "gemini-3-6-flash",
2129
+ "gemini-3-7-flash",
2130
+ "gemini-3-8-flash",
2131
+ "gemini-3-flash",
2132
+ "gemini-3-flash-preview",
2133
+ "gemini-3-pro-image",
2134
+ "gemini-3-pro-image-preview",
2135
+ "gemini-flash-latest",
2136
+ "gemini-flash-lite-latest",
2137
+ "gemini-pro-latest"
2138
+ ],
2139
+ "url-context": [
2140
+ "gemini-2-5-computer-use-preview-10-2025",
2141
+ "gemini-2-5-flash",
2142
+ "gemini-2-5-flash-image",
2143
+ "gemini-2-5-flash-image-preview",
2144
+ "gemini-2-5-flash-lite",
2145
+ "gemini-2-5-pro",
2146
+ "gemini-2-5-pro-preview",
2147
+ "gemini-2-5-pro-preview-05-06",
2148
+ "gemini-3-1-flash-image",
2149
+ "gemini-3-1-flash-image-preview",
2150
+ "gemini-3-1-flash-lite",
2151
+ "gemini-3-1-flash-lite-image",
2152
+ "gemini-3-1-flash-lite-preview",
2153
+ "gemini-3-1-flash-live-preview",
2154
+ "gemini-3-1-pro-preview",
2155
+ "gemini-3-1-pro-preview-customtools",
2156
+ "gemini-3-5-flash",
2157
+ "gemini-3-5-flash-lite",
2158
+ "gemini-3-6-flash",
2159
+ "gemini-3-7-flash",
2160
+ "gemini-3-8-flash",
2161
+ "gemini-3-flash",
2162
+ "gemini-3-flash-preview",
2163
+ "gemini-3-pro-image",
2164
+ "gemini-3-pro-image-preview",
2165
+ "gemini-flash-latest",
2166
+ "gemini-flash-lite-latest",
2167
+ "gemini-pro-latest"
2168
+ ]
2169
+ },
2170
+ moonshot: { "web-search": [
2171
+ "kimi-k2",
2172
+ "kimi-k2-5",
2173
+ "kimi-k2-6",
2174
+ "kimi-k2-7-code",
2175
+ "kimi-k2-7-code-highspeed",
2176
+ "kimi-k2-instruct",
2177
+ "kimi-k2-thinking-maas",
2178
+ "kimi-k3",
2179
+ "kimi-k3-fast",
2180
+ "kimi-latest"
2181
+ ] },
2182
+ "moonshot-global": { "web-search": [
2183
+ "kimi-k2",
2184
+ "kimi-k2-5",
2185
+ "kimi-k2-6",
2186
+ "kimi-k2-7-code",
2187
+ "kimi-k2-7-code-highspeed",
2188
+ "kimi-k2-instruct",
2189
+ "kimi-k2-thinking-maas",
2190
+ "kimi-k3",
2191
+ "kimi-k3-fast",
2192
+ "kimi-latest"
2193
+ ] },
2194
+ dashscope: {
2195
+ "web-search": [
2196
+ "deepseek-r1",
2197
+ "deepseek-r1-distill-llama-70b",
2198
+ "deepseek-r1-distill-llama-8b",
2199
+ "deepseek-r1-distill-qwen-1-5b",
2200
+ "deepseek-r1-distill-qwen-14b",
2201
+ "deepseek-r1-distill-qwen-32b",
2202
+ "deepseek-r1-distill-qwen-7b",
2203
+ "deepseek-v3",
2204
+ "deepseek-v3-1",
2205
+ "deepseek-v3-1-maas",
2206
+ "deepseek-v3-1-terminus",
2207
+ "deepseek-v3-2",
2208
+ "deepseek-v3-2-exp",
2209
+ "deepseek-v3-2-maas",
2210
+ "deepseek-v4-flash",
2211
+ "deepseek-v4-flash-vision-exp",
2212
+ "deepseek-v4-pro",
2213
+ "glm-4",
2214
+ "glm-4-1v",
2215
+ "glm-4-5",
2216
+ "glm-4-5-air",
2217
+ "glm-4-5-flash",
2218
+ "glm-4-5v",
2219
+ "glm-4-6",
2220
+ "glm-4-6v",
2221
+ "glm-4-7",
2222
+ "glm-4-7-flash",
2223
+ "glm-4-7-flashx",
2224
+ "glm-4-7-maas",
2225
+ "glm-4-air",
2226
+ "glm-4-airx",
2227
+ "glm-4-flash",
2228
+ "glm-4-flashx",
2229
+ "glm-4-long",
2230
+ "glm-4-plus",
2231
+ "glm-5",
2232
+ "glm-5-1",
2233
+ "glm-5-2",
2234
+ "glm-5-2-fast",
2235
+ "glm-5-3",
2236
+ "glm-5-3-fast",
2237
+ "glm-5-3-flash",
2238
+ "glm-5-maas",
2239
+ "glm-5-turbo",
2240
+ "kimi-k2",
2241
+ "kimi-k2-5",
2242
+ "kimi-k2-6",
2243
+ "kimi-k2-7-code",
2244
+ "kimi-k2-7-code-highspeed",
2245
+ "kimi-k2-instruct",
2246
+ "kimi-k2-thinking-maas",
2247
+ "kimi-k3",
2248
+ "kimi-k3-fast",
2249
+ "kimi-latest",
2250
+ "minimax-m2-1",
2251
+ "qwen-flash",
2252
+ "qwen-plus",
2253
+ "qwen-plus-character",
2254
+ "qwen-plus-character-ja",
2255
+ "qwen-turbo",
2256
+ "qwen3-5-flash",
2257
+ "qwen3-5-flash-02-23",
2258
+ "qwen3-5-plus",
2259
+ "qwen3-5-plus-02-15",
2260
+ "qwen3-6-flash",
2261
+ "qwen3-6-max-preview",
2262
+ "qwen3-6-plus",
2263
+ "qwen3-7-max",
2264
+ "qwen3-7-plus",
2265
+ "qwen3-8-flash",
2266
+ "qwen3-8-flash-next",
2267
+ "qwen3-8-max",
2268
+ "qwen3-8-max-preview",
2269
+ "qwen3-max",
2270
+ "qwen3-max-preview",
2271
+ "qwq-plus"
2272
+ ],
2273
+ "url-context": [
2274
+ "qwen-flash",
2275
+ "qwen-plus",
2276
+ "qwen-plus-character",
2277
+ "qwen-plus-character-ja",
2278
+ "qwen3-5-flash",
2279
+ "qwen3-5-flash-02-23",
2280
+ "qwen3-5-plus",
2281
+ "qwen3-5-plus-02-15",
2282
+ "qwen3-6-flash",
2283
+ "qwen3-6-max-preview",
2284
+ "qwen3-6-plus",
2285
+ "qwen3-7-max",
2286
+ "qwen3-7-plus",
2287
+ "qwen3-8-flash",
2288
+ "qwen3-8-flash-next",
2289
+ "qwen3-8-max",
2290
+ "qwen3-8-max-preview",
2291
+ "qwen3-max",
2292
+ "qwen3-max-preview"
2293
+ ]
2294
+ },
2295
+ doubao: { "web-search": [
2296
+ "doubao-seed-1-6",
2297
+ "doubao-seed-1-8",
2298
+ "doubao-seed-2-0-code-preview",
2299
+ "doubao-seed-2-0-lite",
2300
+ "doubao-seed-2-0-mini",
2301
+ "doubao-seed-2-0-pro",
2302
+ "doubao-seed-2-1-pro",
2303
+ "doubao-seed-2-1-turbo",
2304
+ "doubao-seed-character",
2305
+ "doubao-seed-evolving"
2306
+ ] },
2307
+ grok: { "web-search": [
2308
+ "grok-4",
2309
+ "grok-4-1",
2310
+ "grok-4-1-fast",
2311
+ "grok-4-1-fast-non-reasoning",
2312
+ "grok-4-20",
2313
+ "grok-4-20-0309-non-reasoning",
2314
+ "grok-4-20-multi-agent",
2315
+ "grok-4-20-multi-agent-beta",
2316
+ "grok-4-20-non-reasoning",
2317
+ "grok-4-20-non-reasoning-beta",
2318
+ "grok-4-20-reasoning-beta",
2319
+ "grok-4-3",
2320
+ "grok-4-5",
2321
+ "grok-4-6",
2322
+ "grok-4-7",
2323
+ "grok-4-fast"
2324
+ ] },
2325
+ perplexity: { "web-search": [
2326
+ "sonar",
2327
+ "sonar-deep-research",
2328
+ "sonar-pro",
2329
+ "sonar-reasoning-pro"
2330
+ ] },
2331
+ "aws-bedrock": {
2332
+ "web-search": [
2333
+ "claude-haiku-4-5",
2334
+ "claude-opus-4",
2335
+ "claude-opus-4-1",
2336
+ "claude-opus-4-5",
2337
+ "claude-opus-4-6",
2338
+ "claude-opus-4-6-v1",
2339
+ "claude-opus-4-7",
2340
+ "claude-opus-4-8",
2341
+ "claude-opus-4-8-fast",
2342
+ "claude-sonnet-4",
2343
+ "claude-sonnet-4-5",
2344
+ "claude-sonnet-4-6"
2345
+ ],
2346
+ "url-context": [
2347
+ "claude-haiku-4-5",
2348
+ "claude-opus-4",
2349
+ "claude-opus-4-1",
2350
+ "claude-opus-4-5",
2351
+ "claude-opus-4-6",
2352
+ "claude-opus-4-6-v1",
2353
+ "claude-opus-4-7",
2354
+ "claude-opus-4-8",
2355
+ "claude-opus-4-8-fast",
2356
+ "claude-sonnet-4",
2357
+ "claude-sonnet-4-5",
2358
+ "claude-sonnet-4-6"
2359
+ ]
2360
+ },
2361
+ poe: { "web-search": [
2362
+ "claude-haiku-4-5",
2363
+ "claude-opus-4",
2364
+ "claude-opus-4-1",
2365
+ "claude-opus-4-5",
2366
+ "claude-opus-4-6",
2367
+ "claude-opus-4-6-v1",
2368
+ "claude-opus-4-7",
2369
+ "claude-opus-4-8",
2370
+ "claude-opus-4-8-fast",
2371
+ "claude-sonnet-4",
2372
+ "claude-sonnet-4-5",
2373
+ "claude-sonnet-4-6",
2374
+ "deepseek-r1",
2375
+ "deepseek-r1-distill-llama-70b",
2376
+ "deepseek-r1-distill-llama-8b",
2377
+ "deepseek-r1-distill-qwen-1-5b",
2378
+ "deepseek-r1-distill-qwen-14b",
2379
+ "deepseek-r1-distill-qwen-32b",
2380
+ "deepseek-r1-distill-qwen-7b",
2381
+ "deepseek-v3",
2382
+ "deepseek-v3-1",
2383
+ "deepseek-v3-1-maas",
2384
+ "deepseek-v3-1-terminus",
2385
+ "deepseek-v3-2",
2386
+ "deepseek-v3-2-exp",
2387
+ "deepseek-v3-2-maas",
2388
+ "deepseek-v4-flash",
2389
+ "deepseek-v4-flash-vision-exp",
2390
+ "deepseek-v4-pro",
2391
+ "doubao-seed-1-6",
2392
+ "doubao-seed-1-8",
2393
+ "doubao-seed-2-0-code-preview",
2394
+ "doubao-seed-2-0-lite",
2395
+ "doubao-seed-2-0-mini",
2396
+ "doubao-seed-2-0-pro",
2397
+ "doubao-seed-2-1-pro",
2398
+ "doubao-seed-2-1-turbo",
2399
+ "doubao-seed-character",
2400
+ "doubao-seed-evolving",
2401
+ "gemini-2-5-computer-use-preview-10-2025",
2402
+ "gemini-2-5-flash",
2403
+ "gemini-2-5-flash-lite",
2404
+ "gemini-2-5-pro",
2405
+ "gemini-2-5-pro-preview",
2406
+ "gemini-2-5-pro-preview-05-06",
2407
+ "gemini-3-1-flash-lite",
2408
+ "gemini-3-1-flash-lite-preview",
2409
+ "gemini-3-1-flash-live-preview",
2410
+ "gemini-3-1-pro-preview",
2411
+ "gemini-3-1-pro-preview-customtools",
2412
+ "gemini-3-5-flash",
2413
+ "gemini-3-5-flash-lite",
2414
+ "gemini-3-6-flash",
2415
+ "gemini-3-7-flash",
2416
+ "gemini-3-8-flash",
2417
+ "gemini-3-flash",
2418
+ "gemini-3-flash-preview",
2419
+ "gemini-3-pro-image",
2420
+ "gemini-3-pro-image-preview",
2421
+ "gemini-flash-latest",
2422
+ "gemini-flash-lite-latest",
2423
+ "gemini-pro-latest",
2424
+ "glm-4",
2425
+ "glm-4-1v",
2426
+ "glm-4-5",
2427
+ "glm-4-5-air",
2428
+ "glm-4-5-flash",
2429
+ "glm-4-5v",
2430
+ "glm-4-6",
2431
+ "glm-4-6v",
2432
+ "glm-4-7",
2433
+ "glm-4-7-flash",
2434
+ "glm-4-7-flashx",
2435
+ "glm-4-7-maas",
2436
+ "glm-4-air",
2437
+ "glm-4-airx",
2438
+ "glm-4-flash",
2439
+ "glm-4-flashx",
2440
+ "glm-4-long",
2441
+ "glm-4-plus",
2442
+ "glm-5",
2443
+ "glm-5-1",
2444
+ "glm-5-2",
2445
+ "glm-5-2-fast",
2446
+ "glm-5-3",
2447
+ "glm-5-3-fast",
2448
+ "glm-5-3-flash",
2449
+ "glm-5-maas",
2450
+ "glm-5-turbo",
2451
+ "gpt-4-1",
2452
+ "gpt-4-1-mini",
2453
+ "gpt-4-1-nano",
2454
+ "gpt-4o",
2455
+ "gpt-4o-mini",
2456
+ "gpt-5",
2457
+ "gpt-5-1",
2458
+ "gpt-5-1-codex",
2459
+ "gpt-5-1-codex-max",
2460
+ "gpt-5-1-codex-mini",
2461
+ "gpt-5-2",
2462
+ "gpt-5-2-chat",
2463
+ "gpt-5-2-chat-latest",
2464
+ "gpt-5-2-codex",
2465
+ "gpt-5-2-pro",
2466
+ "gpt-5-3-chat-latest",
2467
+ "gpt-5-3-codex",
2468
+ "gpt-5-3-codex-spark",
2469
+ "gpt-5-4",
2470
+ "gpt-5-4-mini",
2471
+ "gpt-5-4-nano",
2472
+ "gpt-5-4-pro",
2473
+ "gpt-5-5",
2474
+ "gpt-5-5-pro",
2475
+ "gpt-5-6",
2476
+ "gpt-5-6-luna",
2477
+ "gpt-5-6-luna-pro",
2478
+ "gpt-5-6-sol",
2479
+ "gpt-5-6-sol-pro",
2480
+ "gpt-5-6-terra",
2481
+ "gpt-5-6-terra-pro",
2482
+ "gpt-5-chat",
2483
+ "gpt-5-codex",
2484
+ "gpt-5-mini",
2485
+ "gpt-5-nano",
2486
+ "gpt-5-pro",
2487
+ "grok-4",
2488
+ "grok-4-1",
2489
+ "grok-4-1-fast",
2490
+ "grok-4-1-fast-non-reasoning",
2491
+ "grok-4-20",
2492
+ "grok-4-20-0309-non-reasoning",
2493
+ "grok-4-20-multi-agent",
2494
+ "grok-4-20-multi-agent-beta",
2495
+ "grok-4-20-non-reasoning",
2496
+ "grok-4-20-non-reasoning-beta",
2497
+ "grok-4-20-reasoning-beta",
2498
+ "grok-4-3",
2499
+ "grok-4-5",
2500
+ "grok-4-6",
2501
+ "grok-4-fast",
2502
+ "kimi-k2",
2503
+ "kimi-k2-5",
2504
+ "kimi-k2-6",
2505
+ "kimi-k2-7-code",
2506
+ "kimi-k2-7-code-highspeed",
2507
+ "kimi-k2-instruct",
2508
+ "kimi-k2-thinking-maas",
2509
+ "kimi-k3",
2510
+ "kimi-k3-fast",
2511
+ "kimi-latest",
2512
+ "minimax-m2-1",
2513
+ "o3",
2514
+ "o3-mini",
2515
+ "o3-pro",
2516
+ "o4-mini",
2517
+ "qwen-flash",
2518
+ "qwen-plus",
2519
+ "qwen-plus-character",
2520
+ "qwen-plus-character-ja",
2521
+ "qwen-turbo",
2522
+ "qwen3-5-flash",
2523
+ "qwen3-5-flash-02-23",
2524
+ "qwen3-5-plus",
2525
+ "qwen3-5-plus-02-15",
2526
+ "qwen3-6-flash",
2527
+ "qwen3-6-max-preview",
2528
+ "qwen3-6-plus",
2529
+ "qwen3-7-max",
2530
+ "qwen3-7-plus",
2531
+ "qwen3-8-max",
2532
+ "qwen3-8-max-preview",
2533
+ "qwen3-max",
2534
+ "qwen3-max-preview",
2535
+ "qwq-plus",
2536
+ "sonar",
2537
+ "sonar-deep-research",
2538
+ "sonar-pro",
2539
+ "sonar-reasoning-pro"
2540
+ ] }
2541
+ }).map(([providerId, tools]) => [providerId, new Map(Object.entries(tools).map(([tool, ids]) => [tool, new Set(ids)]))]));
2542
+ function isServerToolModelEligible(rawModelId, providerId, tool) {
2543
+ const ids = ELIGIBLE_MODEL_IDS.get(providerId)?.get(tool);
2544
+ if (!ids) return false;
2545
+ const exact = normalizeModelId(rawModelId, { keepParameterSize: true });
2546
+ return ids.has(exact) || ids.has(normalizeModelId(rawModelId));
2547
+ }
2548
+ //#endregion
2549
+ export { CANONICAL_PARAM_KEY, CURRENCY, CatalogManifestSchema, ENDPOINT_TYPE, FastModeTransportSchema, IMAGE_PARAM_CATALOG, IMAGE_PARAM_CATALOG_KEYS, ImageGenerationModeSchema, ImageGenerationSupportSchema, MODALITY, MODEL_CAPABILITY, ModelConfigSchema, ModelListSchema, ProviderConfigSchema, ProviderEditionSchema, ProviderListSchema, ProviderModelListSchema, ProviderModelOverrideSchema, ProviderModelReasoningContractSchema, REASONING_EFFORT, REASONING_EFFORT_ORDER, REASONING_FORMAT_PROFILES, REASONING_FORMAT_TYPES, REASONING_WIRE_TARGETS, REGISTRY_FILES, REGISTRY_MIN_APP_VERSION, REGISTRY_SCHEMA_VERSION, REMOTE_REGISTRY_FILES, ReasoningControlSchema, ReasoningFormatWireProfileSchema, ReasoningWireProfileSchema, SERVER_TOOL, SERVER_TOOL_MODEL_SCOPE, ServerToolConfigSchema, ServiceTierDeliverySchema, ServiceTierOptionsSchema, ServiceTierRequestControlSchema, ServiceTierSelectionSchema, VENDOR_PATTERNS, buildParamsSchema, buildPersistedEndpointConfigs, configureOpenAIResponsesSummary, createRegistry, deriveLegacyReasoningFields, endpointImpliedCapability, imageParamsSchema, inferAdapterFamily, inferReasoningControls, inferReasoningMembership, inferReasoningOwnedBy, isServerToolModelEligible, isVendor, isWebSearchEffortUnsupported, lookupRegistryModel, lookupRegistryProvider, matchVendor, normalizeImageParamNumber, normalizeModelId, objectValues, openaiResponsesSummaryWire, paramCatalogEntry, parseImageParamValue, parseModelSnapshot, selectFormatWire, stripBedrockDottedVendorPrefix, stripBedrockRevision, stripDateSnapshot, stripVariantQuantDateSuffixes, supportsServerToolFunctionMixing, wireName };