@theokit/sdk 5.9.0 → 5.9.2
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 +100 -0
- package/dist/{agent-6STOEBGQ.js → agent-GZVZXKME.js} +18 -17
- package/dist/{agent-6STOEBGQ.js.map → agent-GZVZXKME.js.map} +1 -1
- package/dist/{agent-ZM4FDDL7.cjs → agent-WQ4LLTSY.cjs} +19 -18
- package/dist/{agent-ZM4FDDL7.cjs.map → agent-WQ4LLTSY.cjs.map} +1 -1
- package/dist/agent-session-store-ODD3IZCW.js +6 -0
- package/dist/{agent-session-store-AFML3AXC.js.map → agent-session-store-ODD3IZCW.js.map} +1 -1
- package/dist/agent-session-store-SVEJHSUA.cjs +23 -0
- package/dist/{agent-session-store-MTSIY3MH.cjs.map → agent-session-store-SVEJHSUA.cjs.map} +1 -1
- package/dist/auth/index.cjs +8 -7
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.js +3 -2
- package/dist/auth/index.js.map +1 -1
- package/dist/{chunk-TC4RWP3Y.js → chunk-47Z6LP3I.js} +3 -3
- package/dist/{chunk-TC4RWP3Y.js.map → chunk-47Z6LP3I.js.map} +1 -1
- package/dist/{chunk-DDRX4LYS.js → chunk-7QJYKVP6.js} +3 -3
- package/dist/{chunk-DDRX4LYS.js.map → chunk-7QJYKVP6.js.map} +1 -1
- package/dist/{chunk-TTBIQTO5.cjs → chunk-DLUCTZ56.cjs} +15 -15
- package/dist/{chunk-TTBIQTO5.cjs.map → chunk-DLUCTZ56.cjs.map} +1 -1
- package/dist/chunk-EHD25JBZ.cjs +10 -0
- package/dist/chunk-EHD25JBZ.cjs.map +1 -0
- package/dist/{chunk-NOO6GZTZ.js → chunk-EVH3OUMY.js} +13 -12
- package/dist/chunk-EVH3OUMY.js.map +1 -0
- package/dist/{chunk-5522X223.js → chunk-EXI7EHDN.js} +4 -4
- package/dist/{chunk-5522X223.js.map → chunk-EXI7EHDN.js.map} +1 -1
- package/dist/{chunk-PSLCVSCS.cjs → chunk-FR6COQXZ.cjs} +6 -6
- package/dist/{chunk-PSLCVSCS.cjs.map → chunk-FR6COQXZ.cjs.map} +1 -1
- package/dist/{chunk-JOFVLOFY.js → chunk-FTZTZBCU.js} +12 -4
- package/dist/chunk-FTZTZBCU.js.map +1 -0
- package/dist/{chunk-HOHR75KF.js → chunk-HI3W37FY.js} +4 -3
- package/dist/chunk-HI3W37FY.js.map +1 -0
- package/dist/chunk-HU666T3Q.cjs +1891 -0
- package/dist/chunk-HU666T3Q.cjs.map +1 -0
- package/dist/{chunk-53RDNK3H.js → chunk-I2ORT6QD.js} +3 -3
- package/dist/{chunk-53RDNK3H.js.map → chunk-I2ORT6QD.js.map} +1 -1
- package/dist/{chunk-BM6PDJW3.cjs → chunk-JU76WCW7.cjs} +113 -112
- package/dist/chunk-JU76WCW7.cjs.map +1 -0
- package/dist/{chunk-J4SA2ZEJ.cjs → chunk-KIKKTW5O.cjs} +4 -4
- package/dist/{chunk-J4SA2ZEJ.cjs.map → chunk-KIKKTW5O.cjs.map} +1 -1
- package/dist/{chunk-5WR33BHA.cjs → chunk-KXKT3HSD.cjs} +4 -4
- package/dist/{chunk-5WR33BHA.cjs.map → chunk-KXKT3HSD.cjs.map} +1 -1
- package/dist/{chunk-UKBBYVNS.js → chunk-M2CCHC66.js} +3 -3
- package/dist/{chunk-UKBBYVNS.js.map → chunk-M2CCHC66.js.map} +1 -1
- package/dist/{chunk-OCEQ6DW2.cjs → chunk-N6OEX5TN.cjs} +2 -2
- package/dist/chunk-N6OEX5TN.cjs.map +1 -0
- package/dist/{chunk-QDQQYRJI.js → chunk-N7KYUNFO.js} +3 -3
- package/dist/{chunk-QDQQYRJI.js.map → chunk-N7KYUNFO.js.map} +1 -1
- package/dist/{chunk-7GDHFV2M.js → chunk-OPAKPEPG.js} +2 -2
- package/dist/chunk-OPAKPEPG.js.map +1 -0
- package/dist/{chunk-UNZOJVVC.js → chunk-OZLQ6ZFM.js} +3 -3
- package/dist/{chunk-UNZOJVVC.js.map → chunk-OZLQ6ZFM.js.map} +1 -1
- package/dist/{chunk-PYFBS6OQ.js → chunk-PEIV7LOU.js} +22 -21
- package/dist/chunk-PEIV7LOU.js.map +1 -0
- package/dist/chunk-Q7GYMXVC.js +8 -0
- package/dist/chunk-Q7GYMXVC.js.map +1 -0
- package/dist/{chunk-ARMFXTY6.cjs → chunk-QY3CIMUV.cjs} +34 -33
- package/dist/chunk-QY3CIMUV.cjs.map +1 -0
- package/dist/{chunk-B3XXQX6L.cjs → chunk-RX3CFWQ2.cjs} +6 -6
- package/dist/{chunk-B3XXQX6L.cjs.map → chunk-RX3CFWQ2.cjs.map} +1 -1
- package/dist/chunk-SGC7LSHF.cjs +18 -0
- package/dist/{chunk-R3ZQBPA5.cjs.map → chunk-SGC7LSHF.cjs.map} +1 -1
- package/dist/{chunk-RA7IE4NK.cjs → chunk-SKDNCTXG.cjs} +4 -3
- package/dist/chunk-SKDNCTXG.cjs.map +1 -0
- package/dist/chunk-SVCPJRUB.js +1874 -0
- package/dist/chunk-SVCPJRUB.js.map +1 -0
- package/dist/{chunk-EJROML3Q.js → chunk-TX56N7FR.js} +4 -3
- package/dist/chunk-TX56N7FR.js.map +1 -0
- package/dist/{chunk-76PIKR4P.cjs → chunk-VZ2JZ2EH.cjs} +5 -5
- package/dist/{chunk-76PIKR4P.cjs.map → chunk-VZ2JZ2EH.cjs.map} +1 -1
- package/dist/{chunk-T5KOSR5Y.cjs → chunk-X7Z2FEI7.cjs} +8 -8
- package/dist/{chunk-T5KOSR5Y.cjs.map → chunk-X7Z2FEI7.cjs.map} +1 -1
- package/dist/{chunk-2WXHA33T.js → chunk-XERM7PDQ.js} +3 -3
- package/dist/{chunk-2WXHA33T.js.map → chunk-XERM7PDQ.js.map} +1 -1
- package/dist/{chunk-KTA7YTZQ.cjs → chunk-XKZFIP7Z.cjs} +4 -4
- package/dist/{chunk-KTA7YTZQ.cjs.map → chunk-XKZFIP7Z.cjs.map} +1 -1
- package/dist/{chunk-MEUBLCM4.cjs → chunk-YEHQ3SIC.cjs} +4 -3
- package/dist/chunk-YEHQ3SIC.cjs.map +1 -0
- package/dist/{chunk-YIFFF23U.cjs → chunk-ZAM7BJXJ.cjs} +5 -5
- package/dist/{chunk-YIFFF23U.cjs.map → chunk-ZAM7BJXJ.cjs.map} +1 -1
- package/dist/{chunk-R2C3HXR3.js → chunk-ZDF2IJKC.js} +3 -3
- package/dist/{chunk-R2C3HXR3.js.map → chunk-ZDF2IJKC.js.map} +1 -1
- package/dist/{chunk-PQCTDMUI.js → chunk-ZHWKT2NI.js} +3 -3
- package/dist/{chunk-PQCTDMUI.js.map → chunk-ZHWKT2NI.js.map} +1 -1
- package/dist/{chunk-GZV6AVRL.cjs → chunk-ZWACQM5U.cjs} +11 -3
- package/dist/chunk-ZWACQM5U.cjs.map +1 -0
- package/dist/{compact-session-RBPLUPCK.cjs → compact-session-4QHBBGEY.cjs} +16 -15
- package/dist/{compact-session-RBPLUPCK.cjs.map → compact-session-4QHBBGEY.cjs.map} +1 -1
- package/dist/{compact-session-2N3ZYJTW.js → compact-session-PVAWTKKL.js} +7 -6
- package/dist/{compact-session-2N3ZYJTW.js.map → compact-session-PVAWTKKL.js.map} +1 -1
- package/dist/context/index.cjs +6 -6
- package/dist/context/index.js +3 -3
- package/dist/context-3FZRAO5K.js +7 -0
- package/dist/{context-SXR2HLHT.js.map → context-3FZRAO5K.js.map} +1 -1
- package/dist/{context-ZOULM2RB.cjs → context-B5J4GX2F.cjs} +7 -7
- package/dist/{context-ZOULM2RB.cjs.map → context-B5J4GX2F.cjs.map} +1 -1
- package/dist/cron.cjs +18 -17
- package/dist/cron.js +17 -16
- package/dist/eval.cjs +17 -16
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +16 -15
- package/dist/eval.js.map +1 -1
- package/dist/fs-session-store-LCZBM3LT.js +10 -0
- package/dist/{fs-session-store-STZZFXH2.js.map → fs-session-store-LCZBM3LT.js.map} +1 -1
- package/dist/{fs-session-store-JHBJFKVV.cjs → fs-session-store-SVEMRE4K.cjs} +5 -5
- package/dist/{fs-session-store-JHBJFKVV.cjs.map → fs-session-store-SVEMRE4K.cjs.map} +1 -1
- package/dist/{index-manager-ONQJSWX5.js → index-manager-6B2UF5S3.js} +5 -5
- package/dist/{index-manager-ONQJSWX5.js.map → index-manager-6B2UF5S3.js.map} +1 -1
- package/dist/{index-manager-ZGJN25FD.cjs → index-manager-M3FHJCHQ.cjs} +6 -6
- package/dist/{index-manager-ZGJN25FD.cjs.map → index-manager-M3FHJCHQ.cjs.map} +1 -1
- package/dist/index.cjs +58 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -3
- package/dist/index.d.ts +30 -3
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-YNNOE3O6.js → inject-session-O24XGRR6.js} +5 -5
- package/dist/{inject-session-YNNOE3O6.js.map → inject-session-O24XGRR6.js.map} +1 -1
- package/dist/{inject-session-3FPXJDJP.cjs → inject-session-OMLFL2V3.cjs} +7 -7
- package/dist/{inject-session-3FPXJDJP.cjs.map → inject-session-OMLFL2V3.cjs.map} +1 -1
- package/dist/internal/memory/adapters/index.cjs +3 -2
- package/dist/internal/memory/adapters/index.js +2 -1
- package/dist/internal/memory/storage/index.cjs +32 -32
- package/dist/internal/memory/storage/index.js +3 -3
- package/dist/internal/persistence/persistence-schema.d.cts +1 -1
- package/dist/internal/persistence/persistence-schema.d.ts +1 -1
- package/dist/internal/providers/catalog-loader.d.ts +30 -3
- package/dist/internal/runtime/hooks/hooks-source.d.ts +24 -0
- package/dist/internal/runtime-fetch.d.ts +1 -0
- package/dist/models.cjs +12 -11
- package/dist/models.cjs.map +1 -1
- package/dist/models.js +4 -3
- package/dist/models.js.map +1 -1
- package/dist/persistence.cjs +7 -7
- package/dist/persistence.js +2 -2
- package/dist/providers.cjs +6 -5
- package/dist/providers.js +4 -3
- package/dist/{session-transcript-VTBTCGQX.js → session-transcript-AR7IBICT.js} +3 -3
- package/dist/{session-transcript-VTBTCGQX.js.map → session-transcript-AR7IBICT.js.map} +1 -1
- package/dist/{session-transcript-LGHSNVY5.cjs → session-transcript-RACG7BK2.cjs} +16 -16
- package/dist/{session-transcript-LGHSNVY5.cjs.map → session-transcript-RACG7BK2.cjs.map} +1 -1
- package/dist/subscription/index.cjs +2 -1
- package/dist/subscription/index.cjs.map +1 -1
- package/dist/subscription/index.js +2 -1
- package/dist/subscription/index.js.map +1 -1
- package/docs/error-codes.md +16 -16
- package/package.json +2 -2
- package/dist/agent-session-store-AFML3AXC.js +0 -6
- package/dist/agent-session-store-MTSIY3MH.cjs +0 -23
- package/dist/chunk-7GDHFV2M.js.map +0 -1
- package/dist/chunk-ARMFXTY6.cjs.map +0 -1
- package/dist/chunk-BM6PDJW3.cjs.map +0 -1
- package/dist/chunk-EJROML3Q.js.map +0 -1
- package/dist/chunk-GZV6AVRL.cjs.map +0 -1
- package/dist/chunk-HOHR75KF.js.map +0 -1
- package/dist/chunk-JOFVLOFY.js.map +0 -1
- package/dist/chunk-MEUBLCM4.cjs.map +0 -1
- package/dist/chunk-MFZODA5Y.js +0 -583
- package/dist/chunk-MFZODA5Y.js.map +0 -1
- package/dist/chunk-NOO6GZTZ.js.map +0 -1
- package/dist/chunk-OCEQ6DW2.cjs.map +0 -1
- package/dist/chunk-PYFBS6OQ.js.map +0 -1
- package/dist/chunk-R3ZQBPA5.cjs +0 -18
- package/dist/chunk-RA7IE4NK.cjs.map +0 -1
- package/dist/chunk-YRJA2POB.cjs +0 -601
- package/dist/chunk-YRJA2POB.cjs.map +0 -1
- package/dist/context-SXR2HLHT.js +0 -7
- package/dist/fs-session-store-STZZFXH2.js +0 -10
- package/dist/provider-catalog.json +0 -1295
|
@@ -0,0 +1,1874 @@
|
|
|
1
|
+
import { globalSingleton } from './chunk-AGACYRJ2.js';
|
|
2
|
+
import { resolveCredential } from './chunk-TX56N7FR.js';
|
|
3
|
+
import { readStoredOAuth } from './chunk-5Q4RTLMP.js';
|
|
4
|
+
import { AuthenticationError } from './chunk-B5MHRQJZ.js';
|
|
5
|
+
import { diag } from './chunk-CZJ6Q7CW.js';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { homedir } from 'os';
|
|
8
|
+
|
|
9
|
+
// src/internal/providers/registry.ts
|
|
10
|
+
var REGISTRY = globalSingleton(
|
|
11
|
+
"theokit-sdk.providers.registry",
|
|
12
|
+
() => /* @__PURE__ */ new Map()
|
|
13
|
+
);
|
|
14
|
+
var ALIASES = globalSingleton("theokit-sdk.providers.aliases", () => /* @__PURE__ */ new Map());
|
|
15
|
+
function registerProvider(profile) {
|
|
16
|
+
if (REGISTRY.has(profile.name)) {
|
|
17
|
+
diag(`[theokit-sdk] Provider "${profile.name}" overridden by user plugin.
|
|
18
|
+
`);
|
|
19
|
+
}
|
|
20
|
+
REGISTRY.set(profile.name, profile);
|
|
21
|
+
for (const alias of profile.aliases ?? []) {
|
|
22
|
+
const previous = ALIASES.get(alias);
|
|
23
|
+
if (previous !== void 0 && previous !== profile.name) {
|
|
24
|
+
diag(`[theokit-sdk] Alias "${alias}" collision: was "${previous}", now "${profile.name}".
|
|
25
|
+
`);
|
|
26
|
+
}
|
|
27
|
+
ALIASES.set(alias, profile.name);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function getProviderProfile(name) {
|
|
31
|
+
const canonical = ALIASES.get(name) ?? name;
|
|
32
|
+
return REGISTRY.get(canonical);
|
|
33
|
+
}
|
|
34
|
+
function listProviders() {
|
|
35
|
+
return Array.from(REGISTRY.values());
|
|
36
|
+
}
|
|
37
|
+
var MODALITIES = ["text", "audio", "image", "video", "pdf"];
|
|
38
|
+
var costSchema = z.object({
|
|
39
|
+
/** USD per 1M tokens (models.dev convention). */
|
|
40
|
+
input: z.number().nonnegative(),
|
|
41
|
+
output: z.number().nonnegative(),
|
|
42
|
+
cache_read: z.number().nonnegative().optional(),
|
|
43
|
+
cache_write: z.number().nonnegative().optional()
|
|
44
|
+
}).loose();
|
|
45
|
+
var limitSchema = z.object({
|
|
46
|
+
context: z.number().positive(),
|
|
47
|
+
input: z.number().positive().optional(),
|
|
48
|
+
output: z.number().positive().optional()
|
|
49
|
+
}).loose();
|
|
50
|
+
var modalitiesSchema = z.object({
|
|
51
|
+
input: z.array(z.enum(MODALITIES)).optional(),
|
|
52
|
+
output: z.array(z.enum(MODALITIES)).optional()
|
|
53
|
+
}).loose();
|
|
54
|
+
var catalogModelSchema = z.object({
|
|
55
|
+
name: z.string().optional(),
|
|
56
|
+
release_date: z.string().optional(),
|
|
57
|
+
attachment: z.boolean().optional(),
|
|
58
|
+
reasoning: z.boolean().optional(),
|
|
59
|
+
temperature: z.boolean().optional(),
|
|
60
|
+
tool_call: z.boolean().optional(),
|
|
61
|
+
/** theokit extension — maps to ModelCapabilities.supportsStructuredOutput. */
|
|
62
|
+
structured_output: z.boolean().optional(),
|
|
63
|
+
/** theokit extension — maps to ModelCapabilities.supportsCacheControl. */
|
|
64
|
+
cache_control: z.boolean().optional(),
|
|
65
|
+
cost: costSchema.optional(),
|
|
66
|
+
limit: limitSchema.optional(),
|
|
67
|
+
modalities: modalitiesSchema.optional(),
|
|
68
|
+
status: z.enum(["alpha", "beta", "deprecated"]).optional()
|
|
69
|
+
}).loose();
|
|
70
|
+
var catalogEntrySchema = z.object({
|
|
71
|
+
id: z.string().min(1),
|
|
72
|
+
displayName: z.string().min(1),
|
|
73
|
+
apiMode: z.enum([
|
|
74
|
+
"chat_completions",
|
|
75
|
+
"anthropic_messages",
|
|
76
|
+
"responses_api",
|
|
77
|
+
"bedrock",
|
|
78
|
+
"bedrock_anthropic"
|
|
79
|
+
]),
|
|
80
|
+
authType: z.enum([
|
|
81
|
+
"api_key",
|
|
82
|
+
"oauth_device_code",
|
|
83
|
+
"oauth_external",
|
|
84
|
+
"aws_sdk",
|
|
85
|
+
"aws_bearer",
|
|
86
|
+
"gcp_oauth",
|
|
87
|
+
"none"
|
|
88
|
+
]),
|
|
89
|
+
baseUrl: z.string(),
|
|
90
|
+
envVars: z.array(z.string()),
|
|
91
|
+
fallbackModels: z.array(z.string()),
|
|
92
|
+
capabilities: z.object({
|
|
93
|
+
supportsToolUse: z.boolean(),
|
|
94
|
+
supportsVision: z.boolean(),
|
|
95
|
+
supportsStructuredOutput: z.boolean(),
|
|
96
|
+
supportsStreaming: z.boolean(),
|
|
97
|
+
supportsCacheControl: z.boolean(),
|
|
98
|
+
maxContextTokens: z.number().int().positive().optional(),
|
|
99
|
+
maxOutputTokens: z.number().int().positive().optional()
|
|
100
|
+
}),
|
|
101
|
+
aliases: z.array(z.string()).optional(),
|
|
102
|
+
modelsUrl: z.string().optional(),
|
|
103
|
+
hostname: z.string().optional(),
|
|
104
|
+
extraHeaders: z.record(z.string(), z.string()).optional(),
|
|
105
|
+
models: z.record(z.string(), catalogModelSchema).optional()
|
|
106
|
+
}).loose();
|
|
107
|
+
|
|
108
|
+
// src/internal/providers/provider-catalog.json
|
|
109
|
+
var provider_catalog_default = [
|
|
110
|
+
{
|
|
111
|
+
id: "openai",
|
|
112
|
+
displayName: "OpenAI",
|
|
113
|
+
apiMode: "chat_completions",
|
|
114
|
+
authType: "api_key",
|
|
115
|
+
baseUrl: "https://api.openai.com/v1",
|
|
116
|
+
envVars: ["OPENAI_API_KEY"],
|
|
117
|
+
fallbackModels: ["gpt-4o-mini", "gpt-4o"],
|
|
118
|
+
capabilities: {
|
|
119
|
+
supportsToolUse: true,
|
|
120
|
+
supportsVision: true,
|
|
121
|
+
supportsStructuredOutput: true,
|
|
122
|
+
supportsStreaming: true,
|
|
123
|
+
supportsCacheControl: false
|
|
124
|
+
},
|
|
125
|
+
aliases: ["openai", "openai-chatgpt"],
|
|
126
|
+
models: {
|
|
127
|
+
"gpt-4o-mini": {
|
|
128
|
+
name: "GPT-4o mini",
|
|
129
|
+
release_date: "2024-07-18",
|
|
130
|
+
attachment: true,
|
|
131
|
+
reasoning: false,
|
|
132
|
+
temperature: true,
|
|
133
|
+
tool_call: true,
|
|
134
|
+
structured_output: true,
|
|
135
|
+
cost: {
|
|
136
|
+
input: 0.15,
|
|
137
|
+
output: 0.6,
|
|
138
|
+
cache_read: 0.075
|
|
139
|
+
},
|
|
140
|
+
limit: {
|
|
141
|
+
context: 128e3,
|
|
142
|
+
output: 16384
|
|
143
|
+
},
|
|
144
|
+
modalities: {
|
|
145
|
+
input: ["text", "image"],
|
|
146
|
+
output: ["text"]
|
|
147
|
+
},
|
|
148
|
+
cache_control: false
|
|
149
|
+
},
|
|
150
|
+
"gpt-4o": {
|
|
151
|
+
name: "GPT-4o",
|
|
152
|
+
release_date: "2024-05-13",
|
|
153
|
+
attachment: true,
|
|
154
|
+
reasoning: false,
|
|
155
|
+
temperature: true,
|
|
156
|
+
tool_call: true,
|
|
157
|
+
structured_output: true,
|
|
158
|
+
cost: {
|
|
159
|
+
input: 2.5,
|
|
160
|
+
output: 10,
|
|
161
|
+
cache_read: 1.25
|
|
162
|
+
},
|
|
163
|
+
limit: {
|
|
164
|
+
context: 128e3,
|
|
165
|
+
output: 16384
|
|
166
|
+
},
|
|
167
|
+
modalities: {
|
|
168
|
+
input: ["text", "image"],
|
|
169
|
+
output: ["text"]
|
|
170
|
+
},
|
|
171
|
+
cache_control: false
|
|
172
|
+
},
|
|
173
|
+
"gpt-4-turbo": {
|
|
174
|
+
name: "GPT-4 Turbo",
|
|
175
|
+
release_date: "2023-11-06",
|
|
176
|
+
attachment: true,
|
|
177
|
+
reasoning: false,
|
|
178
|
+
temperature: true,
|
|
179
|
+
tool_call: true,
|
|
180
|
+
structured_output: false,
|
|
181
|
+
cost: {
|
|
182
|
+
input: 10,
|
|
183
|
+
output: 30
|
|
184
|
+
},
|
|
185
|
+
limit: {
|
|
186
|
+
context: 128e3,
|
|
187
|
+
output: 4096
|
|
188
|
+
},
|
|
189
|
+
modalities: {
|
|
190
|
+
input: ["text", "image"],
|
|
191
|
+
output: ["text"]
|
|
192
|
+
},
|
|
193
|
+
cache_control: false
|
|
194
|
+
},
|
|
195
|
+
o1: {
|
|
196
|
+
name: "o1",
|
|
197
|
+
release_date: "2024-12-05",
|
|
198
|
+
attachment: true,
|
|
199
|
+
reasoning: true,
|
|
200
|
+
temperature: false,
|
|
201
|
+
tool_call: true,
|
|
202
|
+
structured_output: true,
|
|
203
|
+
cost: {
|
|
204
|
+
input: 15,
|
|
205
|
+
output: 60,
|
|
206
|
+
cache_read: 7.5
|
|
207
|
+
},
|
|
208
|
+
limit: {
|
|
209
|
+
context: 2e5,
|
|
210
|
+
output: 1e5
|
|
211
|
+
},
|
|
212
|
+
modalities: {
|
|
213
|
+
input: ["text"],
|
|
214
|
+
output: ["text"]
|
|
215
|
+
},
|
|
216
|
+
cache_control: false
|
|
217
|
+
},
|
|
218
|
+
o3: {
|
|
219
|
+
name: "o3",
|
|
220
|
+
release_date: "2025-04-16",
|
|
221
|
+
attachment: true,
|
|
222
|
+
reasoning: true,
|
|
223
|
+
temperature: false,
|
|
224
|
+
tool_call: true,
|
|
225
|
+
structured_output: true,
|
|
226
|
+
cost: {
|
|
227
|
+
input: 2,
|
|
228
|
+
output: 8,
|
|
229
|
+
cache_read: 0.5
|
|
230
|
+
},
|
|
231
|
+
limit: {
|
|
232
|
+
context: 2e5,
|
|
233
|
+
output: 1e5
|
|
234
|
+
},
|
|
235
|
+
modalities: {
|
|
236
|
+
input: ["text"],
|
|
237
|
+
output: ["text"]
|
|
238
|
+
},
|
|
239
|
+
cache_control: false
|
|
240
|
+
},
|
|
241
|
+
"gpt-4.1": {
|
|
242
|
+
name: "GPT-4.1",
|
|
243
|
+
release_date: "2025-04-14",
|
|
244
|
+
attachment: true,
|
|
245
|
+
reasoning: false,
|
|
246
|
+
temperature: true,
|
|
247
|
+
tool_call: true,
|
|
248
|
+
structured_output: true,
|
|
249
|
+
cost: {
|
|
250
|
+
input: 2,
|
|
251
|
+
output: 8,
|
|
252
|
+
cache_read: 0.5
|
|
253
|
+
},
|
|
254
|
+
limit: {
|
|
255
|
+
context: 1047576,
|
|
256
|
+
output: 32768
|
|
257
|
+
},
|
|
258
|
+
modalities: {
|
|
259
|
+
input: ["text", "image"],
|
|
260
|
+
output: ["text"]
|
|
261
|
+
},
|
|
262
|
+
cache_control: false
|
|
263
|
+
},
|
|
264
|
+
"gpt-5.4": {
|
|
265
|
+
limit: {
|
|
266
|
+
context: 4e5,
|
|
267
|
+
output: 128e3
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"gpt-5.4-mini": {
|
|
271
|
+
limit: {
|
|
272
|
+
context: 4e5,
|
|
273
|
+
output: 128e3
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"gpt-5.3": {
|
|
277
|
+
limit: {
|
|
278
|
+
context: 4e5,
|
|
279
|
+
output: 128e3
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"gpt-5.2": {
|
|
283
|
+
limit: {
|
|
284
|
+
context: 4e5,
|
|
285
|
+
output: 128e3
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: "anthropic",
|
|
292
|
+
displayName: "Anthropic",
|
|
293
|
+
apiMode: "anthropic_messages",
|
|
294
|
+
authType: "api_key",
|
|
295
|
+
baseUrl: "https://api.anthropic.com/v1",
|
|
296
|
+
envVars: ["ANTHROPIC_API_KEY"],
|
|
297
|
+
fallbackModels: ["claude-sonnet-4-20250514", "claude-3-5-haiku-latest"],
|
|
298
|
+
capabilities: {
|
|
299
|
+
supportsToolUse: true,
|
|
300
|
+
supportsVision: true,
|
|
301
|
+
supportsStructuredOutput: false,
|
|
302
|
+
supportsStreaming: true,
|
|
303
|
+
supportsCacheControl: true
|
|
304
|
+
},
|
|
305
|
+
aliases: ["anthropic"],
|
|
306
|
+
models: {
|
|
307
|
+
"claude-3-5-haiku-latest": {
|
|
308
|
+
tool_call: true,
|
|
309
|
+
structured_output: false,
|
|
310
|
+
cache_control: true,
|
|
311
|
+
modalities: {
|
|
312
|
+
input: ["text"]
|
|
313
|
+
},
|
|
314
|
+
limit: {
|
|
315
|
+
context: 2e5,
|
|
316
|
+
output: 8192
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"claude-opus-4-7": {
|
|
320
|
+
name: "Claude Opus 4.7",
|
|
321
|
+
release_date: "2026-04-14",
|
|
322
|
+
attachment: true,
|
|
323
|
+
reasoning: true,
|
|
324
|
+
temperature: false,
|
|
325
|
+
tool_call: true,
|
|
326
|
+
structured_output: true,
|
|
327
|
+
cost: {
|
|
328
|
+
input: 5,
|
|
329
|
+
output: 25,
|
|
330
|
+
cache_read: 0.5,
|
|
331
|
+
cache_write: 6.25
|
|
332
|
+
},
|
|
333
|
+
limit: {
|
|
334
|
+
context: 1e6,
|
|
335
|
+
output: 128e3
|
|
336
|
+
},
|
|
337
|
+
modalities: {
|
|
338
|
+
input: ["text", "image", "pdf"],
|
|
339
|
+
output: ["text"]
|
|
340
|
+
},
|
|
341
|
+
cache_control: true
|
|
342
|
+
},
|
|
343
|
+
"claude-sonnet-4-6": {
|
|
344
|
+
name: "Claude Sonnet 4.6",
|
|
345
|
+
release_date: "2026-02-17",
|
|
346
|
+
attachment: true,
|
|
347
|
+
reasoning: true,
|
|
348
|
+
temperature: true,
|
|
349
|
+
tool_call: true,
|
|
350
|
+
structured_output: true,
|
|
351
|
+
cost: {
|
|
352
|
+
input: 3,
|
|
353
|
+
output: 15,
|
|
354
|
+
cache_read: 0.3,
|
|
355
|
+
cache_write: 3.75
|
|
356
|
+
},
|
|
357
|
+
limit: {
|
|
358
|
+
context: 1e6,
|
|
359
|
+
output: 128e3
|
|
360
|
+
},
|
|
361
|
+
modalities: {
|
|
362
|
+
input: ["text", "image", "pdf"],
|
|
363
|
+
output: ["text"]
|
|
364
|
+
},
|
|
365
|
+
cache_control: true
|
|
366
|
+
},
|
|
367
|
+
"claude-haiku-4-5-20251001": {
|
|
368
|
+
name: "Claude Haiku 4.5",
|
|
369
|
+
release_date: "2025-10-15",
|
|
370
|
+
attachment: true,
|
|
371
|
+
reasoning: true,
|
|
372
|
+
temperature: true,
|
|
373
|
+
tool_call: true,
|
|
374
|
+
structured_output: true,
|
|
375
|
+
cost: {
|
|
376
|
+
input: 1,
|
|
377
|
+
output: 5,
|
|
378
|
+
cache_read: 0.1,
|
|
379
|
+
cache_write: 1.25
|
|
380
|
+
},
|
|
381
|
+
limit: {
|
|
382
|
+
context: 2e5,
|
|
383
|
+
output: 64e3
|
|
384
|
+
},
|
|
385
|
+
modalities: {
|
|
386
|
+
input: ["text", "image", "pdf"],
|
|
387
|
+
output: ["text"]
|
|
388
|
+
},
|
|
389
|
+
cache_control: true
|
|
390
|
+
},
|
|
391
|
+
"claude-opus-4": {
|
|
392
|
+
tool_call: true,
|
|
393
|
+
structured_output: false,
|
|
394
|
+
cache_control: true,
|
|
395
|
+
modalities: {
|
|
396
|
+
input: ["text", "image"]
|
|
397
|
+
},
|
|
398
|
+
limit: {
|
|
399
|
+
context: 2e5,
|
|
400
|
+
output: 32e3
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
"claude-sonnet-4": {
|
|
404
|
+
tool_call: true,
|
|
405
|
+
structured_output: false,
|
|
406
|
+
cache_control: true,
|
|
407
|
+
modalities: {
|
|
408
|
+
input: ["text", "image"]
|
|
409
|
+
},
|
|
410
|
+
limit: {
|
|
411
|
+
context: 2e5,
|
|
412
|
+
output: 16e3
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"claude-3-5-sonnet": {
|
|
416
|
+
tool_call: true,
|
|
417
|
+
structured_output: false,
|
|
418
|
+
cache_control: true,
|
|
419
|
+
modalities: {
|
|
420
|
+
input: ["text", "image"]
|
|
421
|
+
},
|
|
422
|
+
limit: {
|
|
423
|
+
context: 2e5,
|
|
424
|
+
output: 8192
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
"claude-3-5-sonnet-latest": {
|
|
428
|
+
tool_call: true,
|
|
429
|
+
structured_output: false,
|
|
430
|
+
cache_control: true,
|
|
431
|
+
modalities: {
|
|
432
|
+
input: ["text", "image"]
|
|
433
|
+
},
|
|
434
|
+
limit: {
|
|
435
|
+
context: 2e5,
|
|
436
|
+
output: 8192
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
"claude-3-haiku": {
|
|
440
|
+
tool_call: true,
|
|
441
|
+
structured_output: false,
|
|
442
|
+
cache_control: true,
|
|
443
|
+
modalities: {
|
|
444
|
+
input: ["text", "image"]
|
|
445
|
+
},
|
|
446
|
+
limit: {
|
|
447
|
+
context: 2e5,
|
|
448
|
+
output: 4096
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"claude-3-opus": {
|
|
452
|
+
tool_call: true,
|
|
453
|
+
structured_output: false,
|
|
454
|
+
cache_control: true,
|
|
455
|
+
modalities: {
|
|
456
|
+
input: ["text", "image"]
|
|
457
|
+
},
|
|
458
|
+
limit: {
|
|
459
|
+
context: 2e5,
|
|
460
|
+
output: 4096
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
"claude-opus-4.1": {
|
|
464
|
+
tool_call: true,
|
|
465
|
+
structured_output: false,
|
|
466
|
+
cache_control: true,
|
|
467
|
+
modalities: {
|
|
468
|
+
input: ["text", "image"]
|
|
469
|
+
},
|
|
470
|
+
limit: {
|
|
471
|
+
context: 2e5,
|
|
472
|
+
output: 32e3
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
"claude-sonnet-4.5": {
|
|
476
|
+
tool_call: true,
|
|
477
|
+
structured_output: false,
|
|
478
|
+
cache_control: true,
|
|
479
|
+
modalities: {
|
|
480
|
+
input: ["text", "image"]
|
|
481
|
+
},
|
|
482
|
+
limit: {
|
|
483
|
+
context: 2e5,
|
|
484
|
+
output: 16e3
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
"claude-3.5-sonnet": {
|
|
488
|
+
tool_call: true,
|
|
489
|
+
structured_output: false,
|
|
490
|
+
cache_control: true,
|
|
491
|
+
modalities: {
|
|
492
|
+
input: ["text", "image"]
|
|
493
|
+
},
|
|
494
|
+
limit: {
|
|
495
|
+
context: 2e5,
|
|
496
|
+
output: 8192
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
id: "openrouter",
|
|
503
|
+
displayName: "OpenRouter",
|
|
504
|
+
apiMode: "chat_completions",
|
|
505
|
+
authType: "api_key",
|
|
506
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
507
|
+
envVars: ["OPENROUTER_API_KEY"],
|
|
508
|
+
fallbackModels: ["openai/gpt-4o-mini"],
|
|
509
|
+
capabilities: {
|
|
510
|
+
supportsToolUse: true,
|
|
511
|
+
supportsVision: true,
|
|
512
|
+
supportsStructuredOutput: true,
|
|
513
|
+
supportsStreaming: true,
|
|
514
|
+
supportsCacheControl: false
|
|
515
|
+
},
|
|
516
|
+
aliases: ["openrouter"]
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
id: "groq",
|
|
520
|
+
displayName: "Groq",
|
|
521
|
+
apiMode: "chat_completions",
|
|
522
|
+
authType: "api_key",
|
|
523
|
+
baseUrl: "https://api.groq.com/openai/v1",
|
|
524
|
+
envVars: ["GROQ_API_KEY"],
|
|
525
|
+
fallbackModels: ["llama-3.3-70b-versatile"],
|
|
526
|
+
capabilities: {
|
|
527
|
+
supportsToolUse: true,
|
|
528
|
+
supportsVision: true,
|
|
529
|
+
supportsStructuredOutput: true,
|
|
530
|
+
supportsStreaming: true,
|
|
531
|
+
supportsCacheControl: false
|
|
532
|
+
},
|
|
533
|
+
models: {
|
|
534
|
+
"llama-3.3-70b-versatile": {
|
|
535
|
+
name: "Llama 3.3 70B",
|
|
536
|
+
release_date: "2024-12-06",
|
|
537
|
+
attachment: false,
|
|
538
|
+
reasoning: false,
|
|
539
|
+
temperature: true,
|
|
540
|
+
tool_call: true,
|
|
541
|
+
cost: {
|
|
542
|
+
input: 0.59,
|
|
543
|
+
output: 0.79
|
|
544
|
+
},
|
|
545
|
+
limit: {
|
|
546
|
+
context: 131072,
|
|
547
|
+
output: 32768
|
|
548
|
+
},
|
|
549
|
+
modalities: {
|
|
550
|
+
input: ["text"],
|
|
551
|
+
output: ["text"]
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
id: "mistral",
|
|
558
|
+
displayName: "Mistral AI",
|
|
559
|
+
apiMode: "chat_completions",
|
|
560
|
+
authType: "api_key",
|
|
561
|
+
baseUrl: "https://api.mistral.ai/v1",
|
|
562
|
+
envVars: ["MISTRAL_API_KEY"],
|
|
563
|
+
fallbackModels: ["mistral-large-latest"],
|
|
564
|
+
capabilities: {
|
|
565
|
+
supportsToolUse: true,
|
|
566
|
+
supportsVision: true,
|
|
567
|
+
supportsStructuredOutput: true,
|
|
568
|
+
supportsStreaming: true,
|
|
569
|
+
supportsCacheControl: false
|
|
570
|
+
},
|
|
571
|
+
models: {
|
|
572
|
+
"mistral-large-latest": {
|
|
573
|
+
name: "Mistral Large (latest)",
|
|
574
|
+
release_date: "2024-11-01",
|
|
575
|
+
attachment: true,
|
|
576
|
+
reasoning: false,
|
|
577
|
+
temperature: true,
|
|
578
|
+
tool_call: true,
|
|
579
|
+
cost: {
|
|
580
|
+
input: 0.5,
|
|
581
|
+
output: 1.5
|
|
582
|
+
},
|
|
583
|
+
limit: {
|
|
584
|
+
context: 262144,
|
|
585
|
+
output: 262144
|
|
586
|
+
},
|
|
587
|
+
modalities: {
|
|
588
|
+
input: ["text", "image"],
|
|
589
|
+
output: ["text"]
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
id: "deepseek",
|
|
596
|
+
displayName: "DeepSeek",
|
|
597
|
+
apiMode: "chat_completions",
|
|
598
|
+
authType: "api_key",
|
|
599
|
+
baseUrl: "https://api.deepseek.com/v1",
|
|
600
|
+
envVars: ["DEEPSEEK_API_KEY"],
|
|
601
|
+
fallbackModels: ["deepseek-chat"],
|
|
602
|
+
capabilities: {
|
|
603
|
+
supportsToolUse: true,
|
|
604
|
+
supportsVision: false,
|
|
605
|
+
supportsStructuredOutput: true,
|
|
606
|
+
supportsStreaming: true,
|
|
607
|
+
supportsCacheControl: false
|
|
608
|
+
},
|
|
609
|
+
models: {
|
|
610
|
+
"deepseek-chat": {
|
|
611
|
+
name: "DeepSeek Chat",
|
|
612
|
+
release_date: "2025-12-01",
|
|
613
|
+
attachment: true,
|
|
614
|
+
reasoning: false,
|
|
615
|
+
temperature: true,
|
|
616
|
+
tool_call: true,
|
|
617
|
+
cost: {
|
|
618
|
+
input: 0.14,
|
|
619
|
+
output: 0.28,
|
|
620
|
+
cache_read: 28e-4
|
|
621
|
+
},
|
|
622
|
+
limit: {
|
|
623
|
+
context: 1e6,
|
|
624
|
+
output: 384e3
|
|
625
|
+
},
|
|
626
|
+
modalities: {
|
|
627
|
+
input: ["text"],
|
|
628
|
+
output: ["text"]
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
"deepseek-v4-flash": {
|
|
632
|
+
name: "DeepSeek V4 Flash",
|
|
633
|
+
release_date: "2026-04-24",
|
|
634
|
+
attachment: false,
|
|
635
|
+
reasoning: true,
|
|
636
|
+
temperature: true,
|
|
637
|
+
tool_call: true,
|
|
638
|
+
structured_output: false,
|
|
639
|
+
cost: {
|
|
640
|
+
input: 0.14,
|
|
641
|
+
output: 0.28,
|
|
642
|
+
cache_read: 28e-4
|
|
643
|
+
},
|
|
644
|
+
limit: {
|
|
645
|
+
context: 1048576,
|
|
646
|
+
output: 8e3
|
|
647
|
+
},
|
|
648
|
+
modalities: {
|
|
649
|
+
input: ["text"],
|
|
650
|
+
output: ["text"]
|
|
651
|
+
},
|
|
652
|
+
cache_control: false
|
|
653
|
+
},
|
|
654
|
+
"deepseek-v3.2": {
|
|
655
|
+
tool_call: true,
|
|
656
|
+
structured_output: false,
|
|
657
|
+
cache_control: false,
|
|
658
|
+
modalities: {
|
|
659
|
+
input: ["text"]
|
|
660
|
+
},
|
|
661
|
+
limit: {
|
|
662
|
+
context: 131072,
|
|
663
|
+
output: 8e3
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
id: "together",
|
|
670
|
+
displayName: "Together AI",
|
|
671
|
+
apiMode: "chat_completions",
|
|
672
|
+
authType: "api_key",
|
|
673
|
+
baseUrl: "https://api.together.xyz/v1",
|
|
674
|
+
envVars: ["TOGETHER_API_KEY"],
|
|
675
|
+
fallbackModels: ["meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo"],
|
|
676
|
+
capabilities: {
|
|
677
|
+
supportsToolUse: true,
|
|
678
|
+
supportsVision: true,
|
|
679
|
+
supportsStructuredOutput: true,
|
|
680
|
+
supportsStreaming: true,
|
|
681
|
+
supportsCacheControl: false
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
id: "fireworks",
|
|
686
|
+
displayName: "Fireworks AI",
|
|
687
|
+
apiMode: "chat_completions",
|
|
688
|
+
authType: "api_key",
|
|
689
|
+
baseUrl: "https://api.fireworks.ai/inference/v1",
|
|
690
|
+
envVars: ["FIREWORKS_API_KEY"],
|
|
691
|
+
fallbackModels: ["accounts/fireworks/models/llama-v3p1-70b-instruct"],
|
|
692
|
+
capabilities: {
|
|
693
|
+
supportsToolUse: true,
|
|
694
|
+
supportsVision: true,
|
|
695
|
+
supportsStructuredOutput: true,
|
|
696
|
+
supportsStreaming: true,
|
|
697
|
+
supportsCacheControl: false
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
id: "google-gemini",
|
|
702
|
+
displayName: "Google Gemini",
|
|
703
|
+
apiMode: "chat_completions",
|
|
704
|
+
authType: "api_key",
|
|
705
|
+
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
706
|
+
envVars: ["GOOGLE_API_KEY", "GEMINI_API_KEY"],
|
|
707
|
+
fallbackModels: ["gemini-2.0-flash"],
|
|
708
|
+
capabilities: {
|
|
709
|
+
supportsToolUse: true,
|
|
710
|
+
supportsVision: true,
|
|
711
|
+
supportsStructuredOutput: true,
|
|
712
|
+
supportsStreaming: true,
|
|
713
|
+
supportsCacheControl: false
|
|
714
|
+
},
|
|
715
|
+
aliases: ["gemini", "google"],
|
|
716
|
+
models: {
|
|
717
|
+
"gemini-2.0-flash": {
|
|
718
|
+
name: "Gemini 2.0 Flash",
|
|
719
|
+
release_date: "2024-12-11",
|
|
720
|
+
attachment: true,
|
|
721
|
+
reasoning: false,
|
|
722
|
+
temperature: true,
|
|
723
|
+
tool_call: true,
|
|
724
|
+
structured_output: true,
|
|
725
|
+
cost: {
|
|
726
|
+
input: 0.1,
|
|
727
|
+
output: 0.4,
|
|
728
|
+
cache_read: 0.025
|
|
729
|
+
},
|
|
730
|
+
limit: {
|
|
731
|
+
context: 1048576,
|
|
732
|
+
output: 8192
|
|
733
|
+
},
|
|
734
|
+
modalities: {
|
|
735
|
+
input: ["text", "image", "audio", "video", "pdf"],
|
|
736
|
+
output: ["text"]
|
|
737
|
+
},
|
|
738
|
+
status: "deprecated"
|
|
739
|
+
},
|
|
740
|
+
"gemini-2.5-flash-lite": {
|
|
741
|
+
name: "Gemini 2.5 Flash-Lite",
|
|
742
|
+
release_date: "2025-06-17",
|
|
743
|
+
attachment: true,
|
|
744
|
+
reasoning: true,
|
|
745
|
+
temperature: true,
|
|
746
|
+
tool_call: true,
|
|
747
|
+
structured_output: true,
|
|
748
|
+
cost: {
|
|
749
|
+
input: 0.1,
|
|
750
|
+
output: 0.4,
|
|
751
|
+
cache_read: 0.01
|
|
752
|
+
},
|
|
753
|
+
limit: {
|
|
754
|
+
context: 1048576,
|
|
755
|
+
output: 8e3
|
|
756
|
+
},
|
|
757
|
+
modalities: {
|
|
758
|
+
input: ["text", "image"],
|
|
759
|
+
output: ["text"]
|
|
760
|
+
},
|
|
761
|
+
cache_control: false
|
|
762
|
+
},
|
|
763
|
+
"gemini-2.5-pro": {
|
|
764
|
+
name: "Gemini 2.5 Pro",
|
|
765
|
+
release_date: "2025-06-17",
|
|
766
|
+
attachment: true,
|
|
767
|
+
reasoning: true,
|
|
768
|
+
temperature: true,
|
|
769
|
+
tool_call: true,
|
|
770
|
+
structured_output: true,
|
|
771
|
+
cost: {
|
|
772
|
+
input: 1.25,
|
|
773
|
+
output: 10,
|
|
774
|
+
cache_read: 0.125
|
|
775
|
+
},
|
|
776
|
+
limit: {
|
|
777
|
+
context: 1048576,
|
|
778
|
+
output: 8e3
|
|
779
|
+
},
|
|
780
|
+
modalities: {
|
|
781
|
+
input: ["text", "image"],
|
|
782
|
+
output: ["text"]
|
|
783
|
+
},
|
|
784
|
+
cache_control: false
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
id: "ollama",
|
|
790
|
+
displayName: "Ollama",
|
|
791
|
+
apiMode: "chat_completions",
|
|
792
|
+
authType: "none",
|
|
793
|
+
baseUrl: "http://localhost:11434/v1",
|
|
794
|
+
envVars: [],
|
|
795
|
+
fallbackModels: ["llama3.2"],
|
|
796
|
+
capabilities: {
|
|
797
|
+
supportsToolUse: true,
|
|
798
|
+
supportsVision: true,
|
|
799
|
+
supportsStructuredOutput: true,
|
|
800
|
+
supportsStreaming: true,
|
|
801
|
+
supportsCacheControl: false
|
|
802
|
+
},
|
|
803
|
+
aliases: ["ollama"]
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
id: "lmstudio",
|
|
807
|
+
displayName: "LM Studio",
|
|
808
|
+
apiMode: "chat_completions",
|
|
809
|
+
authType: "none",
|
|
810
|
+
baseUrl: "http://localhost:1234/v1",
|
|
811
|
+
envVars: [],
|
|
812
|
+
fallbackModels: ["lmstudio-community/default"],
|
|
813
|
+
capabilities: {
|
|
814
|
+
supportsToolUse: true,
|
|
815
|
+
supportsVision: false,
|
|
816
|
+
supportsStructuredOutput: true,
|
|
817
|
+
supportsStreaming: true,
|
|
818
|
+
supportsCacheControl: false
|
|
819
|
+
},
|
|
820
|
+
aliases: ["lmstudio"]
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
id: "llamacpp",
|
|
824
|
+
displayName: "llama.cpp",
|
|
825
|
+
apiMode: "chat_completions",
|
|
826
|
+
authType: "none",
|
|
827
|
+
baseUrl: "http://localhost:8080/v1",
|
|
828
|
+
envVars: [],
|
|
829
|
+
fallbackModels: ["default"],
|
|
830
|
+
capabilities: {
|
|
831
|
+
supportsToolUse: true,
|
|
832
|
+
supportsVision: false,
|
|
833
|
+
supportsStructuredOutput: false,
|
|
834
|
+
supportsStreaming: true,
|
|
835
|
+
supportsCacheControl: false
|
|
836
|
+
},
|
|
837
|
+
aliases: ["llamacpp"]
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
id: "bedrock",
|
|
841
|
+
displayName: "AWS Bedrock",
|
|
842
|
+
apiMode: "bedrock",
|
|
843
|
+
authType: "aws_sdk",
|
|
844
|
+
baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",
|
|
845
|
+
envVars: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"],
|
|
846
|
+
fallbackModels: ["anthropic.claude-3-5-sonnet-20241022-v2:0"],
|
|
847
|
+
capabilities: {
|
|
848
|
+
supportsToolUse: true,
|
|
849
|
+
supportsVision: true,
|
|
850
|
+
supportsStructuredOutput: false,
|
|
851
|
+
supportsStreaming: true,
|
|
852
|
+
supportsCacheControl: true
|
|
853
|
+
},
|
|
854
|
+
aliases: ["bedrock"]
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
id: "vertex",
|
|
858
|
+
displayName: "Google Vertex AI",
|
|
859
|
+
apiMode: "chat_completions",
|
|
860
|
+
authType: "gcp_oauth",
|
|
861
|
+
baseUrl: "https://us-central1-aiplatform.googleapis.com/v1",
|
|
862
|
+
envVars: ["GOOGLE_APPLICATION_CREDENTIALS"],
|
|
863
|
+
fallbackModels: ["gemini-1.5-pro"],
|
|
864
|
+
capabilities: {
|
|
865
|
+
supportsToolUse: true,
|
|
866
|
+
supportsVision: true,
|
|
867
|
+
supportsStructuredOutput: true,
|
|
868
|
+
supportsStreaming: true,
|
|
869
|
+
supportsCacheControl: false
|
|
870
|
+
},
|
|
871
|
+
aliases: ["vertex"]
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
id: "cohere",
|
|
875
|
+
displayName: "Cohere",
|
|
876
|
+
apiMode: "chat_completions",
|
|
877
|
+
authType: "api_key",
|
|
878
|
+
baseUrl: "https://api.cohere.com/v2",
|
|
879
|
+
envVars: ["COHERE_API_KEY"],
|
|
880
|
+
fallbackModels: ["command-r-plus"],
|
|
881
|
+
capabilities: {
|
|
882
|
+
supportsToolUse: true,
|
|
883
|
+
supportsVision: false,
|
|
884
|
+
supportsStructuredOutput: true,
|
|
885
|
+
supportsStreaming: true,
|
|
886
|
+
supportsCacheControl: false
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
id: "perplexity",
|
|
891
|
+
displayName: "Perplexity",
|
|
892
|
+
apiMode: "chat_completions",
|
|
893
|
+
authType: "api_key",
|
|
894
|
+
baseUrl: "https://api.perplexity.ai",
|
|
895
|
+
envVars: ["PERPLEXITY_API_KEY"],
|
|
896
|
+
fallbackModels: ["llama-3.1-sonar-large-128k-online"],
|
|
897
|
+
capabilities: {
|
|
898
|
+
supportsToolUse: false,
|
|
899
|
+
supportsVision: false,
|
|
900
|
+
supportsStructuredOutput: false,
|
|
901
|
+
supportsStreaming: true,
|
|
902
|
+
supportsCacheControl: false
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
id: "xai",
|
|
907
|
+
displayName: "xAI (Grok)",
|
|
908
|
+
apiMode: "chat_completions",
|
|
909
|
+
authType: "api_key",
|
|
910
|
+
baseUrl: "https://api.x.ai/v1",
|
|
911
|
+
envVars: ["XAI_API_KEY"],
|
|
912
|
+
fallbackModels: ["grok-2"],
|
|
913
|
+
capabilities: {
|
|
914
|
+
supportsToolUse: true,
|
|
915
|
+
supportsVision: true,
|
|
916
|
+
supportsStructuredOutput: true,
|
|
917
|
+
supportsStreaming: true,
|
|
918
|
+
supportsCacheControl: false
|
|
919
|
+
},
|
|
920
|
+
aliases: ["grok"]
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
id: "sambanova",
|
|
924
|
+
displayName: "SambaNova",
|
|
925
|
+
apiMode: "chat_completions",
|
|
926
|
+
authType: "api_key",
|
|
927
|
+
baseUrl: "https://api.sambanova.ai/v1",
|
|
928
|
+
envVars: ["SAMBANOVA_API_KEY"],
|
|
929
|
+
fallbackModels: ["Meta-Llama-3.1-70B-Instruct"],
|
|
930
|
+
capabilities: {
|
|
931
|
+
supportsToolUse: true,
|
|
932
|
+
supportsVision: false,
|
|
933
|
+
supportsStructuredOutput: true,
|
|
934
|
+
supportsStreaming: true,
|
|
935
|
+
supportsCacheControl: false
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
id: "cerebras",
|
|
940
|
+
displayName: "Cerebras",
|
|
941
|
+
apiMode: "chat_completions",
|
|
942
|
+
authType: "api_key",
|
|
943
|
+
baseUrl: "https://api.cerebras.ai/v1",
|
|
944
|
+
envVars: ["CEREBRAS_API_KEY"],
|
|
945
|
+
fallbackModels: ["llama3.1-70b"],
|
|
946
|
+
capabilities: {
|
|
947
|
+
supportsToolUse: true,
|
|
948
|
+
supportsVision: false,
|
|
949
|
+
supportsStructuredOutput: true,
|
|
950
|
+
supportsStreaming: true,
|
|
951
|
+
supportsCacheControl: false
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
id: "deepinfra",
|
|
956
|
+
displayName: "DeepInfra",
|
|
957
|
+
apiMode: "chat_completions",
|
|
958
|
+
authType: "api_key",
|
|
959
|
+
baseUrl: "https://api.deepinfra.com/v1/openai",
|
|
960
|
+
envVars: ["DEEPINFRA_API_KEY"],
|
|
961
|
+
fallbackModels: ["meta-llama/Meta-Llama-3.1-70B-Instruct"],
|
|
962
|
+
capabilities: {
|
|
963
|
+
supportsToolUse: true,
|
|
964
|
+
supportsVision: true,
|
|
965
|
+
supportsStructuredOutput: true,
|
|
966
|
+
supportsStreaming: true,
|
|
967
|
+
supportsCacheControl: false
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
id: "huggingface",
|
|
972
|
+
displayName: "Hugging Face",
|
|
973
|
+
apiMode: "chat_completions",
|
|
974
|
+
authType: "api_key",
|
|
975
|
+
baseUrl: "https://api-inference.huggingface.co/v1",
|
|
976
|
+
envVars: ["HF_TOKEN", "HUGGINGFACE_API_KEY"],
|
|
977
|
+
fallbackModels: ["meta-llama/Llama-3.2-3B-Instruct"],
|
|
978
|
+
capabilities: {
|
|
979
|
+
supportsToolUse: true,
|
|
980
|
+
supportsVision: false,
|
|
981
|
+
supportsStructuredOutput: false,
|
|
982
|
+
supportsStreaming: true,
|
|
983
|
+
supportsCacheControl: false
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
id: "nvidia",
|
|
988
|
+
displayName: "NVIDIA NIM",
|
|
989
|
+
apiMode: "chat_completions",
|
|
990
|
+
authType: "api_key",
|
|
991
|
+
baseUrl: "https://integrate.api.nvidia.com/v1",
|
|
992
|
+
envVars: ["NVIDIA_API_KEY"],
|
|
993
|
+
fallbackModels: ["meta/llama-3.1-70b-instruct"],
|
|
994
|
+
capabilities: {
|
|
995
|
+
supportsToolUse: true,
|
|
996
|
+
supportsVision: true,
|
|
997
|
+
supportsStructuredOutput: true,
|
|
998
|
+
supportsStreaming: true,
|
|
999
|
+
supportsCacheControl: false
|
|
1000
|
+
}
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
id: "lepton",
|
|
1004
|
+
displayName: "Lepton AI",
|
|
1005
|
+
apiMode: "chat_completions",
|
|
1006
|
+
authType: "api_key",
|
|
1007
|
+
baseUrl: "https://llama3-1-70b.lepton.run/api/v1",
|
|
1008
|
+
envVars: ["LEPTON_API_KEY"],
|
|
1009
|
+
fallbackModels: ["llama3-1-70b"],
|
|
1010
|
+
capabilities: {
|
|
1011
|
+
supportsToolUse: true,
|
|
1012
|
+
supportsVision: false,
|
|
1013
|
+
supportsStructuredOutput: false,
|
|
1014
|
+
supportsStreaming: true,
|
|
1015
|
+
supportsCacheControl: false
|
|
1016
|
+
}
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
id: "anyscale",
|
|
1020
|
+
displayName: "Anyscale",
|
|
1021
|
+
apiMode: "chat_completions",
|
|
1022
|
+
authType: "api_key",
|
|
1023
|
+
baseUrl: "https://api.endpoints.anyscale.com/v1",
|
|
1024
|
+
envVars: ["ANYSCALE_API_KEY"],
|
|
1025
|
+
fallbackModels: ["meta-llama/Meta-Llama-3-70B-Instruct"],
|
|
1026
|
+
capabilities: {
|
|
1027
|
+
supportsToolUse: true,
|
|
1028
|
+
supportsVision: false,
|
|
1029
|
+
supportsStructuredOutput: true,
|
|
1030
|
+
supportsStreaming: true,
|
|
1031
|
+
supportsCacheControl: false
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
id: "replicate",
|
|
1036
|
+
displayName: "Replicate",
|
|
1037
|
+
apiMode: "chat_completions",
|
|
1038
|
+
authType: "api_key",
|
|
1039
|
+
baseUrl: "https://openai-proxy.replicate.com/v1",
|
|
1040
|
+
envVars: ["REPLICATE_API_TOKEN"],
|
|
1041
|
+
fallbackModels: ["meta/meta-llama-3-70b-instruct"],
|
|
1042
|
+
capabilities: {
|
|
1043
|
+
supportsToolUse: false,
|
|
1044
|
+
supportsVision: true,
|
|
1045
|
+
supportsStructuredOutput: false,
|
|
1046
|
+
supportsStreaming: true,
|
|
1047
|
+
supportsCacheControl: false
|
|
1048
|
+
}
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
id: "ai21",
|
|
1052
|
+
displayName: "AI21 Labs",
|
|
1053
|
+
apiMode: "chat_completions",
|
|
1054
|
+
authType: "api_key",
|
|
1055
|
+
baseUrl: "https://api.ai21.com/studio/v1",
|
|
1056
|
+
envVars: ["AI21_API_KEY"],
|
|
1057
|
+
fallbackModels: ["jamba-1.5-large"],
|
|
1058
|
+
capabilities: {
|
|
1059
|
+
supportsToolUse: true,
|
|
1060
|
+
supportsVision: false,
|
|
1061
|
+
supportsStructuredOutput: true,
|
|
1062
|
+
supportsStreaming: true,
|
|
1063
|
+
supportsCacheControl: false
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
id: "aleph-alpha",
|
|
1068
|
+
displayName: "Aleph Alpha",
|
|
1069
|
+
apiMode: "chat_completions",
|
|
1070
|
+
authType: "api_key",
|
|
1071
|
+
baseUrl: "https://api.aleph-alpha.com/v1",
|
|
1072
|
+
envVars: ["ALEPH_ALPHA_API_KEY"],
|
|
1073
|
+
fallbackModels: ["luminous-extended"],
|
|
1074
|
+
capabilities: {
|
|
1075
|
+
supportsToolUse: false,
|
|
1076
|
+
supportsVision: false,
|
|
1077
|
+
supportsStructuredOutput: false,
|
|
1078
|
+
supportsStreaming: true,
|
|
1079
|
+
supportsCacheControl: false
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
id: "cloudflare",
|
|
1084
|
+
displayName: "Cloudflare Workers AI",
|
|
1085
|
+
apiMode: "chat_completions",
|
|
1086
|
+
authType: "api_key",
|
|
1087
|
+
baseUrl: "https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1",
|
|
1088
|
+
envVars: ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"],
|
|
1089
|
+
fallbackModels: ["@cf/meta/llama-3.1-70b-instruct"],
|
|
1090
|
+
capabilities: {
|
|
1091
|
+
supportsToolUse: true,
|
|
1092
|
+
supportsVision: false,
|
|
1093
|
+
supportsStructuredOutput: false,
|
|
1094
|
+
supportsStreaming: true,
|
|
1095
|
+
supportsCacheControl: false
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
id: "azure-openai",
|
|
1100
|
+
displayName: "Azure OpenAI",
|
|
1101
|
+
apiMode: "chat_completions",
|
|
1102
|
+
authType: "api_key",
|
|
1103
|
+
baseUrl: "https://{resource}.openai.azure.com/openai/deployments/{deployment}",
|
|
1104
|
+
envVars: ["AZURE_OPENAI_API_KEY", "AZURE_OPENAI_ENDPOINT"],
|
|
1105
|
+
fallbackModels: ["gpt-4o"],
|
|
1106
|
+
capabilities: {
|
|
1107
|
+
supportsToolUse: true,
|
|
1108
|
+
supportsVision: true,
|
|
1109
|
+
supportsStructuredOutput: true,
|
|
1110
|
+
supportsStreaming: true,
|
|
1111
|
+
supportsCacheControl: false
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
id: "github-models",
|
|
1116
|
+
displayName: "GitHub Models",
|
|
1117
|
+
apiMode: "chat_completions",
|
|
1118
|
+
authType: "api_key",
|
|
1119
|
+
baseUrl: "https://models.inference.ai.azure.com",
|
|
1120
|
+
envVars: ["GITHUB_TOKEN"],
|
|
1121
|
+
fallbackModels: ["gpt-4o-mini"],
|
|
1122
|
+
capabilities: {
|
|
1123
|
+
supportsToolUse: true,
|
|
1124
|
+
supportsVision: true,
|
|
1125
|
+
supportsStructuredOutput: true,
|
|
1126
|
+
supportsStreaming: true,
|
|
1127
|
+
supportsCacheControl: false
|
|
1128
|
+
}
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
id: "hyperbolic",
|
|
1132
|
+
displayName: "Hyperbolic",
|
|
1133
|
+
apiMode: "chat_completions",
|
|
1134
|
+
authType: "api_key",
|
|
1135
|
+
baseUrl: "https://api.hyperbolic.xyz/v1",
|
|
1136
|
+
envVars: ["HYPERBOLIC_API_KEY"],
|
|
1137
|
+
fallbackModels: ["meta-llama/Meta-Llama-3.1-70B-Instruct"],
|
|
1138
|
+
capabilities: {
|
|
1139
|
+
supportsToolUse: true,
|
|
1140
|
+
supportsVision: false,
|
|
1141
|
+
supportsStructuredOutput: true,
|
|
1142
|
+
supportsStreaming: true,
|
|
1143
|
+
supportsCacheControl: false
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
id: "novita",
|
|
1148
|
+
displayName: "Novita AI",
|
|
1149
|
+
apiMode: "chat_completions",
|
|
1150
|
+
authType: "api_key",
|
|
1151
|
+
baseUrl: "https://api.novita.ai/v3/openai",
|
|
1152
|
+
envVars: ["NOVITA_API_KEY"],
|
|
1153
|
+
fallbackModels: ["meta-llama/llama-3.1-70b-instruct"],
|
|
1154
|
+
capabilities: {
|
|
1155
|
+
supportsToolUse: true,
|
|
1156
|
+
supportsVision: false,
|
|
1157
|
+
supportsStructuredOutput: true,
|
|
1158
|
+
supportsStreaming: true,
|
|
1159
|
+
supportsCacheControl: false
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
id: "moonshot",
|
|
1164
|
+
displayName: "Moonshot (Kimi)",
|
|
1165
|
+
apiMode: "chat_completions",
|
|
1166
|
+
authType: "api_key",
|
|
1167
|
+
baseUrl: "https://api.moonshot.cn/v1",
|
|
1168
|
+
envVars: ["MOONSHOT_API_KEY"],
|
|
1169
|
+
fallbackModels: ["moonshot-v1-8k"],
|
|
1170
|
+
capabilities: {
|
|
1171
|
+
supportsToolUse: true,
|
|
1172
|
+
supportsVision: false,
|
|
1173
|
+
supportsStructuredOutput: false,
|
|
1174
|
+
supportsStreaming: true,
|
|
1175
|
+
supportsCacheControl: false
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
id: "qwen",
|
|
1180
|
+
displayName: "Qwen (Alibaba)",
|
|
1181
|
+
apiMode: "chat_completions",
|
|
1182
|
+
authType: "api_key",
|
|
1183
|
+
baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
1184
|
+
envVars: ["DASHSCOPE_API_KEY"],
|
|
1185
|
+
fallbackModels: ["qwen-plus"],
|
|
1186
|
+
capabilities: {
|
|
1187
|
+
supportsToolUse: true,
|
|
1188
|
+
supportsVision: true,
|
|
1189
|
+
supportsStructuredOutput: true,
|
|
1190
|
+
supportsStreaming: true,
|
|
1191
|
+
supportsCacheControl: false
|
|
1192
|
+
},
|
|
1193
|
+
aliases: ["dashscope"],
|
|
1194
|
+
models: {
|
|
1195
|
+
"qwen3-coder-30b-a3b-instruct": {
|
|
1196
|
+
tool_call: true,
|
|
1197
|
+
structured_output: false,
|
|
1198
|
+
cache_control: false,
|
|
1199
|
+
modalities: {
|
|
1200
|
+
input: ["text"]
|
|
1201
|
+
},
|
|
1202
|
+
limit: {
|
|
1203
|
+
context: 16e4,
|
|
1204
|
+
output: 8e3
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
id: "zhipu",
|
|
1211
|
+
displayName: "Zhipu AI (GLM)",
|
|
1212
|
+
apiMode: "chat_completions",
|
|
1213
|
+
authType: "api_key",
|
|
1214
|
+
baseUrl: "https://open.bigmodel.cn/api/paas/v4",
|
|
1215
|
+
envVars: ["ZHIPU_API_KEY"],
|
|
1216
|
+
fallbackModels: ["glm-4-plus"],
|
|
1217
|
+
capabilities: {
|
|
1218
|
+
supportsToolUse: true,
|
|
1219
|
+
supportsVision: true,
|
|
1220
|
+
supportsStructuredOutput: true,
|
|
1221
|
+
supportsStreaming: true,
|
|
1222
|
+
supportsCacheControl: false
|
|
1223
|
+
},
|
|
1224
|
+
aliases: ["glm", "z-ai"],
|
|
1225
|
+
models: {
|
|
1226
|
+
"glm-4.7-flash": {
|
|
1227
|
+
name: "GLM-4.7-Flash",
|
|
1228
|
+
release_date: "2026-01-19",
|
|
1229
|
+
attachment: false,
|
|
1230
|
+
reasoning: true,
|
|
1231
|
+
temperature: true,
|
|
1232
|
+
tool_call: true,
|
|
1233
|
+
cost: {
|
|
1234
|
+
input: 0,
|
|
1235
|
+
output: 0,
|
|
1236
|
+
cache_read: 0,
|
|
1237
|
+
cache_write: 0
|
|
1238
|
+
},
|
|
1239
|
+
limit: {
|
|
1240
|
+
context: 202752,
|
|
1241
|
+
output: 8e3
|
|
1242
|
+
},
|
|
1243
|
+
modalities: {
|
|
1244
|
+
input: ["text"],
|
|
1245
|
+
output: ["text"]
|
|
1246
|
+
},
|
|
1247
|
+
structured_output: false,
|
|
1248
|
+
cache_control: false
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
id: "minimax",
|
|
1254
|
+
displayName: "MiniMax",
|
|
1255
|
+
apiMode: "chat_completions",
|
|
1256
|
+
authType: "api_key",
|
|
1257
|
+
baseUrl: "https://api.minimax.chat/v1",
|
|
1258
|
+
envVars: ["MINIMAX_API_KEY"],
|
|
1259
|
+
fallbackModels: ["MiniMax-Text-01"],
|
|
1260
|
+
capabilities: {
|
|
1261
|
+
supportsToolUse: true,
|
|
1262
|
+
supportsVision: false,
|
|
1263
|
+
supportsStructuredOutput: false,
|
|
1264
|
+
supportsStreaming: true,
|
|
1265
|
+
supportsCacheControl: false
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
id: "baichuan",
|
|
1270
|
+
displayName: "Baichuan",
|
|
1271
|
+
apiMode: "chat_completions",
|
|
1272
|
+
authType: "api_key",
|
|
1273
|
+
baseUrl: "https://api.baichuan-ai.com/v1",
|
|
1274
|
+
envVars: ["BAICHUAN_API_KEY"],
|
|
1275
|
+
fallbackModels: ["Baichuan4"],
|
|
1276
|
+
capabilities: {
|
|
1277
|
+
supportsToolUse: true,
|
|
1278
|
+
supportsVision: false,
|
|
1279
|
+
supportsStructuredOutput: false,
|
|
1280
|
+
supportsStreaming: true,
|
|
1281
|
+
supportsCacheControl: false
|
|
1282
|
+
}
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
id: "voyage",
|
|
1286
|
+
displayName: "Voyage AI",
|
|
1287
|
+
apiMode: "chat_completions",
|
|
1288
|
+
authType: "api_key",
|
|
1289
|
+
baseUrl: "https://api.voyageai.com/v1",
|
|
1290
|
+
envVars: ["VOYAGE_API_KEY"],
|
|
1291
|
+
fallbackModels: ["voyage-3"],
|
|
1292
|
+
capabilities: {
|
|
1293
|
+
supportsToolUse: false,
|
|
1294
|
+
supportsVision: false,
|
|
1295
|
+
supportsStructuredOutput: false,
|
|
1296
|
+
supportsStreaming: false,
|
|
1297
|
+
supportsCacheControl: false
|
|
1298
|
+
}
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
id: "jina",
|
|
1302
|
+
displayName: "Jina AI",
|
|
1303
|
+
apiMode: "chat_completions",
|
|
1304
|
+
authType: "api_key",
|
|
1305
|
+
baseUrl: "https://api.jina.ai/v1",
|
|
1306
|
+
envVars: ["JINA_API_KEY"],
|
|
1307
|
+
fallbackModels: ["jina-embeddings-v3"],
|
|
1308
|
+
capabilities: {
|
|
1309
|
+
supportsToolUse: false,
|
|
1310
|
+
supportsVision: false,
|
|
1311
|
+
supportsStructuredOutput: false,
|
|
1312
|
+
supportsStreaming: false,
|
|
1313
|
+
supportsCacheControl: false
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
id: "helicone",
|
|
1318
|
+
displayName: "Helicone (Gateway)",
|
|
1319
|
+
apiMode: "chat_completions",
|
|
1320
|
+
authType: "api_key",
|
|
1321
|
+
baseUrl: "https://oai.helicone.ai/v1",
|
|
1322
|
+
envVars: ["HELICONE_API_KEY", "OPENAI_API_KEY"],
|
|
1323
|
+
fallbackModels: ["gpt-4o-mini"],
|
|
1324
|
+
capabilities: {
|
|
1325
|
+
supportsToolUse: true,
|
|
1326
|
+
supportsVision: true,
|
|
1327
|
+
supportsStructuredOutput: true,
|
|
1328
|
+
supportsStreaming: true,
|
|
1329
|
+
supportsCacheControl: false
|
|
1330
|
+
},
|
|
1331
|
+
models: {
|
|
1332
|
+
"gpt-4o-mini": {
|
|
1333
|
+
name: "OpenAI GPT-4o-mini",
|
|
1334
|
+
release_date: "2024-07-18",
|
|
1335
|
+
attachment: false,
|
|
1336
|
+
reasoning: false,
|
|
1337
|
+
temperature: true,
|
|
1338
|
+
tool_call: true,
|
|
1339
|
+
cost: {
|
|
1340
|
+
input: 0.15,
|
|
1341
|
+
output: 0.6,
|
|
1342
|
+
cache_read: 0.075
|
|
1343
|
+
},
|
|
1344
|
+
limit: {
|
|
1345
|
+
context: 128e3,
|
|
1346
|
+
output: 16384
|
|
1347
|
+
},
|
|
1348
|
+
modalities: {
|
|
1349
|
+
input: ["text", "image"],
|
|
1350
|
+
output: ["text"]
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
id: "portkey",
|
|
1357
|
+
displayName: "Portkey (Gateway)",
|
|
1358
|
+
apiMode: "chat_completions",
|
|
1359
|
+
authType: "api_key",
|
|
1360
|
+
baseUrl: "https://api.portkey.ai/v1",
|
|
1361
|
+
envVars: ["PORTKEY_API_KEY"],
|
|
1362
|
+
fallbackModels: ["gpt-4o-mini"],
|
|
1363
|
+
capabilities: {
|
|
1364
|
+
supportsToolUse: true,
|
|
1365
|
+
supportsVision: true,
|
|
1366
|
+
supportsStructuredOutput: true,
|
|
1367
|
+
supportsStreaming: true,
|
|
1368
|
+
supportsCacheControl: false
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
id: "baseten",
|
|
1373
|
+
displayName: "Baseten",
|
|
1374
|
+
apiMode: "chat_completions",
|
|
1375
|
+
authType: "api_key",
|
|
1376
|
+
baseUrl: "https://bridge.baseten.co/v1",
|
|
1377
|
+
envVars: ["BASETEN_API_KEY"],
|
|
1378
|
+
fallbackModels: ["meta-llama/Meta-Llama-3-70B-Instruct"],
|
|
1379
|
+
capabilities: {
|
|
1380
|
+
supportsToolUse: true,
|
|
1381
|
+
supportsVision: false,
|
|
1382
|
+
supportsStructuredOutput: true,
|
|
1383
|
+
supportsStreaming: true,
|
|
1384
|
+
supportsCacheControl: false
|
|
1385
|
+
}
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
id: "modal",
|
|
1389
|
+
displayName: "Modal",
|
|
1390
|
+
apiMode: "chat_completions",
|
|
1391
|
+
authType: "api_key",
|
|
1392
|
+
baseUrl: "https://api.modal.com/v1",
|
|
1393
|
+
envVars: ["MODAL_TOKEN_ID", "MODAL_TOKEN_SECRET"],
|
|
1394
|
+
fallbackModels: ["meta-llama/Meta-Llama-3-70B-Instruct"],
|
|
1395
|
+
capabilities: {
|
|
1396
|
+
supportsToolUse: true,
|
|
1397
|
+
supportsVision: false,
|
|
1398
|
+
supportsStructuredOutput: false,
|
|
1399
|
+
supportsStreaming: true,
|
|
1400
|
+
supportsCacheControl: false
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
];
|
|
1404
|
+
|
|
1405
|
+
// src/internal/providers/catalog-loader.ts
|
|
1406
|
+
var modelInfoIndex = globalSingleton(
|
|
1407
|
+
"theokit-sdk.providers.model-info-index",
|
|
1408
|
+
() => /* @__PURE__ */ new Map()
|
|
1409
|
+
);
|
|
1410
|
+
var patchedModelKeys = globalSingleton(
|
|
1411
|
+
"theokit-sdk.providers.model-info-patched",
|
|
1412
|
+
() => /* @__PURE__ */ new Set()
|
|
1413
|
+
);
|
|
1414
|
+
var indexState = globalSingleton("theokit-sdk.providers.model-info-loaded", () => ({
|
|
1415
|
+
loaded: false
|
|
1416
|
+
}));
|
|
1417
|
+
function getCatalogModelInfo(key) {
|
|
1418
|
+
ensureModelIndexLoaded();
|
|
1419
|
+
return modelInfoIndex.get(key);
|
|
1420
|
+
}
|
|
1421
|
+
function isPatchedModelKey(key) {
|
|
1422
|
+
return patchedModelKeys.has(key);
|
|
1423
|
+
}
|
|
1424
|
+
function patchModelInfo(key, model) {
|
|
1425
|
+
ensureModelIndexLoaded();
|
|
1426
|
+
const existing = modelInfoIndex.get(key);
|
|
1427
|
+
modelInfoIndex.set(key, existing === void 0 ? model : { ...existing, ...model });
|
|
1428
|
+
patchedModelKeys.add(key);
|
|
1429
|
+
}
|
|
1430
|
+
function ensureModelIndexLoaded() {
|
|
1431
|
+
if (indexState.loaded) return;
|
|
1432
|
+
indexState.loaded = true;
|
|
1433
|
+
try {
|
|
1434
|
+
const catalog = loadProviderCatalog();
|
|
1435
|
+
for (const entry of Object.values(catalog)) {
|
|
1436
|
+
indexEntryModels(entry);
|
|
1437
|
+
}
|
|
1438
|
+
} catch (err) {
|
|
1439
|
+
diag(
|
|
1440
|
+
`[theokit-sdk] WARN: provider catalog unavailable (${err.message}) \u2014 per-model data disabled
|
|
1441
|
+
`
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
function indexEntryModels(entry) {
|
|
1446
|
+
if (entry.models === void 0 || typeof entry.models !== "object") return;
|
|
1447
|
+
for (const [modelId, raw] of Object.entries(entry.models)) {
|
|
1448
|
+
const parsed = catalogModelSchema.safeParse(raw);
|
|
1449
|
+
if (!parsed.success) {
|
|
1450
|
+
diag(
|
|
1451
|
+
`[theokit-sdk] WARN: Skipping malformed catalog model "${entry.id}/${modelId}": ${parsed.error.issues[0]?.message ?? "invalid"}
|
|
1452
|
+
`
|
|
1453
|
+
);
|
|
1454
|
+
continue;
|
|
1455
|
+
}
|
|
1456
|
+
modelInfoIndex.set(`${entry.id}/${modelId}`, parsed.data);
|
|
1457
|
+
for (const alias of entry.aliases ?? []) {
|
|
1458
|
+
const key = `${alias}/${modelId}`;
|
|
1459
|
+
if (!modelInfoIndex.has(key)) modelInfoIndex.set(key, parsed.data);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
function validateEntry(raw) {
|
|
1464
|
+
const parsed = catalogEntrySchema.safeParse(raw);
|
|
1465
|
+
return parsed.success ? parsed.data : null;
|
|
1466
|
+
}
|
|
1467
|
+
function loadProviderCatalog(opts) {
|
|
1468
|
+
let entries = [...provider_catalog_default];
|
|
1469
|
+
if (opts?._testInjectMalformed) {
|
|
1470
|
+
entries = [
|
|
1471
|
+
...entries,
|
|
1472
|
+
{ id: "malformed-provider", displayName: "Bad" }
|
|
1473
|
+
];
|
|
1474
|
+
}
|
|
1475
|
+
const result = {};
|
|
1476
|
+
for (const raw of entries) {
|
|
1477
|
+
const validated = validateEntry(raw);
|
|
1478
|
+
if (validated === null) {
|
|
1479
|
+
diag(
|
|
1480
|
+
`[theokit-sdk] WARN: Skipping malformed catalog entry: ${JSON.stringify(raw).slice(0, 100)}
|
|
1481
|
+
`
|
|
1482
|
+
);
|
|
1483
|
+
continue;
|
|
1484
|
+
}
|
|
1485
|
+
result[validated.id] = validated;
|
|
1486
|
+
}
|
|
1487
|
+
return result;
|
|
1488
|
+
}
|
|
1489
|
+
var _capabilitiesCache = null;
|
|
1490
|
+
function getCatalogCapabilities(providerId) {
|
|
1491
|
+
if (_capabilitiesCache === null) {
|
|
1492
|
+
const catalog = loadProviderCatalog();
|
|
1493
|
+
_capabilitiesCache = {};
|
|
1494
|
+
for (const entry of Object.values(catalog)) {
|
|
1495
|
+
_capabilitiesCache[entry.id] = entry.capabilities;
|
|
1496
|
+
for (const alias of entry.aliases ?? []) {
|
|
1497
|
+
if (_capabilitiesCache[alias] === void 0) _capabilitiesCache[alias] = entry.capabilities;
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
return _capabilitiesCache[providerId];
|
|
1502
|
+
}
|
|
1503
|
+
function registerCatalogProviders(opts) {
|
|
1504
|
+
const catalog = loadProviderCatalog(opts);
|
|
1505
|
+
for (const entry of Object.values(catalog)) {
|
|
1506
|
+
if (getProviderProfile(entry.id) !== void 0) continue;
|
|
1507
|
+
if (entry.aliases?.some((a) => getProviderProfile(a) !== void 0)) continue;
|
|
1508
|
+
const profile = {
|
|
1509
|
+
name: entry.id,
|
|
1510
|
+
apiMode: entry.apiMode,
|
|
1511
|
+
authType: entry.authType,
|
|
1512
|
+
baseUrl: entry.baseUrl,
|
|
1513
|
+
envVars: entry.envVars,
|
|
1514
|
+
fallbackModels: entry.fallbackModels,
|
|
1515
|
+
displayName: entry.displayName,
|
|
1516
|
+
aliases: entry.aliases,
|
|
1517
|
+
modelsUrl: entry.modelsUrl,
|
|
1518
|
+
hostname: entry.hostname,
|
|
1519
|
+
extraHeaders: entry.extraHeaders
|
|
1520
|
+
};
|
|
1521
|
+
registerProvider(profile);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
// src/internal/providers/builtin/anthropic.ts
|
|
1526
|
+
var ANTHROPIC = {
|
|
1527
|
+
name: "anthropic",
|
|
1528
|
+
apiMode: "anthropic_messages",
|
|
1529
|
+
envVars: ["ANTHROPIC_API_KEY"],
|
|
1530
|
+
authType: "api_key",
|
|
1531
|
+
baseUrl: "https://api.anthropic.com",
|
|
1532
|
+
modelsUrl: "https://api.anthropic.com/v1/models",
|
|
1533
|
+
hostname: "api.anthropic.com",
|
|
1534
|
+
fallbackModels: ["claude-opus-4-7", "claude-sonnet-4-6", "claude-haiku-4-5-20251001"],
|
|
1535
|
+
// M45 — the Anthropic beta-features header (interleaved thinking + fine-grained tool streaming). An
|
|
1536
|
+
// Anthropic API constant. The
|
|
1537
|
+
// SANCTIONED behavior delta of M45 (ADR D4) — consumed by the anthropic transport's extraHeaders wiring.
|
|
1538
|
+
extraHeaders: {
|
|
1539
|
+
"anthropic-beta": "interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14"
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
|
|
1543
|
+
// src/internal/providers/builtin/bedrock.ts
|
|
1544
|
+
var BEDROCK = {
|
|
1545
|
+
name: "bedrock",
|
|
1546
|
+
apiMode: "bedrock_anthropic",
|
|
1547
|
+
envVars: ["AWS_BEARER_TOKEN_BEDROCK"],
|
|
1548
|
+
authType: "aws_bearer",
|
|
1549
|
+
baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",
|
|
1550
|
+
modelsUrl: void 0,
|
|
1551
|
+
hostname: "bedrock-runtime.amazonaws.com",
|
|
1552
|
+
fallbackModels: [
|
|
1553
|
+
"bedrock/us.anthropic.claude-sonnet-4-5-v1:0",
|
|
1554
|
+
"bedrock/us.anthropic.claude-opus-4-7-v1:0",
|
|
1555
|
+
"bedrock/global.anthropic.claude-haiku-4-5-v1:0"
|
|
1556
|
+
]
|
|
1557
|
+
};
|
|
1558
|
+
function stripBedrockPrefix(modelId) {
|
|
1559
|
+
return modelId.replace(/^bedrock\//, "");
|
|
1560
|
+
}
|
|
1561
|
+
function inferRegionFromModelId(modelId) {
|
|
1562
|
+
const id = stripBedrockPrefix(modelId);
|
|
1563
|
+
if (id.startsWith("global.")) return "us-east-1";
|
|
1564
|
+
if (id.startsWith("us.")) return process.env.AWS_REGION ?? "us-east-1";
|
|
1565
|
+
if (id.startsWith("eu.")) return process.env.AWS_REGION ?? "eu-west-1";
|
|
1566
|
+
if (id.startsWith("apac.")) return process.env.AWS_REGION ?? "ap-southeast-1";
|
|
1567
|
+
if (id.startsWith("jp.")) return "ap-northeast-1";
|
|
1568
|
+
return void 0;
|
|
1569
|
+
}
|
|
1570
|
+
function resolveBedrockBaseUrl(modelId) {
|
|
1571
|
+
const region = inferRegionFromModelId(modelId) ?? process.env.AWS_REGION ?? "us-east-1";
|
|
1572
|
+
return `https://bedrock-runtime.${region}.amazonaws.com`;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
// src/internal/providers/builtin/openai-compatible.ts
|
|
1576
|
+
function openAiCompatibleProfile(p) {
|
|
1577
|
+
return {
|
|
1578
|
+
apiMode: "chat_completions",
|
|
1579
|
+
authType: "api_key",
|
|
1580
|
+
fallbackModels: [],
|
|
1581
|
+
...p
|
|
1582
|
+
};
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
// src/internal/providers/builtin/cerebras.ts
|
|
1586
|
+
var CEREBRAS = openAiCompatibleProfile({
|
|
1587
|
+
name: "cerebras",
|
|
1588
|
+
baseUrl: "https://api.cerebras.ai/v1",
|
|
1589
|
+
envVars: ["CEREBRAS_API_KEY"],
|
|
1590
|
+
fallbackModels: ["gpt-oss-120b", "zai-glm-4.7"],
|
|
1591
|
+
extraHeaders: { "X-Cerebras-3rd-Party-Integration": "theokit" },
|
|
1592
|
+
hostname: "api.cerebras.ai"
|
|
1593
|
+
});
|
|
1594
|
+
|
|
1595
|
+
// src/internal/providers/builtin/cohere.ts
|
|
1596
|
+
var COHERE = openAiCompatibleProfile({
|
|
1597
|
+
name: "cohere",
|
|
1598
|
+
baseUrl: "https://api.cohere.ai/compatibility/v1",
|
|
1599
|
+
envVars: ["COHERE_API_KEY", "CO_API_KEY"],
|
|
1600
|
+
fallbackModels: ["command-a-03-2025"],
|
|
1601
|
+
hostname: "api.cohere.ai"
|
|
1602
|
+
});
|
|
1603
|
+
|
|
1604
|
+
// src/internal/providers/builtin/deepinfra.ts
|
|
1605
|
+
var DEEPINFRA = openAiCompatibleProfile({
|
|
1606
|
+
name: "deepinfra",
|
|
1607
|
+
baseUrl: "https://api.deepinfra.com/v1/openai",
|
|
1608
|
+
envVars: ["DEEPINFRA_API_KEY"],
|
|
1609
|
+
fallbackModels: ["Qwen/Qwen3-32B"],
|
|
1610
|
+
hostname: "api.deepinfra.com"
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
// src/internal/providers/builtin/gemini.ts
|
|
1614
|
+
var GEMINI = {
|
|
1615
|
+
name: "gemini",
|
|
1616
|
+
apiMode: "chat_completions",
|
|
1617
|
+
envVars: ["OPENROUTER_API_KEY"],
|
|
1618
|
+
authType: "api_key",
|
|
1619
|
+
baseUrl: "https://openrouter.ai/api",
|
|
1620
|
+
hostname: "openrouter.ai",
|
|
1621
|
+
fallbackModels: ["google/gemini-2.0-flash-001"]
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
// src/internal/providers/builtin/google.ts
|
|
1625
|
+
var GOOGLE = openAiCompatibleProfile({
|
|
1626
|
+
name: "google",
|
|
1627
|
+
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
1628
|
+
envVars: ["GOOGLE_API_KEY", "GEMINI_API_KEY", "GOOGLE_GENERATIVE_AI_API_KEY"],
|
|
1629
|
+
fallbackModels: ["gemini-2.5-pro", "gemini-2.5-flash"],
|
|
1630
|
+
hostname: "generativelanguage.googleapis.com"
|
|
1631
|
+
});
|
|
1632
|
+
|
|
1633
|
+
// src/internal/providers/builtin/groq.ts
|
|
1634
|
+
var GROQ = openAiCompatibleProfile({
|
|
1635
|
+
name: "groq",
|
|
1636
|
+
baseUrl: "https://api.groq.com/openai/v1",
|
|
1637
|
+
envVars: ["GROQ_API_KEY"],
|
|
1638
|
+
fallbackModels: ["llama-3.3-70b-versatile", "llama-3.1-8b-instant"],
|
|
1639
|
+
hostname: "api.groq.com"
|
|
1640
|
+
});
|
|
1641
|
+
|
|
1642
|
+
// src/internal/providers/builtin/llamacpp.ts
|
|
1643
|
+
var LLAMACPP = {
|
|
1644
|
+
name: "llamacpp",
|
|
1645
|
+
aliases: ["llama-cpp", "llama.cpp"],
|
|
1646
|
+
apiMode: "chat_completions",
|
|
1647
|
+
envVars: ["LLAMACPP_API_KEY"],
|
|
1648
|
+
authType: "none",
|
|
1649
|
+
baseUrl: "http://localhost:8080",
|
|
1650
|
+
modelsUrl: "http://localhost:8080/v1/models",
|
|
1651
|
+
hostname: "localhost",
|
|
1652
|
+
fallbackModels: ["loaded-model"]
|
|
1653
|
+
};
|
|
1654
|
+
|
|
1655
|
+
// src/internal/providers/builtin/lmstudio.ts
|
|
1656
|
+
var LMSTUDIO = {
|
|
1657
|
+
name: "lmstudio",
|
|
1658
|
+
aliases: ["lm-studio", "lm_studio"],
|
|
1659
|
+
apiMode: "chat_completions",
|
|
1660
|
+
envVars: ["LMSTUDIO_API_KEY"],
|
|
1661
|
+
authType: "none",
|
|
1662
|
+
baseUrl: "http://localhost:1234",
|
|
1663
|
+
modelsUrl: "http://localhost:1234/v1/models",
|
|
1664
|
+
hostname: "localhost",
|
|
1665
|
+
fallbackModels: ["loaded-model"]
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
// src/internal/providers/builtin/mistral.ts
|
|
1669
|
+
var MISTRAL = openAiCompatibleProfile({
|
|
1670
|
+
name: "mistral",
|
|
1671
|
+
baseUrl: "https://api.mistral.ai/v1",
|
|
1672
|
+
envVars: ["MISTRAL_API_KEY"],
|
|
1673
|
+
fallbackModels: ["mistral-large-latest", "codestral-latest"],
|
|
1674
|
+
hostname: "api.mistral.ai"
|
|
1675
|
+
});
|
|
1676
|
+
|
|
1677
|
+
// src/internal/providers/builtin/ollama.ts
|
|
1678
|
+
var OLLAMA = {
|
|
1679
|
+
name: "ollama",
|
|
1680
|
+
apiMode: "chat_completions",
|
|
1681
|
+
envVars: ["OLLAMA_API_KEY"],
|
|
1682
|
+
authType: "none",
|
|
1683
|
+
baseUrl: "http://localhost:11434",
|
|
1684
|
+
modelsUrl: "http://localhost:11434/v1/models",
|
|
1685
|
+
hostname: "localhost",
|
|
1686
|
+
fallbackModels: ["llama3.2", "qwen2.5", "mistral"]
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1689
|
+
// src/internal/providers/builtin/openai.ts
|
|
1690
|
+
var OPENAI = {
|
|
1691
|
+
name: "openai",
|
|
1692
|
+
apiMode: "chat_completions",
|
|
1693
|
+
envVars: ["OPENAI_API_KEY"],
|
|
1694
|
+
authType: "api_key",
|
|
1695
|
+
baseUrl: "https://api.openai.com",
|
|
1696
|
+
modelsUrl: "https://api.openai.com/v1/models",
|
|
1697
|
+
hostname: "api.openai.com",
|
|
1698
|
+
fallbackModels: ["gpt-4o", "gpt-4o-mini"]
|
|
1699
|
+
};
|
|
1700
|
+
var DEFAULT_STORE = {
|
|
1701
|
+
home: homedir(),
|
|
1702
|
+
dirName: ".theokit",
|
|
1703
|
+
fileName: "auth.json",
|
|
1704
|
+
homeEnvVar: "THEOKIT_AUTH_HOME"
|
|
1705
|
+
};
|
|
1706
|
+
var OPENAI_OAUTH_CONFIG = {
|
|
1707
|
+
provider: "openai",
|
|
1708
|
+
authorizeEndpoint: "https://auth.openai.com/oauth/authorize",
|
|
1709
|
+
tokenEndpoint: "https://auth.openai.com/oauth/token",
|
|
1710
|
+
clientId: "app_EMoamEEZ73f0CkXaXp7hrann",
|
|
1711
|
+
scopes: ["openid", "profile", "email", "offline_access"],
|
|
1712
|
+
redirectUri: "https://auth.openai.com/deviceauth/callback"
|
|
1713
|
+
};
|
|
1714
|
+
function codexFetch() {
|
|
1715
|
+
return (async (input, init) => {
|
|
1716
|
+
const env = process.env;
|
|
1717
|
+
const resolved = await resolveCredential({
|
|
1718
|
+
provider: "openai",
|
|
1719
|
+
store: DEFAULT_STORE,
|
|
1720
|
+
oauth: OPENAI_OAUTH_CONFIG,
|
|
1721
|
+
env
|
|
1722
|
+
});
|
|
1723
|
+
if (resolved === void 0) {
|
|
1724
|
+
throw new AuthenticationError(
|
|
1725
|
+
'openai-chatgpt: no ChatGPT credential found \u2014 run the OpenAI device login (e.g. "/login openai") first.',
|
|
1726
|
+
{ code: "missing_credential" }
|
|
1727
|
+
);
|
|
1728
|
+
}
|
|
1729
|
+
const accountId = readStoredOAuth(DEFAULT_STORE, env)?.account_id;
|
|
1730
|
+
const headers = new Headers(init?.headers);
|
|
1731
|
+
headers.set("authorization", `Bearer ${resolved.apiKey}`);
|
|
1732
|
+
if (accountId !== void 0) headers.set("ChatGPT-Account-Id", accountId);
|
|
1733
|
+
return fetch(input, { ...init, headers });
|
|
1734
|
+
});
|
|
1735
|
+
}
|
|
1736
|
+
var OPENAI_CHATGPT = {
|
|
1737
|
+
name: "openai-chatgpt",
|
|
1738
|
+
apiMode: "responses_api",
|
|
1739
|
+
authType: "oauth_device_code",
|
|
1740
|
+
baseUrl: "https://chatgpt.com/backend-api/codex",
|
|
1741
|
+
envVars: [],
|
|
1742
|
+
fallbackModels: [
|
|
1743
|
+
"openai-chatgpt/gpt-5.4",
|
|
1744
|
+
"openai-chatgpt/gpt-5.4-mini",
|
|
1745
|
+
"openai-chatgpt/gpt-5.5"
|
|
1746
|
+
],
|
|
1747
|
+
// #165 — this shipped as `codex_cli_rs`, another vendor's client identifier. Claiming to be a different
|
|
1748
|
+
// vendor's client is a false statement of identity. Third-party clients send their OWN name against
|
|
1749
|
+
// this same endpoint, which also shows the route is not restricted to the official client.
|
|
1750
|
+
extraHeaders: { originator: "theokit" },
|
|
1751
|
+
// usetheokit/theokit-sdk#383 — carry the model's encrypted reasoning between the rounds of a turn.
|
|
1752
|
+
// On for THIS profile and no other because this is the endpoint the issue measured: OpenAI Codex
|
|
1753
|
+
// sends `include: ["reasoning.encrypted_content"]` with `reasoning.context: "all_turns"` to the
|
|
1754
|
+
// same backend, same model, on the same account, so acceptance is observed rather than assumed.
|
|
1755
|
+
// The issue's measurement — a third of our bytes, 2.8x our tokens — is what this closes together
|
|
1756
|
+
// with `prompt_cache_key`.
|
|
1757
|
+
encryptedReasoning: true,
|
|
1758
|
+
transform: {
|
|
1759
|
+
// Only `fetch` (async) can await the credential refresh; `headers` is sync and cannot.
|
|
1760
|
+
fetch: () => codexFetch()
|
|
1761
|
+
}
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
// src/internal/providers/builtin/openrouter.ts
|
|
1765
|
+
var OPENROUTER = {
|
|
1766
|
+
name: "openrouter",
|
|
1767
|
+
apiMode: "chat_completions",
|
|
1768
|
+
aliases: ["or"],
|
|
1769
|
+
// Ordered fallback (EC-10): OPENROUTER_API_KEY preferred, OPENAI_API_KEY as compat.
|
|
1770
|
+
envVars: ["OPENROUTER_API_KEY", "OPENAI_API_KEY"],
|
|
1771
|
+
authType: "api_key",
|
|
1772
|
+
baseUrl: "https://openrouter.ai/api",
|
|
1773
|
+
modelsUrl: "https://openrouter.ai/api/v1/models",
|
|
1774
|
+
hostname: "openrouter.ai",
|
|
1775
|
+
// M45 — models refreshed (claude-3-haiku retired upstream).
|
|
1776
|
+
fallbackModels: ["openai/gpt-4o-mini", "anthropic/claude-haiku-4-5"],
|
|
1777
|
+
// M45 — OpenRouter app-attribution headers. VALUES are
|
|
1778
|
+
// theokit's own — copying another app's referer would misattribute traffic).
|
|
1779
|
+
extraHeaders: { "HTTP-Referer": "https://usetheo.dev", "X-Title": "theokit" }
|
|
1780
|
+
};
|
|
1781
|
+
|
|
1782
|
+
// src/internal/providers/builtin/perplexity.ts
|
|
1783
|
+
var PERPLEXITY = openAiCompatibleProfile({
|
|
1784
|
+
name: "perplexity",
|
|
1785
|
+
baseUrl: "https://api.perplexity.ai",
|
|
1786
|
+
chatCompletionsPath: "/chat/completions",
|
|
1787
|
+
envVars: ["PERPLEXITY_API_KEY"],
|
|
1788
|
+
fallbackModels: ["sonar-pro", "sonar"],
|
|
1789
|
+
hostname: "api.perplexity.ai"
|
|
1790
|
+
});
|
|
1791
|
+
|
|
1792
|
+
// src/internal/providers/builtin/together.ts
|
|
1793
|
+
var TOGETHER = openAiCompatibleProfile({
|
|
1794
|
+
name: "together",
|
|
1795
|
+
aliases: ["togetherai"],
|
|
1796
|
+
baseUrl: "https://api.together.xyz/v1",
|
|
1797
|
+
envVars: ["TOGETHER_API_KEY"],
|
|
1798
|
+
fallbackModels: ["Qwen/Qwen2.5-7B-Instruct-Turbo"],
|
|
1799
|
+
hostname: "api.together.xyz"
|
|
1800
|
+
});
|
|
1801
|
+
|
|
1802
|
+
// src/internal/providers/builtin/vertex.ts
|
|
1803
|
+
var VERTEX = {
|
|
1804
|
+
name: "vertex",
|
|
1805
|
+
apiMode: "anthropic_messages",
|
|
1806
|
+
// sub-dispatched in selectTransport by profile.name
|
|
1807
|
+
envVars: ["GOOGLE_APPLICATION_CREDENTIALS"],
|
|
1808
|
+
authType: "gcp_oauth",
|
|
1809
|
+
baseUrl: "https://us-central1-aiplatform.googleapis.com",
|
|
1810
|
+
modelsUrl: void 0,
|
|
1811
|
+
hostname: "aiplatform.googleapis.com",
|
|
1812
|
+
fallbackModels: [
|
|
1813
|
+
"vertex/anthropic/claude-sonnet-4-5@20250929",
|
|
1814
|
+
"vertex/google/gemini-2.0-flash-001"
|
|
1815
|
+
]
|
|
1816
|
+
};
|
|
1817
|
+
function resolveVertexBaseUrl(opts) {
|
|
1818
|
+
const host = opts.location === "global" ? "aiplatform.googleapis.com" : `${opts.location}-aiplatform.googleapis.com`;
|
|
1819
|
+
if (opts.modelDialect === "gemini") {
|
|
1820
|
+
return `https://${host}/v1/projects/${opts.projectId}/locations/${opts.location}/endpoints/openapi`;
|
|
1821
|
+
}
|
|
1822
|
+
return `https://${host}/v1/projects/${opts.projectId}/locations/${opts.location}/publishers/anthropic`;
|
|
1823
|
+
}
|
|
1824
|
+
function inferModelDialect(modelId) {
|
|
1825
|
+
if (modelId.includes("/anthropic/")) return "anthropic";
|
|
1826
|
+
if (modelId.includes("/google/")) return "gemini";
|
|
1827
|
+
return "gemini";
|
|
1828
|
+
}
|
|
1829
|
+
function stripVertexPrefix(modelId) {
|
|
1830
|
+
return modelId.replace(/^vertex\/(anthropic|google)\//, "");
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
// src/internal/providers/builtin/xai.ts
|
|
1834
|
+
var XAI = openAiCompatibleProfile({
|
|
1835
|
+
name: "xai",
|
|
1836
|
+
aliases: ["grok"],
|
|
1837
|
+
baseUrl: "https://api.x.ai/v1",
|
|
1838
|
+
envVars: ["XAI_API_KEY"],
|
|
1839
|
+
fallbackModels: ["grok-4.5", "grok-4.3"],
|
|
1840
|
+
hostname: "api.x.ai"
|
|
1841
|
+
});
|
|
1842
|
+
|
|
1843
|
+
// src/internal/providers/builtin/index.ts
|
|
1844
|
+
var _registeredState = globalSingleton("theokit-sdk.providers.builtins-registered", () => ({
|
|
1845
|
+
done: false
|
|
1846
|
+
}));
|
|
1847
|
+
function registerBuiltins() {
|
|
1848
|
+
if (_registeredState.done) return;
|
|
1849
|
+
_registeredState.done = true;
|
|
1850
|
+
registerProvider(ANTHROPIC);
|
|
1851
|
+
registerProvider(OPENAI);
|
|
1852
|
+
registerProvider(OPENAI_CHATGPT);
|
|
1853
|
+
registerProvider(OPENROUTER);
|
|
1854
|
+
registerProvider(GEMINI);
|
|
1855
|
+
registerProvider(OLLAMA);
|
|
1856
|
+
registerProvider(LMSTUDIO);
|
|
1857
|
+
registerProvider(LLAMACPP);
|
|
1858
|
+
registerProvider(BEDROCK);
|
|
1859
|
+
registerProvider(VERTEX);
|
|
1860
|
+
registerProvider(GOOGLE);
|
|
1861
|
+
registerProvider(MISTRAL);
|
|
1862
|
+
registerProvider(GROQ);
|
|
1863
|
+
registerProvider(COHERE);
|
|
1864
|
+
registerProvider(DEEPINFRA);
|
|
1865
|
+
registerProvider(TOGETHER);
|
|
1866
|
+
registerProvider(XAI);
|
|
1867
|
+
registerProvider(PERPLEXITY);
|
|
1868
|
+
registerProvider(CEREBRAS);
|
|
1869
|
+
registerCatalogProviders();
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
export { catalogModelSchema, getCatalogCapabilities, getCatalogModelInfo, getProviderProfile, inferModelDialect, inferRegionFromModelId, isPatchedModelKey, listProviders, loadProviderCatalog, patchModelInfo, registerBuiltins, registerProvider, resolveBedrockBaseUrl, resolveVertexBaseUrl, stripBedrockPrefix, stripVertexPrefix };
|
|
1873
|
+
//# sourceMappingURL=chunk-SVCPJRUB.js.map
|
|
1874
|
+
//# sourceMappingURL=chunk-SVCPJRUB.js.map
|