@oh-my-pi/pi-catalog 15.10.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/types/build.d.ts +3 -0
- package/dist/types/compat/anthropic.d.ts +11 -0
- package/dist/types/compat/apply.d.ts +7 -0
- package/dist/types/compat/openai.d.ts +21 -0
- package/dist/types/discovery/antigravity.d.ts +61 -0
- package/dist/types/discovery/codex.d.ts +38 -0
- package/dist/types/discovery/cursor-gen/agent_pb.d.ts +13022 -0
- package/dist/types/discovery/cursor.d.ts +23 -0
- package/dist/types/discovery/gemini.d.ts +25 -0
- package/dist/types/discovery/index.d.ts +4 -0
- package/dist/types/discovery/openai-compatible.d.ts +72 -0
- package/dist/types/effort.d.ts +9 -0
- package/dist/types/fireworks-model-id.d.ts +10 -0
- package/dist/types/hosts.d.ts +128 -0
- package/dist/types/identity/bundled.d.ts +6 -0
- package/dist/types/identity/classify.d.ts +45 -0
- package/dist/types/identity/equivalence.d.ts +46 -0
- package/dist/types/identity/family.d.ts +45 -0
- package/dist/types/identity/id.d.ts +12 -0
- package/dist/types/identity/index.d.ts +9 -0
- package/dist/types/identity/markers.d.ts +4 -0
- package/dist/types/identity/priority.d.ts +1 -0
- package/dist/types/identity/reference.d.ts +22 -0
- package/dist/types/identity/selection.d.ts +20 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/model-cache.d.ts +17 -0
- package/dist/types/model-manager.d.ts +64 -0
- package/dist/types/model-thinking.d.ts +67 -0
- package/dist/types/models.d.ts +12 -0
- package/dist/types/provider-models/bundled-references.d.ts +11 -0
- package/dist/types/provider-models/descriptor-types.d.ts +74 -0
- package/dist/types/provider-models/descriptors.d.ts +384 -0
- package/dist/types/provider-models/discovery-constants.d.ts +11 -0
- package/dist/types/provider-models/google.d.ts +27 -0
- package/dist/types/provider-models/index.d.ts +6 -0
- package/dist/types/provider-models/ollama.d.ts +9 -0
- package/dist/types/provider-models/openai-compat.d.ts +385 -0
- package/dist/types/provider-models/special.d.ts +16 -0
- package/dist/types/types.d.ts +405 -0
- package/dist/types/utils.d.ts +5 -0
- package/dist/types/wire/codex.d.ts +26 -0
- package/dist/types/wire/gemini-headers.d.ts +18 -0
- package/dist/types/wire/github-copilot.d.ts +18 -0
- package/package.json +100 -0
- package/src/build.ts +40 -0
- package/src/compat/anthropic.ts +67 -0
- package/src/compat/apply.ts +15 -0
- package/src/compat/openai.ts +365 -0
- package/src/discovery/antigravity.ts +261 -0
- package/src/discovery/codex.ts +371 -0
- package/src/discovery/cursor-gen/agent_pb.ts +15274 -0
- package/src/discovery/cursor.ts +307 -0
- package/src/discovery/gemini.ts +249 -0
- package/src/discovery/index.ts +4 -0
- package/src/discovery/openai-compatible.ts +224 -0
- package/src/effort.ts +16 -0
- package/src/fireworks-model-id.ts +30 -0
- package/src/hosts.ts +114 -0
- package/src/identity/bundled.ts +38 -0
- package/src/identity/classify.ts +141 -0
- package/src/identity/equivalence.ts +870 -0
- package/src/identity/family.ts +88 -0
- package/src/identity/id.ts +81 -0
- package/src/identity/index.ts +9 -0
- package/src/identity/markers.ts +49 -0
- package/src/identity/priority.ts +56 -0
- package/src/identity/reference.ts +134 -0
- package/src/identity/selection.ts +65 -0
- package/src/index.ts +15 -0
- package/src/model-cache.ts +132 -0
- package/src/model-manager.ts +472 -0
- package/src/model-thinking.ts +407 -0
- package/src/models.json +75308 -0
- package/src/models.json.d.ts +9 -0
- package/src/models.ts +64 -0
- package/src/provider-models/bundled-references.ts +54 -0
- package/src/provider-models/descriptor-types.ts +79 -0
- package/src/provider-models/descriptors.ts +456 -0
- package/src/provider-models/discovery-constants.ts +11 -0
- package/src/provider-models/google.ts +105 -0
- package/src/provider-models/index.ts +6 -0
- package/src/provider-models/ollama.ts +154 -0
- package/src/provider-models/openai-compat.ts +3106 -0
- package/src/provider-models/special.ts +67 -0
- package/src/types.ts +470 -0
- package/src/utils.ts +27 -0
- package/src/wire/codex.ts +43 -0
- package/src/wire/gemini-headers.ts +41 -0
- package/src/wire/github-copilot.ts +72 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import type { ModelManagerOptions } from "../model-manager";
|
|
2
|
+
import { getBundledModels } from "../models";
|
|
3
|
+
import type { Api, FetchImpl, ModelSpec, Provider } from "../types";
|
|
4
|
+
export interface ModelsDevModel {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
tool_call?: boolean;
|
|
8
|
+
reasoning?: boolean;
|
|
9
|
+
limit?: {
|
|
10
|
+
context?: number;
|
|
11
|
+
output?: number;
|
|
12
|
+
};
|
|
13
|
+
cost?: {
|
|
14
|
+
input?: number;
|
|
15
|
+
output?: number;
|
|
16
|
+
cache_read?: number;
|
|
17
|
+
cache_write?: number;
|
|
18
|
+
};
|
|
19
|
+
modalities?: {
|
|
20
|
+
input?: string[];
|
|
21
|
+
};
|
|
22
|
+
status?: string;
|
|
23
|
+
provider?: {
|
|
24
|
+
npm?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Curated Anthropic models that are live or limited-availability on the
|
|
29
|
+
* first-party `/v1/models` endpoint but that models.dev has not catalogued yet.
|
|
30
|
+
* Seeded into model generation so the bundled catalog is never gated on
|
|
31
|
+
* models.dev's update cadence; deduped behind upstream catalog / models.dev
|
|
32
|
+
* entries once those appear. Token limits and pricing are pinned
|
|
33
|
+
* authoritatively in `applyAnthropicCatalogPolicy`, and `thinking` is re-baked
|
|
34
|
+
* by the generator's policy pass (scripts/generated-policies.ts).
|
|
35
|
+
*/
|
|
36
|
+
export declare const ANTHROPIC_CURATED_FALLBACK_MODELS: readonly ModelSpec<"anthropic-messages">[];
|
|
37
|
+
type SimpleProviderConfig = {
|
|
38
|
+
apiKey?: string;
|
|
39
|
+
baseUrl?: string;
|
|
40
|
+
fetch?: FetchImpl;
|
|
41
|
+
};
|
|
42
|
+
export declare function createSimpleOpenAICompletionsOptions(providerId: Parameters<typeof getBundledModels>[0], defaultBaseUrl: string, config?: SimpleProviderConfig): ModelManagerOptions<"openai-completions">;
|
|
43
|
+
export interface OpenAIModelManagerConfig {
|
|
44
|
+
apiKey?: string;
|
|
45
|
+
baseUrl?: string;
|
|
46
|
+
fetch?: FetchImpl;
|
|
47
|
+
}
|
|
48
|
+
export declare function openaiModelManagerOptions(config?: OpenAIModelManagerConfig): ModelManagerOptions<"openai-responses">;
|
|
49
|
+
export interface GroqModelManagerConfig {
|
|
50
|
+
apiKey?: string;
|
|
51
|
+
baseUrl?: string;
|
|
52
|
+
fetch?: FetchImpl;
|
|
53
|
+
}
|
|
54
|
+
export declare function groqModelManagerOptions(config?: GroqModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
55
|
+
export interface CerebrasModelManagerConfig {
|
|
56
|
+
apiKey?: string;
|
|
57
|
+
baseUrl?: string;
|
|
58
|
+
fetch?: FetchImpl;
|
|
59
|
+
}
|
|
60
|
+
export declare function cerebrasModelManagerOptions(config?: CerebrasModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
61
|
+
export interface HuggingfaceModelManagerConfig {
|
|
62
|
+
apiKey?: string;
|
|
63
|
+
baseUrl?: string;
|
|
64
|
+
fetch?: FetchImpl;
|
|
65
|
+
}
|
|
66
|
+
export declare function huggingfaceModelManagerOptions(config?: HuggingfaceModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
67
|
+
export interface NvidiaModelManagerConfig {
|
|
68
|
+
apiKey?: string;
|
|
69
|
+
baseUrl?: string;
|
|
70
|
+
fetch?: FetchImpl;
|
|
71
|
+
}
|
|
72
|
+
export declare function nvidiaModelManagerOptions(config?: NvidiaModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
73
|
+
export interface XaiModelManagerConfig {
|
|
74
|
+
apiKey?: string;
|
|
75
|
+
baseUrl?: string;
|
|
76
|
+
fetch?: FetchImpl;
|
|
77
|
+
}
|
|
78
|
+
export declare function xaiModelManagerOptions(config?: XaiModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
79
|
+
export interface XaiOAuthModelManagerConfig {
|
|
80
|
+
apiKey?: string;
|
|
81
|
+
baseUrl?: string;
|
|
82
|
+
fetch?: FetchImpl;
|
|
83
|
+
}
|
|
84
|
+
interface XAICuratedModel {
|
|
85
|
+
id: string;
|
|
86
|
+
contextWindow: number;
|
|
87
|
+
name?: string;
|
|
88
|
+
/** Whether the model reasons natively. Defaults to true for Grok-4.x family. */
|
|
89
|
+
reasoning?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Whether xAI accepts the `reasoning.effort` wire param for this model.
|
|
92
|
+
* Default true. When false: picker hides the effort dial (via
|
|
93
|
+
* getSupportedEfforts in model-thinking.ts) AND wire-side already omits
|
|
94
|
+
* the param via GROK_EFFORT_CAPABLE_PREFIXES in providers/xai-responses.ts.
|
|
95
|
+
* Must agree with that allowlist; two truths kept in sync by curated-catalog
|
|
96
|
+
* author convention until a follow-up Op: compress unifies them.
|
|
97
|
+
*/
|
|
98
|
+
supportsReasoningEffort?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Input modalities this model accepts. Defaults to `["text"]` when absent.
|
|
101
|
+
* Vision-capable Grok models MUST list `"image"` here so the curated layer
|
|
102
|
+
* overrides `fetchOpenAICompatibleModels`' default of `["text"]` (which
|
|
103
|
+
* otherwise strips image capability on every online refresh).
|
|
104
|
+
*/
|
|
105
|
+
input?: ("text" | "image")[];
|
|
106
|
+
}
|
|
107
|
+
export declare const XAI_OAUTH_CURATED_MODELS: readonly XAICuratedModel[];
|
|
108
|
+
/**
|
|
109
|
+
* Render `XAI_OAUTH_CURATED_MODELS` as full `ModelSpec<"openai-responses">` entries.
|
|
110
|
+
*
|
|
111
|
+
* Single source of truth for the curated to Model fan-in, consumed by both
|
|
112
|
+
* - {@link xaiOAuthModelManagerOptions} (runtime static seed handed to the model
|
|
113
|
+
* manager so the picker is populated on a fresh login), and
|
|
114
|
+
* - `packages/ai/scripts/generate-models.ts` (bundles the same entries into
|
|
115
|
+
* `models.json`, so the synchronous `ModelRegistry.#loadModels()` boot path
|
|
116
|
+
* sees `xai-oauth` without waiting for a refresh — fixes the boot-time
|
|
117
|
+
* default-model reset when `modelRoles.default = "xai-oauth/<id>"`).
|
|
118
|
+
*
|
|
119
|
+
* `reasoning` defaults to `true` for the Grok-4.x family; the explicit
|
|
120
|
+
* `grok-4.20-0309-non-reasoning` entry opts out via `XAICuratedModel.reasoning`.
|
|
121
|
+
* `maxTokens` uses `UNK_MAX_TOKENS` so id-keyed overlays from a successful
|
|
122
|
+
* dynamic fetch merge cleanly. Mirrors
|
|
123
|
+
* `hermes-agent/hermes_cli/models.py:_XAI_STATIC_FALLBACK`.
|
|
124
|
+
*/
|
|
125
|
+
export declare function buildXaiOAuthStaticSeed(baseUrl?: string): ModelSpec<"openai-responses">[];
|
|
126
|
+
export declare function xaiOAuthModelManagerOptions(config?: XaiOAuthModelManagerConfig): ModelManagerOptions<"openai-responses">;
|
|
127
|
+
export declare function isLikelyAimlApiChatModelId(id: string): boolean;
|
|
128
|
+
export interface AimlApiModelManagerConfig {
|
|
129
|
+
apiKey?: string;
|
|
130
|
+
baseUrl?: string;
|
|
131
|
+
fetch?: FetchImpl;
|
|
132
|
+
}
|
|
133
|
+
export declare function aimlApiModelManagerOptions(config?: AimlApiModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
134
|
+
export interface DeepSeekModelManagerConfig {
|
|
135
|
+
apiKey?: string;
|
|
136
|
+
baseUrl?: string;
|
|
137
|
+
fetch?: FetchImpl;
|
|
138
|
+
}
|
|
139
|
+
export declare function deepseekModelManagerOptions(config?: DeepSeekModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
140
|
+
export interface ZhipuCodingPlanModelManagerConfig {
|
|
141
|
+
apiKey?: string;
|
|
142
|
+
baseUrl?: string;
|
|
143
|
+
fetch?: FetchImpl;
|
|
144
|
+
}
|
|
145
|
+
export declare function zhipuCodingPlanModelManagerOptions(config?: ZhipuCodingPlanModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
146
|
+
/**
|
|
147
|
+
* Fireworks-published cap for the Kimi K2 family. Fireworks' `/v1/models`
|
|
148
|
+
* envelope generically reports `max_completion_tokens: 65536` for every Kimi
|
|
149
|
+
* deployment, but Kimi K2 (instruct / thinking / turbo) on Fireworks is
|
|
150
|
+
* documented to ship long reasoning traces that should be bounded — capping
|
|
151
|
+
* at 32,768 prevents handing callers a budget the router cannot honor.
|
|
152
|
+
* See https://github.com/can1357/oh-my-pi/issues/1849.
|
|
153
|
+
*/
|
|
154
|
+
export declare const FIREWORKS_KIMI_MAX_TOKENS = 32768;
|
|
155
|
+
/**
|
|
156
|
+
* Returns true for any Kimi K2.x public model id served by Fireworks-backed
|
|
157
|
+
* providers (`fireworks` direct, `firepass` router). Matches both the public
|
|
158
|
+
* catalog id (`kimi-k2.5`, `kimi-k2.6`, `kimi-k2.6-turbo`) and the canonical
|
|
159
|
+
* Fireworks wire id (`accounts/fireworks/{models,routers}/kimi-k2…`).
|
|
160
|
+
*/
|
|
161
|
+
export declare function isFireworksKimiK2ModelId(modelId: string): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Clamp the Kimi K2 family's `maxTokens` to {@link FIREWORKS_KIMI_MAX_TOKENS}
|
|
164
|
+
* on Fireworks-backed providers, leaving every other model untouched.
|
|
165
|
+
*/
|
|
166
|
+
export declare function clampFireworksKimiMaxTokens(modelId: string, candidate: number): number;
|
|
167
|
+
/**
|
|
168
|
+
* Fireworks DeepSeek V4 accepts effort via `reasoning_effort` but rejects the
|
|
169
|
+
* DeepSeek-native binary `thinking` toggle when both are present.
|
|
170
|
+
*/
|
|
171
|
+
export declare function stripFireworksDeepSeekThinkingToggle(model: ModelSpec<"openai-completions">, publicModelId: string): ModelSpec<"openai-completions">;
|
|
172
|
+
export interface FireworksModelManagerConfig {
|
|
173
|
+
apiKey?: string;
|
|
174
|
+
baseUrl?: string;
|
|
175
|
+
fetch?: FetchImpl;
|
|
176
|
+
}
|
|
177
|
+
export declare function fireworksModelManagerOptions(config?: FireworksModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
178
|
+
export interface FirepassModelManagerConfig {
|
|
179
|
+
apiKey?: string;
|
|
180
|
+
baseUrl?: string;
|
|
181
|
+
fetch?: FetchImpl;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Fire Pass is a Fireworks subscription product that exposes a single router
|
|
185
|
+
* model (Kimi K2.6 Turbo) under `accounts/fireworks/routers/kimi-k2p6-turbo`.
|
|
186
|
+
* The dedicated `fpk_…` keys do not authorize `/v1/models`, so this manager
|
|
187
|
+
* never performs dynamic discovery — the bundled catalog entry is canonical.
|
|
188
|
+
* See https://docs.fireworks.ai/firepass.
|
|
189
|
+
*/
|
|
190
|
+
export declare function firepassModelManagerOptions(_config?: FirepassModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
191
|
+
export interface WaferModelManagerConfig {
|
|
192
|
+
apiKey?: string;
|
|
193
|
+
baseUrl?: string;
|
|
194
|
+
fetch?: FetchImpl;
|
|
195
|
+
}
|
|
196
|
+
export declare function waferPassModelManagerOptions(config?: WaferModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
197
|
+
export declare function waferServerlessModelManagerOptions(config?: WaferModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
198
|
+
export interface MistralModelManagerConfig {
|
|
199
|
+
apiKey?: string;
|
|
200
|
+
baseUrl?: string;
|
|
201
|
+
fetch?: FetchImpl;
|
|
202
|
+
}
|
|
203
|
+
export declare function mistralModelManagerOptions(config?: MistralModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
204
|
+
export interface OpenCodeModelManagerConfig {
|
|
205
|
+
apiKey?: string;
|
|
206
|
+
baseUrl?: string;
|
|
207
|
+
fetch?: FetchImpl;
|
|
208
|
+
}
|
|
209
|
+
export declare function opencodeZenModelManagerOptions(config?: OpenCodeModelManagerConfig): ModelManagerOptions<Api>;
|
|
210
|
+
export declare function opencodeGoModelManagerOptions(config?: OpenCodeModelManagerConfig): ModelManagerOptions<Api>;
|
|
211
|
+
export interface OllamaModelManagerConfig {
|
|
212
|
+
apiKey?: string;
|
|
213
|
+
baseUrl?: string;
|
|
214
|
+
fetch?: FetchImpl;
|
|
215
|
+
}
|
|
216
|
+
export declare function ollamaModelManagerOptions(config?: OllamaModelManagerConfig): ModelManagerOptions<"openai-responses">;
|
|
217
|
+
export interface OpenRouterModelManagerConfig {
|
|
218
|
+
apiKey?: string;
|
|
219
|
+
baseUrl?: string;
|
|
220
|
+
fetch?: FetchImpl;
|
|
221
|
+
}
|
|
222
|
+
export declare function openrouterModelManagerOptions(config?: OpenRouterModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
223
|
+
export interface ZenMuxModelManagerConfig {
|
|
224
|
+
apiKey?: string;
|
|
225
|
+
baseUrl?: string;
|
|
226
|
+
fetch?: FetchImpl;
|
|
227
|
+
}
|
|
228
|
+
export declare function zenmuxModelManagerOptions(config?: ZenMuxModelManagerConfig): ModelManagerOptions<Api>;
|
|
229
|
+
export interface KiloModelManagerConfig {
|
|
230
|
+
apiKey?: string;
|
|
231
|
+
baseUrl?: string;
|
|
232
|
+
fetch?: FetchImpl;
|
|
233
|
+
}
|
|
234
|
+
export declare function kiloModelManagerOptions(config?: KiloModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
235
|
+
export interface AlibabaCodingPlanModelManagerConfig {
|
|
236
|
+
apiKey?: string;
|
|
237
|
+
baseUrl?: string;
|
|
238
|
+
fetch?: FetchImpl;
|
|
239
|
+
}
|
|
240
|
+
export declare function alibabaCodingPlanModelManagerOptions(config?: AlibabaCodingPlanModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
241
|
+
export interface VercelAiGatewayModelManagerConfig {
|
|
242
|
+
apiKey?: string;
|
|
243
|
+
baseUrl?: string;
|
|
244
|
+
fetch?: FetchImpl;
|
|
245
|
+
}
|
|
246
|
+
export declare function vercelAiGatewayModelManagerOptions(config?: VercelAiGatewayModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
|
|
247
|
+
export interface KimiCodeModelManagerConfig {
|
|
248
|
+
apiKey?: string;
|
|
249
|
+
baseUrl?: string;
|
|
250
|
+
fetch?: FetchImpl;
|
|
251
|
+
}
|
|
252
|
+
export declare function kimiCodeModelManagerOptions(config?: KimiCodeModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
253
|
+
export interface LmStudioModelManagerConfig {
|
|
254
|
+
apiKey?: string;
|
|
255
|
+
baseUrl?: string;
|
|
256
|
+
fetch?: FetchImpl;
|
|
257
|
+
}
|
|
258
|
+
export declare function lmStudioModelManagerOptions(config?: LmStudioModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
259
|
+
export interface SyntheticModelManagerConfig {
|
|
260
|
+
apiKey?: string;
|
|
261
|
+
baseUrl?: string;
|
|
262
|
+
fetch?: FetchImpl;
|
|
263
|
+
}
|
|
264
|
+
export declare function syntheticModelManagerOptions(config?: SyntheticModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
265
|
+
export interface VeniceModelManagerConfig {
|
|
266
|
+
apiKey?: string;
|
|
267
|
+
baseUrl?: string;
|
|
268
|
+
fetch?: FetchImpl;
|
|
269
|
+
}
|
|
270
|
+
export declare function veniceModelManagerOptions(config?: VeniceModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
271
|
+
export interface TogetherModelManagerConfig {
|
|
272
|
+
apiKey?: string;
|
|
273
|
+
baseUrl?: string;
|
|
274
|
+
fetch?: FetchImpl;
|
|
275
|
+
}
|
|
276
|
+
export declare function togetherModelManagerOptions(config?: TogetherModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
277
|
+
export interface MoonshotModelManagerConfig {
|
|
278
|
+
apiKey?: string;
|
|
279
|
+
baseUrl?: string;
|
|
280
|
+
fetch?: FetchImpl;
|
|
281
|
+
}
|
|
282
|
+
export declare function moonshotModelManagerOptions(config?: MoonshotModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
283
|
+
export interface QwenPortalModelManagerConfig {
|
|
284
|
+
apiKey?: string;
|
|
285
|
+
baseUrl?: string;
|
|
286
|
+
fetch?: FetchImpl;
|
|
287
|
+
}
|
|
288
|
+
export declare function qwenPortalModelManagerOptions(config?: QwenPortalModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
289
|
+
export interface QianfanModelManagerConfig {
|
|
290
|
+
apiKey?: string;
|
|
291
|
+
baseUrl?: string;
|
|
292
|
+
fetch?: FetchImpl;
|
|
293
|
+
}
|
|
294
|
+
export declare function qianfanModelManagerOptions(config?: QianfanModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
295
|
+
export interface CloudflareAiGatewayModelManagerConfig {
|
|
296
|
+
apiKey?: string;
|
|
297
|
+
baseUrl?: string;
|
|
298
|
+
fetch?: FetchImpl;
|
|
299
|
+
}
|
|
300
|
+
export declare function cloudflareAiGatewayModelManagerOptions(config?: CloudflareAiGatewayModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
|
|
301
|
+
/** Region codes for Xiaomi Token Plan clusters exposed as separate login providers. */
|
|
302
|
+
export type XiaomiTokenPlanRegion = "sgp" | "ams" | "cn";
|
|
303
|
+
/** Configures Xiaomi standard or regional Token Plan OpenAI-compatible model discovery. */
|
|
304
|
+
export interface XiaomiModelManagerConfig {
|
|
305
|
+
apiKey?: string;
|
|
306
|
+
baseUrl?: string;
|
|
307
|
+
fetch?: FetchImpl;
|
|
308
|
+
providerId?: Provider;
|
|
309
|
+
tokenPlanRegion?: XiaomiTokenPlanRegion;
|
|
310
|
+
}
|
|
311
|
+
/** Builds a Xiaomi model manager, preserving Token Plan region provider ids during discovery. */
|
|
312
|
+
export declare function xiaomiModelManagerOptions(config?: XiaomiModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
313
|
+
export interface LiteLLMModelManagerConfig {
|
|
314
|
+
apiKey?: string;
|
|
315
|
+
baseUrl?: string;
|
|
316
|
+
fetch?: FetchImpl;
|
|
317
|
+
}
|
|
318
|
+
export declare function litellmModelManagerOptions(config?: LiteLLMModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
319
|
+
export interface VllmModelManagerConfig {
|
|
320
|
+
apiKey?: string;
|
|
321
|
+
baseUrl?: string;
|
|
322
|
+
fetch?: FetchImpl;
|
|
323
|
+
}
|
|
324
|
+
export declare function vllmModelManagerOptions(config?: VllmModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
325
|
+
export interface NanoGptModelManagerConfig {
|
|
326
|
+
apiKey?: string;
|
|
327
|
+
baseUrl?: string;
|
|
328
|
+
fetch?: FetchImpl;
|
|
329
|
+
}
|
|
330
|
+
export declare function nanoGptModelManagerOptions(config?: NanoGptModelManagerConfig): ModelManagerOptions<"openai-completions">;
|
|
331
|
+
export interface GithubCopilotModelManagerConfig {
|
|
332
|
+
apiKey?: string;
|
|
333
|
+
baseUrl?: string;
|
|
334
|
+
fetch?: FetchImpl;
|
|
335
|
+
}
|
|
336
|
+
export declare function githubCopilotModelManagerOptions(config?: GithubCopilotModelManagerConfig): ModelManagerOptions<Api>;
|
|
337
|
+
export interface AnthropicModelManagerConfig {
|
|
338
|
+
apiKey?: string;
|
|
339
|
+
baseUrl?: string;
|
|
340
|
+
fetch?: FetchImpl;
|
|
341
|
+
}
|
|
342
|
+
export declare function anthropicModelManagerOptions(config?: AnthropicModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
|
|
343
|
+
export { UNK_CONTEXT_WINDOW, UNK_MAX_TOKENS } from "./discovery-constants";
|
|
344
|
+
/** Describes how to map models.dev API data for a single provider. */
|
|
345
|
+
export interface ModelsDevProviderDescriptor {
|
|
346
|
+
/** Key in the models.dev API response JSON (e.g., "anthropic", "amazon-bedrock") */
|
|
347
|
+
modelsDevKey: string;
|
|
348
|
+
/** Provider ID in our system */
|
|
349
|
+
providerId: string;
|
|
350
|
+
/** Default API type for this provider's models */
|
|
351
|
+
api: Api;
|
|
352
|
+
/** Default base URL */
|
|
353
|
+
baseUrl: string;
|
|
354
|
+
/** Default context window fallback (default: UNKNNOWN_CONTEXT_WINDOW) */
|
|
355
|
+
defaultContextWindow?: number;
|
|
356
|
+
/** Default max tokens fallback (default: UNKNNOWN_MAX_TOKENS) */
|
|
357
|
+
defaultMaxTokens?: number;
|
|
358
|
+
/** Optional compat overrides applied to every model from this provider */
|
|
359
|
+
compat?: ModelSpec<Api>["compat"];
|
|
360
|
+
/** Optional static headers applied to every model */
|
|
361
|
+
headers?: Record<string, string>;
|
|
362
|
+
/**
|
|
363
|
+
* Optional filter: return false to skip a model.
|
|
364
|
+
* Called with (modelId, rawModel). Default: skip if tool_call !== true.
|
|
365
|
+
*/
|
|
366
|
+
filterModel?: (modelId: string, model: ModelsDevModel) => boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Optional transform: modify the mapped model before it's added.
|
|
369
|
+
* Can return null to skip the model, or an array to emit multiple models.
|
|
370
|
+
*/
|
|
371
|
+
transformModel?: (model: ModelSpec<Api>, modelId: string, raw: ModelsDevModel) => ModelSpec<Api> | ModelSpec<Api>[] | null;
|
|
372
|
+
/**
|
|
373
|
+
* Optional: override the API type per-model.
|
|
374
|
+
* Called with (modelId, raw). Return the API type to use.
|
|
375
|
+
* If not provided, uses the `api` field.
|
|
376
|
+
*/
|
|
377
|
+
resolveApi?: (modelId: string, raw: ModelsDevModel) => {
|
|
378
|
+
api: Api;
|
|
379
|
+
baseUrl: string;
|
|
380
|
+
} | null;
|
|
381
|
+
}
|
|
382
|
+
/** Generic mapper that converts models.dev data using provider descriptors. */
|
|
383
|
+
export declare function mapModelsDevToModels(data: Record<string, unknown>, descriptors: readonly ModelsDevProviderDescriptor[]): ModelSpec<Api>[];
|
|
384
|
+
/** All provider descriptors for models.dev data mapping in generate-models.ts. */
|
|
385
|
+
export declare const MODELS_DEV_PROVIDER_DESCRIPTORS: readonly ModelsDevProviderDescriptor[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ModelManagerOptions } from "../model-manager";
|
|
2
|
+
export interface OpenAICodexModelManagerConfig {
|
|
3
|
+
accessToken?: string;
|
|
4
|
+
accountId?: string;
|
|
5
|
+
clientVersion?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function openaiCodexModelManagerOptions(config?: OpenAICodexModelManagerConfig): ModelManagerOptions<"openai-codex-responses">;
|
|
8
|
+
export interface CursorModelManagerConfig {
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
clientVersion?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function cursorModelManagerOptions(config?: CursorModelManagerConfig): ModelManagerOptions<"cursor-agent">;
|
|
14
|
+
export interface ZaiModelManagerConfig {
|
|
15
|
+
}
|
|
16
|
+
export declare function zaiModelManagerOptions(_config?: ZaiModelManagerConfig): ModelManagerOptions<"anthropic-messages">;
|