@rigelbuild/omp-catalog 18.0.3

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 (117) hide show
  1. package/CHANGELOG.md +1204 -0
  2. package/LICENSE +22 -0
  3. package/README.md +43 -0
  4. package/THIRD-PARTY-NOTICES.txt +22909 -0
  5. package/dist/types/build.d.ts +19 -0
  6. package/dist/types/compat/anthropic.d.ts +18 -0
  7. package/dist/types/compat/apply.d.ts +7 -0
  8. package/dist/types/compat/bedrock.d.ts +3 -0
  9. package/dist/types/compat/devin.d.ts +9 -0
  10. package/dist/types/compat/openai.d.ts +28 -0
  11. package/dist/types/discovery/antigravity.d.ts +70 -0
  12. package/dist/types/discovery/codex.d.ts +36 -0
  13. package/dist/types/discovery/cursor-proto.d.ts +5368 -0
  14. package/dist/types/discovery/cursor.d.ts +23 -0
  15. package/dist/types/discovery/devin-proto.d.ts +1549 -0
  16. package/dist/types/discovery/devin.d.ts +24 -0
  17. package/dist/types/discovery/gemini-cli.d.ts +33 -0
  18. package/dist/types/discovery/gemini.d.ts +25 -0
  19. package/dist/types/discovery/gitlab-duo-workflow.d.ts +30 -0
  20. package/dist/types/discovery/index.d.ts +7 -0
  21. package/dist/types/discovery/openai-compatible.d.ts +89 -0
  22. package/dist/types/discovery/protobuf.d.ts +102 -0
  23. package/dist/types/effort.d.ts +10 -0
  24. package/dist/types/fireworks-model-id.d.ts +23 -0
  25. package/dist/types/hosts.d.ts +169 -0
  26. package/dist/types/identity/bundled.d.ts +3 -0
  27. package/dist/types/identity/classify.d.ts +69 -0
  28. package/dist/types/identity/dialect.d.ts +3 -0
  29. package/dist/types/identity/family.d.ts +239 -0
  30. package/dist/types/identity/id.d.ts +12 -0
  31. package/dist/types/identity/index.d.ts +8 -0
  32. package/dist/types/identity/markers.d.ts +4 -0
  33. package/dist/types/identity/priority.d.ts +1 -0
  34. package/dist/types/identity/reference.d.ts +29 -0
  35. package/dist/types/index.d.ts +19 -0
  36. package/dist/types/model-cache.d.ts +23 -0
  37. package/dist/types/model-manager.d.ts +77 -0
  38. package/dist/types/model-thinking.d.ts +70 -0
  39. package/dist/types/model-tokenizer.d.ts +8 -0
  40. package/dist/types/models.d.ts +14 -0
  41. package/dist/types/openai-pricing.d.ts +17 -0
  42. package/dist/types/provider-models/bundled-references.d.ts +13 -0
  43. package/dist/types/provider-models/cache-provider-id.d.ts +11 -0
  44. package/dist/types/provider-models/descriptor-types.d.ts +76 -0
  45. package/dist/types/provider-models/descriptors.d.ts +505 -0
  46. package/dist/types/provider-models/google.d.ts +29 -0
  47. package/dist/types/provider-models/index.d.ts +7 -0
  48. package/dist/types/provider-models/ollama.d.ts +22 -0
  49. package/dist/types/provider-models/openai-compat.d.ts +646 -0
  50. package/dist/types/provider-models/special.d.ts +53 -0
  51. package/dist/types/types.d.ts +876 -0
  52. package/dist/types/utils.d.ts +20 -0
  53. package/dist/types/variant-collapse.d.ts +137 -0
  54. package/dist/types/wire/alibaba-token-plan.d.ts +22 -0
  55. package/dist/types/wire/codex.d.ts +66 -0
  56. package/dist/types/wire/coreweave.d.ts +12 -0
  57. package/dist/types/wire/gemini-headers.d.ts +62 -0
  58. package/dist/types/wire/github-copilot.d.ts +47 -0
  59. package/dist/types/wire/image-fetchers.d.ts +76 -0
  60. package/package.json +102 -0
  61. package/src/build.ts +103 -0
  62. package/src/compat/anthropic.ts +179 -0
  63. package/src/compat/apply.ts +15 -0
  64. package/src/compat/bedrock.ts +153 -0
  65. package/src/compat/devin.ts +12 -0
  66. package/src/compat/openai.ts +864 -0
  67. package/src/discovery/antigravity.ts +257 -0
  68. package/src/discovery/codex.ts +456 -0
  69. package/src/discovery/cursor-proto.ts +8329 -0
  70. package/src/discovery/cursor.ts +409 -0
  71. package/src/discovery/devin-proto.ts +2037 -0
  72. package/src/discovery/devin.ts +152 -0
  73. package/src/discovery/gemini-cli.ts +198 -0
  74. package/src/discovery/gemini.ts +260 -0
  75. package/src/discovery/gitlab-duo-workflow.ts +859 -0
  76. package/src/discovery/index.ts +7 -0
  77. package/src/discovery/openai-compatible.ts +266 -0
  78. package/src/discovery/protobuf.ts +1073 -0
  79. package/src/effort.ts +18 -0
  80. package/src/fireworks-model-id.ts +50 -0
  81. package/src/hosts.ts +178 -0
  82. package/src/identity/bundled.ts +28 -0
  83. package/src/identity/classify.ts +242 -0
  84. package/src/identity/dialect.ts +42 -0
  85. package/src/identity/family.ts +477 -0
  86. package/src/identity/id.ts +81 -0
  87. package/src/identity/index.ts +8 -0
  88. package/src/identity/markers.ts +49 -0
  89. package/src/identity/priority.ts +59 -0
  90. package/src/identity/reference.ts +167 -0
  91. package/src/index.ts +19 -0
  92. package/src/model-cache.ts +346 -0
  93. package/src/model-manager.ts +683 -0
  94. package/src/model-thinking.ts +925 -0
  95. package/src/model-tokenizer.ts +75 -0
  96. package/src/models.json +304657 -0
  97. package/src/models.json.d.ts +9 -0
  98. package/src/models.ts +108 -0
  99. package/src/openai-pricing.ts +29 -0
  100. package/src/provider-models/bundled-references.ts +87 -0
  101. package/src/provider-models/cache-provider-id.ts +97 -0
  102. package/src/provider-models/descriptor-types.ts +85 -0
  103. package/src/provider-models/descriptors.ts +585 -0
  104. package/src/provider-models/google.ts +117 -0
  105. package/src/provider-models/index.ts +7 -0
  106. package/src/provider-models/ollama.ts +204 -0
  107. package/src/provider-models/openai-compat.ts +6405 -0
  108. package/src/provider-models/special.ts +213 -0
  109. package/src/types.ts +1032 -0
  110. package/src/utils.ts +69 -0
  111. package/src/variant-collapse.ts +1555 -0
  112. package/src/wire/alibaba-token-plan.ts +54 -0
  113. package/src/wire/codex.ts +117 -0
  114. package/src/wire/coreweave.ts +51 -0
  115. package/src/wire/gemini-headers.ts +135 -0
  116. package/src/wire/github-copilot.ts +147 -0
  117. package/src/wire/image-fetchers.ts +159 -0
@@ -0,0 +1,646 @@
1
+ import type { ModelManagerOptions } from "../model-manager.js";
2
+ import { getBundledModels } from "../models.js";
3
+ import type { Api, FetchImpl, ModelSpec, Provider } from "../types.js";
4
+ import { ALIBABA_TOKEN_PLAN_BASE_URL } from "../wire/alibaba-token-plan.js";
5
+ import type { ModelManagerConfig } from "./descriptor-types.js";
6
+ export interface ModelsDevModel {
7
+ id?: string;
8
+ name?: string;
9
+ tool_call?: boolean;
10
+ reasoning?: boolean;
11
+ limit?: {
12
+ context?: number;
13
+ output?: number;
14
+ };
15
+ cost?: {
16
+ input?: number;
17
+ output?: number;
18
+ cache_read?: number;
19
+ cache_write?: number;
20
+ };
21
+ modalities?: {
22
+ input?: string[];
23
+ };
24
+ status?: string;
25
+ provider?: {
26
+ npm?: string;
27
+ };
28
+ }
29
+ /**
30
+ * Fetches the models.dev catalog via catalog.stencil.so, which serves a
31
+ * field-pruned copy precompressed as a zstd blob (~93 KB vs ~3.3 MB raw).
32
+ * The frame magic is sniffed rather than trusting content-type so plain-JSON
33
+ * responses (test stubs, fallback mirrors) parse identically.
34
+ *
35
+ * Fetched fully once per process: concurrent callers share the in-flight
36
+ * request, repeat callers send a conditional GET that the server answers
37
+ * (and deliberately does not log) with `304`.
38
+ */
39
+ export declare function fetchWellKnownModels(fetchImpl?: FetchImpl, signal?: AbortSignal): Promise<unknown>;
40
+ /**
41
+ * Curated Anthropic models that are live or limited-availability on the
42
+ * first-party `/v1/models` endpoint but that models.dev has not catalogued yet.
43
+ * Seeded into model generation so the bundled catalog is never gated on
44
+ * models.dev's update cadence; deduped behind upstream catalog / models.dev
45
+ * entries once those appear. Token limits and pricing are pinned either directly or
46
+ * in `applyAnthropicCatalogPolicy`, and `thinking` is re-baked
47
+ * by the generator's policy pass (scripts/generated-policies.ts).
48
+ */
49
+ export declare const ANTHROPIC_CURATED_FALLBACK_MODELS: readonly ModelSpec<"anthropic-messages">[];
50
+ type SimpleProviderDiscoveryHeaders = Record<string, string> | (() => Record<string, string> | undefined);
51
+ type SimpleProviderConfig = {
52
+ apiKey?: string;
53
+ baseUrl?: string;
54
+ fetch?: FetchImpl;
55
+ headers?: SimpleProviderDiscoveryHeaders;
56
+ };
57
+ export declare function createSimpleOpenAICompletionsOptions(providerId: Parameters<typeof getBundledModels>[0], defaultBaseUrl: string, config?: SimpleProviderConfig): ModelManagerOptions<"openai-completions">;
58
+ export interface UmansModelManagerConfig {
59
+ apiKey?: string;
60
+ baseUrl?: string;
61
+ fetch?: FetchImpl;
62
+ }
63
+ export declare function umansModelManagerOptions(config?: UmansModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
64
+ /** GPT-5.6 rates applied when a first-party request exceeds 272K input tokens. */
65
+ export declare const OPENAI_GPT_56_LONG_CONTEXT_COSTS: {
66
+ readonly luna: {
67
+ readonly inputThreshold: 272000;
68
+ readonly input: 0.4;
69
+ readonly output: 1.8;
70
+ readonly cacheRead: 0.04;
71
+ readonly cacheWrite: 0.5;
72
+ };
73
+ readonly sol: {
74
+ readonly inputThreshold: 272000;
75
+ readonly input: 10;
76
+ readonly output: 45;
77
+ readonly cacheRead: 1;
78
+ readonly cacheWrite: 12.5;
79
+ };
80
+ readonly terra: {
81
+ readonly inputThreshold: 272000;
82
+ readonly input: 4;
83
+ readonly output: 18;
84
+ readonly cacheRead: 0.4;
85
+ readonly cacheWrite: 5;
86
+ };
87
+ };
88
+ export interface OpenAIModelManagerConfig {
89
+ apiKey?: string;
90
+ baseUrl?: string;
91
+ fetch?: FetchImpl;
92
+ }
93
+ export declare function openaiModelManagerOptions(config?: OpenAIModelManagerConfig): ModelManagerOptions<"openai-responses">;
94
+ /**
95
+ * Daybreak models are approval-gated first-party Responses models that are not
96
+ * yet present in stencil.so. Seed the documented aliases and current Cyber
97
+ * snapshot so fresh installs expose them without credentialed discovery.
98
+ */
99
+ export declare const OPENAI_DAYBREAK_CURATED_FALLBACK_MODELS: readonly ModelSpec<"openai-responses">[];
100
+ /**
101
+ * Re-derive the generated pro-reasoning aliases (`gpt-5.6-*-pro`) for the
102
+ * first-party `openai` gpt-5.6 rows. Each alias inherits the base row's
103
+ * metadata, requests the base wire id via `requestModelId`, and sets
104
+ * `reasoningMode: "pro"` so Responses-family request builders emit
105
+ * `reasoning: { mode: "pro" }`. Called by the models.json generator after all
106
+ * sources merge: stale copies of the owned aliases (previous snapshot,
107
+ * including retired `openai-codex` rows) are dropped and re-projected from the
108
+ * current base rows so alias metadata always tracks the base, while a real
109
+ * upstream model that occupies an alias id wins and suppresses the projection.
110
+ */
111
+ export declare function projectOpenAIProReasoningAliases(models: readonly ModelSpec<Api>[]): ModelSpec<Api>[];
112
+ /**
113
+ * Bundled seed for GMI Cloud. Generation has no `GMI_API_KEY`, so a regen
114
+ * without credentials would leave the provider slice empty and the declared
115
+ * `defaultModel` unresolvable on a fresh install before the async runtime
116
+ * discovery fires. Live `/v1/models` discovery is authoritative for the model
117
+ * ID set and overrides context/max-token limits, but `mapWithBundledReference`
118
+ * keeps the reference's cost/reasoning/thinking — so these fields carry GMI's
119
+ * direct-tariff values: V4-Flash at $0.14/$0.28 per 1M with Think High/Max
120
+ * modes per GMI's launch post
121
+ * (https://www.gmicloud.ai/en/blog/deepseek-v4-is-here-we-tested-it), not
122
+ * discounted gateway-route pricing. GMI publishes no cache-read tariff, so
123
+ * cacheRead stays 0 until a direct source confirms cached-token billing.
124
+ */
125
+ export declare const GMI_CLOUD_STATIC_MODELS: readonly ModelSpec<"openai-completions">[];
126
+ export interface GmiCloudModelManagerConfig {
127
+ apiKey?: string;
128
+ baseUrl?: string;
129
+ fetch?: FetchImpl;
130
+ }
131
+ export declare function gmiCloudModelManagerOptions(config?: GmiCloudModelManagerConfig): ModelManagerOptions<"openai-completions">;
132
+ export interface GroqModelManagerConfig {
133
+ apiKey?: string;
134
+ baseUrl?: string;
135
+ fetch?: FetchImpl;
136
+ }
137
+ export declare function groqModelManagerOptions(config?: GroqModelManagerConfig): ModelManagerOptions<"openai-completions">;
138
+ export interface CerebrasModelManagerConfig {
139
+ apiKey?: string;
140
+ baseUrl?: string;
141
+ fetch?: FetchImpl;
142
+ }
143
+ export declare function cerebrasModelManagerOptions(config?: CerebrasModelManagerConfig): ModelManagerOptions<"openai-completions">;
144
+ export interface HuggingfaceModelManagerConfig {
145
+ apiKey?: string;
146
+ baseUrl?: string;
147
+ fetch?: FetchImpl;
148
+ }
149
+ export declare function huggingfaceModelManagerOptions(config?: HuggingfaceModelManagerConfig): ModelManagerOptions<"openai-completions">;
150
+ export interface NvidiaModelManagerConfig {
151
+ apiKey?: string;
152
+ baseUrl?: string;
153
+ fetch?: FetchImpl;
154
+ }
155
+ export declare function nvidiaModelManagerOptions(config?: NvidiaModelManagerConfig): ModelManagerOptions<"openai-completions">;
156
+ /** Novita OpenAI-compatible discovery configuration. */
157
+ export interface NovitaModelManagerConfig {
158
+ apiKey?: string;
159
+ baseUrl?: string;
160
+ fetch?: FetchImpl;
161
+ }
162
+ /** Builds Novita's public model-discovery manager. */
163
+ export declare function novitaModelManagerOptions(config?: NovitaModelManagerConfig): ModelManagerOptions<"openai-completions">;
164
+ export interface XaiModelManagerConfig {
165
+ apiKey?: string;
166
+ baseUrl?: string;
167
+ fetch?: FetchImpl;
168
+ }
169
+ export declare function xaiModelManagerOptions(config?: XaiModelManagerConfig): ModelManagerOptions<"openai-responses">;
170
+ export interface XaiOAuthModelManagerConfig {
171
+ apiKey?: string;
172
+ baseUrl?: string;
173
+ fetch?: FetchImpl;
174
+ }
175
+ interface XAICuratedModel {
176
+ id: string;
177
+ contextWindow: number;
178
+ name?: string;
179
+ /** Whether the model reasons natively. Defaults to true for Grok-4.x family. */
180
+ reasoning?: boolean;
181
+ /**
182
+ * Whether xAI accepts the `reasoning.effort` wire param for this model.
183
+ * Default true. When false: the picker hides the effort dial (via
184
+ * getSupportedEfforts in model-thinking.ts) AND the wire omits the param —
185
+ * both derive from `isGrokReasoningEffortCapable` (identity/family.ts), the
186
+ * single allowlist shared by this curated layer and the compat builder.
187
+ */
188
+ supportsReasoningEffort?: boolean;
189
+ /**
190
+ * Input modalities this model accepts. Defaults to `["text"]` when absent.
191
+ * Vision-capable Grok models MUST list `"image"` here so the curated layer
192
+ * overrides `fetchOpenAICompatibleModels`' default of `["text"]` (which
193
+ * otherwise strips image capability on every online refresh).
194
+ */
195
+ input?: ("text" | "image")[];
196
+ }
197
+ export declare const XAI_OAUTH_CURATED_MODELS: readonly XAICuratedModel[];
198
+ /**
199
+ * Bake first-party xAI Responses effort-dial metadata onto a catalog spec.
200
+ *
201
+ * models.dev marks many Grok SKUs as reasoners and the thinking rebake would
202
+ * otherwise emit a default `minimal/low/medium/high` dial. api.x.ai only
203
+ * accepts `reasoning.effort` for {@link isGrokReasoningEffortCapable} ids —
204
+ * off-allowlist reasoners (`grok-code-fast-1`, `grok-build-0.1`,
205
+ * `grok-4.20-0309-reasoning`, …) 400 if the param is sent. SuperGrok
206
+ * (`xai-oauth`) already curates this via {@link mergeCuratedIntoModel}; paid
207
+ * `xai` rows come from stencil.so and need the same wire facts in the exported
208
+ * `models.json` so direct catalog readers do not present an unsupported dial.
209
+ *
210
+ * Explicit `compat.supportsReasoningEffort` / `omitReasoningEffort` win.
211
+ */
212
+ export declare function applyXaiResponsesThinkingPolicy(model: ModelSpec<"openai-responses">): ModelSpec<"openai-responses">;
213
+ /**
214
+ * Render `XAI_OAUTH_CURATED_MODELS` as full `ModelSpec<"openai-responses">` entries.
215
+ *
216
+ * Single source of truth for the curated to Model fan-in, consumed by both
217
+ * - {@link xaiOAuthModelManagerOptions} (runtime static seed handed to the model
218
+ * manager so the picker is populated on a fresh login), and
219
+ * - \`packages/catalog/scripts/generate-models.ts\` (bundles the same entries into
220
+ * `models.json`, so the synchronous `ModelRegistry.#loadModels()` boot path
221
+ * sees `xai-oauth` without waiting for a refresh — fixes the boot-time
222
+ * default-model reset when `modelRoles.default = "xai-oauth/<id>"`).
223
+ *
224
+ * `reasoning` defaults to `true` for the Grok-4.x family; the explicit
225
+ * `grok-4.20-0309-non-reasoning` entry opts out via `XAICuratedModel.reasoning`.
226
+ * `maxTokens` mirrors each model's `contextWindow` (the OAuth surface reports
227
+ * no per-request output limit); the openai-responses wire still clamps the
228
+ * actual request to OPENAI_MAX_OUTPUT_TOKENS. Mirrors
229
+ * `hermes-agent/hermes_cli/models.py:_XAI_STATIC_FALLBACK`.
230
+ */
231
+ export declare function buildXaiOAuthStaticSeed(baseUrl?: string): ModelSpec<"openai-responses">[];
232
+ export declare function xaiOAuthModelManagerOptions(config?: XaiOAuthModelManagerConfig): ModelManagerOptions<"openai-responses">;
233
+ export declare function isLikelyAimlApiChatModelId(id: string): boolean;
234
+ export interface AimlApiModelManagerConfig {
235
+ apiKey?: string;
236
+ baseUrl?: string;
237
+ fetch?: FetchImpl;
238
+ }
239
+ export declare function aimlApiModelManagerOptions(config?: AimlApiModelManagerConfig): ModelManagerOptions<"openai-completions">;
240
+ export interface DeepSeekModelManagerConfig {
241
+ apiKey?: string;
242
+ baseUrl?: string;
243
+ fetch?: FetchImpl;
244
+ }
245
+ export declare function deepseekModelManagerOptions(config?: DeepSeekModelManagerConfig): ModelManagerOptions<"openai-completions">;
246
+ export interface SiliconFlowModelManagerConfig {
247
+ apiKey?: string;
248
+ baseUrl?: string;
249
+ fetch?: FetchImpl;
250
+ }
251
+ export declare function isLikelySiliconFlowChatModelId(id: string): boolean;
252
+ export declare function siliconflowModelManagerOptions(config?: SiliconFlowModelManagerConfig): ModelManagerOptions<"openai-completions">;
253
+ export declare function siliconflowCnModelManagerOptions(config?: SiliconFlowModelManagerConfig): ModelManagerOptions<"openai-completions">;
254
+ export interface ZhipuCodingPlanModelManagerConfig {
255
+ apiKey?: string;
256
+ baseUrl?: string;
257
+ fetch?: FetchImpl;
258
+ }
259
+ export declare function zhipuCodingPlanModelManagerOptions(config?: ZhipuCodingPlanModelManagerConfig): ModelManagerOptions<"openai-completions">;
260
+ /**
261
+ * Fireworks-published cap for the Kimi K2 family. Fireworks' `/v1/models`
262
+ * envelope generically reports `max_completion_tokens: 65536` for every Kimi
263
+ * deployment, but Kimi K2 (instruct / thinking / turbo) on Fireworks is
264
+ * documented to ship long reasoning traces that should be bounded — capping
265
+ * at 32,768 prevents handing callers a budget the router cannot honor.
266
+ * See https://github.com/can1357/oh-my-pi/issues/1849.
267
+ */
268
+ export declare const FIREWORKS_KIMI_MAX_TOKENS = 32768;
269
+ /**
270
+ * Fireworks' output ceiling for Kimi K2.7-Code specifically. Its `/v1/models`
271
+ * generic `max_completion_tokens` is 65,536 and Fireworks serves it in full —
272
+ * verified with a single completion emitting 58,971 output tokens and
273
+ * `max_tokens: 200000` accepted without error. Unlike the older K2.5/K2.6
274
+ * family (see {@link FIREWORKS_KIMI_MAX_TOKENS}), K2.7-Code is not clamped to
275
+ * 32,768; that ceiling only truncated it.
276
+ */
277
+ export declare const FIREWORKS_KIMI_K27_CODE_MAX_TOKENS = 65536;
278
+ /**
279
+ * Returns true for the Kimi K2.5 / K2.6 family served by Fireworks-backed
280
+ * providers (`fireworks` direct, `firepass` router) that share the 32,768
281
+ * `maxTokens` ceiling. Matches both the public catalog id (`kimi-k2.5`,
282
+ * `kimi-k2.6`, `kimi-k2.6-turbo`) and the canonical Fireworks wire id
283
+ * (`accounts/fireworks/{models,routers}/kimi-k2…`).
284
+ *
285
+ * K2.7-Code (incl. `-fast` / `-highspeed`) is deliberately excluded: unlike the
286
+ * earlier K2 family it serves its full context on Fireworks — verified with a
287
+ * single completion emitting 58,971 output tokens and `max_tokens: 200000`
288
+ * accepted without error — so the 32,768 cap would only truncate it. It inherits
289
+ * Fireworks' reported `max_completion_tokens` (65,536) instead.
290
+ */
291
+ export declare function isFireworksKimiK2ModelId(modelId: string): boolean;
292
+ /**
293
+ * Clamp the Kimi K2 family's `maxTokens` to {@link FIREWORKS_KIMI_MAX_TOKENS}
294
+ * on Fireworks-backed providers, leaving every other model untouched.
295
+ */
296
+ export declare function clampFireworksKimiMaxTokens(modelId: string, candidate: number): number;
297
+ export declare function clampFireworksKimiMaxTokens(modelId: string, candidate: number | null): number | null;
298
+ /**
299
+ * Kimi K2.7 Code's documented recommended output budget. Some provider
300
+ * discovery rows report the context-sized `max_completion_tokens` instead.
301
+ */
302
+ export declare const KIMI_K27_CODE_RECOMMENDED_MAX_TOKENS = 32768;
303
+ export declare function isKimiK27CodeModelId(modelId: string): boolean;
304
+ export declare function clampKimiK27CodeMaxTokens(modelId: string, candidate: number): number;
305
+ export declare function clampKimiK27CodeMaxTokens(modelId: string, candidate: number | null): number | null;
306
+ /**
307
+ * Build the Fireworks Fast seed by projecting each base bundled spec into a
308
+ * `<id>-fast` variant. Pushed into the generated catalog (Fast routers never
309
+ * appear in the serverless control-plane list, so discovery cannot surface
310
+ * them) and deduped behind any identical previous-snapshot entry.
311
+ */
312
+ export declare function buildFireworksFastSeed(): ModelSpec<"openai-completions">[];
313
+ /**
314
+ * Fireworks DeepSeek V4 accepts effort via `reasoning_effort` but rejects the
315
+ * DeepSeek-native binary `thinking` toggle when both are present.
316
+ */
317
+ export declare function stripFireworksDeepSeekThinkingToggle(model: ModelSpec<"openai-completions">, publicModelId: string): ModelSpec<"openai-completions">;
318
+ export interface FireworksModelManagerConfig {
319
+ apiKey?: string;
320
+ baseUrl?: string;
321
+ fetch?: FetchImpl;
322
+ }
323
+ export declare function fireworksModelManagerOptions(config?: FireworksModelManagerConfig): ModelManagerOptions<"openai-completions">;
324
+ export interface FirepassModelManagerConfig {
325
+ apiKey?: string;
326
+ baseUrl?: string;
327
+ fetch?: FetchImpl;
328
+ }
329
+ /**
330
+ * Fire Pass is a Fireworks subscription product that exposes a single router
331
+ * model (Kimi K2.6 Turbo) under `accounts/fireworks/routers/kimi-k2p6-turbo`.
332
+ * The dedicated `fpk_…` keys do not authorize `/v1/models`, so this manager
333
+ * never performs dynamic discovery — the bundled catalog entry is canonical.
334
+ * See https://docs.fireworks.ai/firepass.
335
+ */
336
+ export declare function firepassModelManagerOptions(_config?: FirepassModelManagerConfig): ModelManagerOptions<"openai-completions">;
337
+ export interface WaferModelManagerConfig {
338
+ apiKey?: string;
339
+ baseUrl?: string;
340
+ fetch?: FetchImpl;
341
+ }
342
+ type WaferThinkingFormat = "zai" | "qwen";
343
+ export declare function resolveWaferServerlessThinkingFormat(modelId: string, upstreamProvider: unknown): WaferThinkingFormat | undefined;
344
+ export declare function waferServerlessModelManagerOptions(config?: WaferModelManagerConfig): ModelManagerOptions<"openai-completions">;
345
+ export interface MistralModelManagerConfig {
346
+ apiKey?: string;
347
+ baseUrl?: string;
348
+ fetch?: FetchImpl;
349
+ }
350
+ export declare function mistralModelManagerOptions(config?: MistralModelManagerConfig): ModelManagerOptions<"openai-completions">;
351
+ export interface OpenCodeModelManagerConfig {
352
+ apiKey?: string;
353
+ baseUrl?: string;
354
+ fetch?: FetchImpl;
355
+ }
356
+ export declare function opencodeZenModelManagerOptions(config?: OpenCodeModelManagerConfig): ModelManagerOptions<Api>;
357
+ export declare function opencodeGoModelManagerOptions(config?: OpenCodeModelManagerConfig): ModelManagerOptions<Api>;
358
+ export interface OllamaModelManagerConfig {
359
+ apiKey?: string;
360
+ baseUrl?: string;
361
+ fetch?: FetchImpl;
362
+ }
363
+ export declare function ollamaModelManagerOptions(config?: OllamaModelManagerConfig): ModelManagerOptions<"openai-responses">;
364
+ export interface OpenRouterModelManagerConfig {
365
+ apiKey?: string;
366
+ baseUrl?: string;
367
+ fetch?: FetchImpl;
368
+ }
369
+ export declare function openrouterModelManagerOptions(config?: OpenRouterModelManagerConfig): ModelManagerOptions<"openrouter">;
370
+ export interface ZenMuxModelManagerConfig {
371
+ apiKey?: string;
372
+ baseUrl?: string;
373
+ fetch?: FetchImpl;
374
+ }
375
+ export declare function zenmuxModelManagerOptions(config?: ZenMuxModelManagerConfig): ModelManagerOptions<Api>;
376
+ export interface KiloModelManagerConfig {
377
+ apiKey?: string;
378
+ baseUrl?: string;
379
+ fetch?: FetchImpl;
380
+ }
381
+ export declare function kiloModelManagerOptions(config?: KiloModelManagerConfig): ModelManagerOptions<"openai-completions">;
382
+ export interface AlibabaCodingPlanModelManagerConfig {
383
+ apiKey?: string;
384
+ baseUrl?: string;
385
+ fetch?: FetchImpl;
386
+ }
387
+ export declare function alibabaCodingPlanModelManagerOptions(config?: AlibabaCodingPlanModelManagerConfig): ModelManagerOptions<"openai-completions">;
388
+ export { ALIBABA_TOKEN_PLAN_BASE_URL };
389
+ export declare const ALIBABA_TOKEN_PLAN_STATIC_MODELS: readonly ModelSpec<"openai-completions">[];
390
+ /**
391
+ * Metadata for Alibaba Token Plan models that are dynamically discovered but not
392
+ * in the static catalog. Context window and max tokens are sourced from
393
+ * official model documentation and provider catalogs. Unknown future models
394
+ * remain available with null limits instead of assigning unsafe guessed limits.
395
+ */
396
+ export interface AlibabaTokenPlanModelLimits {
397
+ contextWindow: number;
398
+ maxTokens: number;
399
+ }
400
+ export declare const ALIBABA_TOKEN_PLAN_DISCOVERED_MODEL_LIMITS: Readonly<Record<string, AlibabaTokenPlanModelLimits>>;
401
+ export interface AlibabaTokenPlanModelManagerConfig {
402
+ apiKey?: string;
403
+ baseUrl?: string;
404
+ fetch?: FetchImpl;
405
+ }
406
+ export declare function alibabaTokenPlanModelManagerOptions(config?: AlibabaTokenPlanModelManagerConfig): ModelManagerOptions<"openai-completions">;
407
+ export interface VercelAiGatewayModelManagerConfig {
408
+ apiKey?: string;
409
+ baseUrl?: string;
410
+ fetch?: FetchImpl;
411
+ }
412
+ export declare function vercelAiGatewayModelManagerOptions(config?: VercelAiGatewayModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
413
+ export interface KimiCodeModelManagerConfig {
414
+ apiKey?: string;
415
+ baseUrl?: string;
416
+ fetch?: FetchImpl;
417
+ }
418
+ /**
419
+ * Kimi Code output ceilings by model family. The `/coding/v1/models` discovery
420
+ * envelope carries no output-limit field, so the mapper supplies the documented
421
+ * per-family caps instead of a blanket constant. Values match models.dev's
422
+ * `kimi-for-coding` and `moonshotai` kimi-k3 entries. See #6711.
423
+ */
424
+ export declare const KIMI_CODE_K3_MAX_TOKENS = 131072;
425
+ export declare const KIMI_CODE_FOR_CODING_MAX_TOKENS = 32768;
426
+ /** Fallback output cap for Kimi Code families without a documented ceiling (legacy K2 discovery rows). */
427
+ export declare const KIMI_CODE_DEFAULT_MAX_TOKENS = 32000;
428
+ /**
429
+ * Resolve a Kimi Code model's output ceiling from its id: `k3` / `k3-256k` ->
430
+ * 131072, `kimi-for-coding[-highspeed]` -> 32768, everything else -> `fallback`.
431
+ */
432
+ export declare function kimiCodeMaxTokens(modelId: string, fallback?: number): number;
433
+ export declare function kimiCodeMaxTokens(modelId: string, fallback: number | null): number | null;
434
+ export declare function kimiCodeModelManagerOptions(config?: KimiCodeModelManagerConfig): ModelManagerOptions<"openai-completions">;
435
+ /** Native LM Studio metadata keyed by model id from `/api/v0/models`. */
436
+ export interface LmStudioNativeModelMetadata {
437
+ input: ("text" | "image")[];
438
+ contextWindow?: number;
439
+ }
440
+ /** Options for LM Studio's optional native metadata probe. */
441
+ export interface LmStudioNativeModelMetadataOptions {
442
+ headers?: Record<string, string>;
443
+ signal?: AbortSignal;
444
+ }
445
+ /** Fetches LM Studio native model metadata used to mark VLM models as image-capable. */
446
+ export declare function fetchLmStudioNativeModelMetadata(baseUrl: string, fetchImpl?: FetchImpl, options?: LmStudioNativeModelMetadataOptions): Promise<Map<string, LmStudioNativeModelMetadata> | null>;
447
+ export interface LmStudioModelManagerConfig {
448
+ apiKey?: string;
449
+ baseUrl?: string;
450
+ fetch?: FetchImpl;
451
+ }
452
+ export declare function lmStudioModelManagerOptions(config?: LmStudioModelManagerConfig): ModelManagerOptions<"openai-completions">;
453
+ export interface SyntheticModelManagerConfig {
454
+ apiKey?: string;
455
+ baseUrl?: string;
456
+ fetch?: FetchImpl;
457
+ }
458
+ export declare function syntheticModelManagerOptions(config?: SyntheticModelManagerConfig): ModelManagerOptions<"openai-completions">;
459
+ export interface VeniceModelManagerConfig {
460
+ apiKey?: string;
461
+ baseUrl?: string;
462
+ fetch?: FetchImpl;
463
+ }
464
+ export declare function veniceModelManagerOptions(config?: VeniceModelManagerConfig): ModelManagerOptions<"openai-completions">;
465
+ export interface BasetenModelManagerConfig {
466
+ apiKey?: string;
467
+ baseUrl?: string;
468
+ fetch?: FetchImpl;
469
+ }
470
+ export declare function basetenModelManagerOptions(config?: BasetenModelManagerConfig): ModelManagerOptions<"openai-completions">;
471
+ export interface TogetherModelManagerConfig {
472
+ apiKey?: string;
473
+ baseUrl?: string;
474
+ fetch?: FetchImpl;
475
+ }
476
+ export declare function togetherModelManagerOptions(config?: TogetherModelManagerConfig): ModelManagerOptions<"openai-completions">;
477
+ export interface CoreWeaveModelManagerConfig {
478
+ apiKey?: string;
479
+ baseUrl?: string;
480
+ fetch?: FetchImpl;
481
+ }
482
+ export declare function coreWeaveModelManagerOptions(config?: CoreWeaveModelManagerConfig): ModelManagerOptions<"openai-completions">;
483
+ export declare const META_MUSE_STATIC_MODELS: readonly ModelSpec<"openai-responses">[];
484
+ /**
485
+ * OpenAI frontier models served exclusively through Bedrock Mantle's Responses
486
+ * endpoint. Pricing is per million tokens from the Amazon Bedrock pricing page.
487
+ */
488
+ export declare const BEDROCK_MANTLE_STATIC_MODELS: readonly ModelSpec<"openai-responses">[];
489
+ export declare function bedrockMantleModelManagerOptions(config?: ModelManagerConfig): ModelManagerOptions<"openai-responses">;
490
+ export interface MetaModelManagerConfig {
491
+ apiKey?: string;
492
+ baseUrl?: string;
493
+ fetch?: FetchImpl;
494
+ }
495
+ export declare function metaModelManagerOptions(config?: MetaModelManagerConfig): ModelManagerOptions<"openai-responses">;
496
+ export interface MoonshotModelManagerConfig {
497
+ apiKey?: string;
498
+ baseUrl?: string;
499
+ fetch?: FetchImpl;
500
+ }
501
+ export declare function moonshotModelManagerOptions(config?: MoonshotModelManagerConfig): ModelManagerOptions<"openai-completions">;
502
+ export declare const SAKANA_FUGU_STATIC_MODELS: readonly ModelSpec<"openai-responses">[];
503
+ export interface SakanaModelManagerConfig {
504
+ apiKey?: string;
505
+ baseUrl?: string;
506
+ fetch?: FetchImpl;
507
+ }
508
+ export declare function sakanaModelManagerOptions(config?: SakanaModelManagerConfig): ModelManagerOptions<"openai-responses">;
509
+ /**
510
+ * Documented ai& catalog (docs.aiand.com/models/catalog, 2026-08) bundled so
511
+ * the provider is usable when generation and first boot have no live key.
512
+ * The org-scoped `/v1/models` response is authoritative once discovery runs.
513
+ */
514
+ export declare const AIAND_STATIC_MODELS: readonly ModelSpec<"openai-completions">[];
515
+ export interface AiandModelManagerConfig {
516
+ apiKey?: string;
517
+ baseUrl?: string;
518
+ fetch?: FetchImpl;
519
+ }
520
+ /**
521
+ * ai& (aiand.com) model manager: OpenAI-compatible chat completions with an
522
+ * org-scoped `/v1/models` catalog carrying context, capability, effort, and
523
+ * pricing metadata, so discovery is authoritative over the bundled seed.
524
+ */
525
+ export declare function aiandModelManagerOptions(config?: AiandModelManagerConfig): ModelManagerOptions<"openai-completions">;
526
+ export interface QwenPortalModelManagerConfig {
527
+ apiKey?: string;
528
+ baseUrl?: string;
529
+ fetch?: FetchImpl;
530
+ }
531
+ export declare function qwenPortalModelManagerOptions(config?: QwenPortalModelManagerConfig): ModelManagerOptions<"openai-completions">;
532
+ export interface QianfanModelManagerConfig {
533
+ apiKey?: string;
534
+ baseUrl?: string;
535
+ fetch?: FetchImpl;
536
+ }
537
+ export declare function qianfanModelManagerOptions(config?: QianfanModelManagerConfig): ModelManagerOptions<"openai-completions">;
538
+ export interface CloudflareAiGatewayModelManagerConfig {
539
+ apiKey?: string;
540
+ baseUrl?: string;
541
+ fetch?: FetchImpl;
542
+ }
543
+ export declare function cloudflareAiGatewayModelManagerOptions(config?: CloudflareAiGatewayModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
544
+ /** Region codes for Xiaomi Token Plan clusters exposed as separate login providers. */
545
+ export type XiaomiTokenPlanRegion = "sgp" | "ams" | "cn";
546
+ /** Configures Xiaomi standard or regional Token Plan OpenAI-compatible model discovery. */
547
+ export interface XiaomiModelManagerConfig {
548
+ apiKey?: string;
549
+ baseUrl?: string;
550
+ fetch?: FetchImpl;
551
+ providerId?: Provider;
552
+ tokenPlanRegion?: XiaomiTokenPlanRegion;
553
+ }
554
+ /** Builds a Xiaomi model manager, preserving Token Plan region provider ids during discovery. */
555
+ export declare function xiaomiModelManagerOptions(config?: XiaomiModelManagerConfig): ModelManagerOptions<"openai-completions">;
556
+ export interface LiteLLMModelManagerConfig {
557
+ apiKey?: string;
558
+ baseUrl?: string;
559
+ fetch?: FetchImpl;
560
+ }
561
+ export interface FetchLiteLLMRichModelsOptions<TApi extends Api> {
562
+ api: TApi;
563
+ provider: Provider;
564
+ baseUrl: string;
565
+ apiKey?: string;
566
+ headers?: Record<string, string>;
567
+ fetch?: FetchImpl;
568
+ signal?: AbortSignal;
569
+ timeoutMs?: number;
570
+ referenceResolver?: (modelId: string) => ModelSpec<TApi> | undefined;
571
+ resolveApi?: (entry: Record<string, unknown>, modelId: string) => TApi;
572
+ }
573
+ export declare const OPENAI_COMPAT_DISCOVERY_DEFAULT_CONTEXT_WINDOW = 128000;
574
+ export declare const OPENAI_COMPAT_DISCOVERY_DEFAULT_MAX_TOKENS = 32768;
575
+ export declare function normalizeLiteLLMManagementBaseUrl(baseUrl: string): string;
576
+ export declare function resolveLiteLLMApi(entry: Record<string, unknown> | undefined, id: string, fallbackApi?: Api): Api;
577
+ export declare function fetchLiteLLMRichModels<TApi extends Api>(options: FetchLiteLLMRichModelsOptions<TApi>): Promise<ModelSpec<TApi>[] | null>;
578
+ export declare function litellmModelManagerOptions(config?: LiteLLMModelManagerConfig): ModelManagerOptions<Api>;
579
+ export interface VllmModelManagerConfig {
580
+ apiKey?: string;
581
+ baseUrl?: string;
582
+ fetch?: FetchImpl;
583
+ }
584
+ export declare function vllmModelManagerOptions(config?: VllmModelManagerConfig): ModelManagerOptions<"openai-completions">;
585
+ export interface NanoGptModelManagerConfig {
586
+ apiKey?: string;
587
+ baseUrl?: string;
588
+ fetch?: FetchImpl;
589
+ }
590
+ export declare function nanoGptModelManagerOptions(config?: NanoGptModelManagerConfig): ModelManagerOptions<"openai-completions">;
591
+ export interface GithubCopilotModelManagerConfig {
592
+ apiKey?: string;
593
+ baseUrl?: string;
594
+ fetch?: FetchImpl;
595
+ }
596
+ /** Local id/name suffixes for synthesized Copilot long-context variants. */
597
+ export declare const COPILOT_LONG_CONTEXT_ID_SUFFIX = "-1m";
598
+ export declare function githubCopilotModelManagerOptions(config?: GithubCopilotModelManagerConfig): ModelManagerOptions<Api>;
599
+ export interface AnthropicModelManagerConfig {
600
+ apiKey?: string;
601
+ baseUrl?: string;
602
+ fetch?: FetchImpl;
603
+ }
604
+ export declare function anthropicModelManagerOptions(config?: AnthropicModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
605
+ /** Describes how to map models.dev API data for a single provider. */
606
+ export interface ModelsDevProviderDescriptor {
607
+ /** Key in the models.dev API response JSON (e.g., "anthropic", "amazon-bedrock") */
608
+ modelsDevKey: string;
609
+ /** Provider ID in our system */
610
+ providerId: string;
611
+ /** Default API type for this provider's models */
612
+ api: Api;
613
+ /** Default base URL */
614
+ baseUrl: string;
615
+ /** Default context window fallback (default: UNKNNOWN_CONTEXT_WINDOW) */
616
+ defaultContextWindow?: number;
617
+ /** Default max tokens fallback (default: UNKNNOWN_MAX_TOKENS) */
618
+ defaultMaxTokens?: number;
619
+ /** Optional compat overrides applied to every model from this provider */
620
+ compat?: ModelSpec<Api>["compat"];
621
+ /** Optional static headers applied to every model */
622
+ headers?: Record<string, string>;
623
+ /**
624
+ * Optional filter: return false to skip a model.
625
+ * Called with (modelId, rawModel). Default: skip if tool_call !== true.
626
+ */
627
+ filterModel?: (modelId: string, model: ModelsDevModel) => boolean;
628
+ /**
629
+ * Optional transform: modify the mapped model before it's added.
630
+ * Can return null to skip the model, or an array to emit multiple models.
631
+ */
632
+ transformModel?: (model: ModelSpec<Api>, modelId: string, raw: ModelsDevModel) => ModelSpec<Api> | ModelSpec<Api>[] | null;
633
+ /**
634
+ * Optional: override the API type per-model.
635
+ * Called with (modelId, raw). Return the API type to use.
636
+ * If not provided, uses the `api` field.
637
+ */
638
+ resolveApi?: (modelId: string, raw: ModelsDevModel) => {
639
+ api: Api;
640
+ baseUrl: string;
641
+ } | null;
642
+ }
643
+ /** Generic mapper that converts models.dev data using provider descriptors. */
644
+ export declare function mapModelsDevToModels(data: Record<string, unknown>, descriptors: readonly ModelsDevProviderDescriptor[]): ModelSpec<Api>[];
645
+ /** All provider descriptors for models.dev data mapping in generate-models.ts. */
646
+ export declare const MODELS_DEV_PROVIDER_DESCRIPTORS: readonly ModelsDevProviderDescriptor[];