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