llm-zoo 1.0.0 → 1.0.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/README.md +9 -10
- package/dist/{index-CQCjbg9k.d.cts → ModelConfig-BlHqDZD6.d.cts} +1 -71
- package/dist/{index-CQCjbg9k.d.ts → ModelConfig-BlHqDZD6.d.ts} +1 -71
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/providers/index.d.cts +73 -1
- package/dist/providers/index.d.ts +73 -1
- package/dist/schemas.cjs +35 -21
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +38 -276
- package/dist/schemas.d.ts +38 -276
- package/dist/schemas.js +35 -21
- package/dist/schemas.js.map +1 -1
- package/package.json +4 -4
package/dist/schemas.d.ts
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { R as ReasoningEffort, M as ModelProvider } from './ModelConfig-BlHqDZD6.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* Zod schemas for
|
|
5
|
-
*
|
|
5
|
+
* Zod v4 validation schemas for llm-zoo types.
|
|
6
|
+
* Requires zod ^4.0.0 as peer dependency.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { ModelConfigSchema } from 'llm-zoo/schemas';
|
|
11
|
+
*
|
|
12
|
+
* const result = ModelConfigSchema.safeParse(myConfig);
|
|
13
|
+
* if (!result.success) {
|
|
14
|
+
* console.error(result.error);
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
6
17
|
*/
|
|
7
18
|
|
|
8
|
-
declare const ReasoningEffortSchema: z.ZodEnum<
|
|
9
|
-
declare const ModelProviderSchema: z.ZodEnum<
|
|
19
|
+
declare const ReasoningEffortSchema: z.ZodEnum<typeof ReasoningEffort>;
|
|
20
|
+
declare const ModelProviderSchema: z.ZodEnum<typeof ModelProvider>;
|
|
21
|
+
/** Feature flags defining model's supported capabilities and behaviors. */
|
|
10
22
|
declare const ModelCapabilitiesSchema: z.ZodObject<{
|
|
11
23
|
supportsFunctionCalling: z.ZodBoolean;
|
|
12
24
|
supportsNativeMCPServer: z.ZodBoolean;
|
|
@@ -17,61 +29,22 @@ declare const ModelCapabilitiesSchema: z.ZodObject<{
|
|
|
17
29
|
cacheDiscountFactor: z.ZodNumber;
|
|
18
30
|
supportsReasoning: z.ZodBoolean;
|
|
19
31
|
supportsInterleavedThinking: z.ZodBoolean;
|
|
20
|
-
|
|
21
|
-
reasoningEffort: z.ZodEnum<["xhigh", "high", "medium", "low", "none"]>;
|
|
32
|
+
reasoningEffort: z.ZodEnum<typeof ReasoningEffort>;
|
|
22
33
|
supportsVision: z.ZodBoolean;
|
|
23
34
|
supportsNativePdf: z.ZodBoolean;
|
|
24
|
-
supportsNativeAudio: z.ZodBoolean;
|
|
25
35
|
supportsAssistantPrefill: z.ZodBoolean;
|
|
26
36
|
supportsPredictiveOutput: z.ZodBoolean;
|
|
27
37
|
supportsTokenCounting: z.ZodBoolean;
|
|
28
38
|
supportsSystemPrompt: z.ZodBoolean;
|
|
29
39
|
supportsIntermDevMsgs: z.ZodBoolean;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
supportsNativeCodeExecution: boolean;
|
|
35
|
-
supportsPromptCaching: boolean;
|
|
36
|
-
supportsAutoPromptCaching: boolean;
|
|
37
|
-
cacheDiscountFactor: number;
|
|
38
|
-
supportsReasoning: boolean;
|
|
39
|
-
supportsInterleavedThinking: boolean;
|
|
40
|
-
supportsReasoningEffort: boolean;
|
|
41
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
42
|
-
supportsVision: boolean;
|
|
43
|
-
supportsNativePdf: boolean;
|
|
44
|
-
supportsNativeAudio: boolean;
|
|
45
|
-
supportsAssistantPrefill: boolean;
|
|
46
|
-
supportsPredictiveOutput: boolean;
|
|
47
|
-
supportsTokenCounting: boolean;
|
|
48
|
-
supportsSystemPrompt: boolean;
|
|
49
|
-
supportsIntermDevMsgs: boolean;
|
|
50
|
-
}, {
|
|
51
|
-
supportsFunctionCalling: boolean;
|
|
52
|
-
supportsNativeMCPServer: boolean;
|
|
53
|
-
supportsNativeWebSearch: boolean;
|
|
54
|
-
supportsNativeCodeExecution: boolean;
|
|
55
|
-
supportsPromptCaching: boolean;
|
|
56
|
-
supportsAutoPromptCaching: boolean;
|
|
57
|
-
cacheDiscountFactor: number;
|
|
58
|
-
supportsReasoning: boolean;
|
|
59
|
-
supportsInterleavedThinking: boolean;
|
|
60
|
-
supportsReasoningEffort: boolean;
|
|
61
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
62
|
-
supportsVision: boolean;
|
|
63
|
-
supportsNativePdf: boolean;
|
|
64
|
-
supportsNativeAudio: boolean;
|
|
65
|
-
supportsAssistantPrefill: boolean;
|
|
66
|
-
supportsPredictiveOutput: boolean;
|
|
67
|
-
supportsTokenCounting: boolean;
|
|
68
|
-
supportsSystemPrompt: boolean;
|
|
69
|
-
supportsIntermDevMsgs: boolean;
|
|
70
|
-
}>;
|
|
40
|
+
supportsReasoningEffort: z.ZodBoolean;
|
|
41
|
+
supportsNativeAudio: z.ZodBoolean;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
/** Complete configuration for a language model instance. */
|
|
71
44
|
declare const ModelConfigSchema: z.ZodObject<{
|
|
72
45
|
name: z.ZodString;
|
|
73
46
|
fullName: z.ZodString;
|
|
74
|
-
provider: z.ZodEnum<
|
|
47
|
+
provider: z.ZodEnum<typeof ModelProvider>;
|
|
75
48
|
maxOutputTokens: z.ZodNumber;
|
|
76
49
|
inputPrice: z.ZodNumber;
|
|
77
50
|
outputPrice: z.ZodNumber;
|
|
@@ -86,132 +59,27 @@ declare const ModelConfigSchema: z.ZodObject<{
|
|
|
86
59
|
cacheDiscountFactor: z.ZodNumber;
|
|
87
60
|
supportsReasoning: z.ZodBoolean;
|
|
88
61
|
supportsInterleavedThinking: z.ZodBoolean;
|
|
89
|
-
|
|
90
|
-
reasoningEffort: z.ZodEnum<["xhigh", "high", "medium", "low", "none"]>;
|
|
62
|
+
reasoningEffort: z.ZodEnum<typeof ReasoningEffort>;
|
|
91
63
|
supportsVision: z.ZodBoolean;
|
|
92
64
|
supportsNativePdf: z.ZodBoolean;
|
|
93
|
-
supportsNativeAudio: z.ZodBoolean;
|
|
94
65
|
supportsAssistantPrefill: z.ZodBoolean;
|
|
95
66
|
supportsPredictiveOutput: z.ZodBoolean;
|
|
96
67
|
supportsTokenCounting: z.ZodBoolean;
|
|
97
68
|
supportsSystemPrompt: z.ZodBoolean;
|
|
98
69
|
supportsIntermDevMsgs: z.ZodBoolean;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
supportsNativeWebSearch: boolean;
|
|
103
|
-
supportsNativeCodeExecution: boolean;
|
|
104
|
-
supportsPromptCaching: boolean;
|
|
105
|
-
supportsAutoPromptCaching: boolean;
|
|
106
|
-
cacheDiscountFactor: number;
|
|
107
|
-
supportsReasoning: boolean;
|
|
108
|
-
supportsInterleavedThinking: boolean;
|
|
109
|
-
supportsReasoningEffort: boolean;
|
|
110
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
111
|
-
supportsVision: boolean;
|
|
112
|
-
supportsNativePdf: boolean;
|
|
113
|
-
supportsNativeAudio: boolean;
|
|
114
|
-
supportsAssistantPrefill: boolean;
|
|
115
|
-
supportsPredictiveOutput: boolean;
|
|
116
|
-
supportsTokenCounting: boolean;
|
|
117
|
-
supportsSystemPrompt: boolean;
|
|
118
|
-
supportsIntermDevMsgs: boolean;
|
|
119
|
-
}, {
|
|
120
|
-
supportsFunctionCalling: boolean;
|
|
121
|
-
supportsNativeMCPServer: boolean;
|
|
122
|
-
supportsNativeWebSearch: boolean;
|
|
123
|
-
supportsNativeCodeExecution: boolean;
|
|
124
|
-
supportsPromptCaching: boolean;
|
|
125
|
-
supportsAutoPromptCaching: boolean;
|
|
126
|
-
cacheDiscountFactor: number;
|
|
127
|
-
supportsReasoning: boolean;
|
|
128
|
-
supportsInterleavedThinking: boolean;
|
|
129
|
-
supportsReasoningEffort: boolean;
|
|
130
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
131
|
-
supportsVision: boolean;
|
|
132
|
-
supportsNativePdf: boolean;
|
|
133
|
-
supportsNativeAudio: boolean;
|
|
134
|
-
supportsAssistantPrefill: boolean;
|
|
135
|
-
supportsPredictiveOutput: boolean;
|
|
136
|
-
supportsTokenCounting: boolean;
|
|
137
|
-
supportsSystemPrompt: boolean;
|
|
138
|
-
supportsIntermDevMsgs: boolean;
|
|
139
|
-
}>;
|
|
70
|
+
supportsReasoningEffort: z.ZodBoolean;
|
|
71
|
+
supportsNativeAudio: z.ZodBoolean;
|
|
72
|
+
}, z.core.$strip>;
|
|
140
73
|
openRouterOnly: z.ZodBoolean;
|
|
141
74
|
openrouterFullName: z.ZodOptional<z.ZodString>;
|
|
142
75
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
143
76
|
requiresResponsesAPI: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
fullName: string;
|
|
147
|
-
provider: "anthropic" | "openai" | "google" | "deepseek" | "xai" | "moonshot" | "dashscope" | "copilot" | "others";
|
|
148
|
-
maxOutputTokens: number;
|
|
149
|
-
inputPrice: number;
|
|
150
|
-
outputPrice: number;
|
|
151
|
-
contextWindow: number;
|
|
152
|
-
capabilities: {
|
|
153
|
-
supportsFunctionCalling: boolean;
|
|
154
|
-
supportsNativeMCPServer: boolean;
|
|
155
|
-
supportsNativeWebSearch: boolean;
|
|
156
|
-
supportsNativeCodeExecution: boolean;
|
|
157
|
-
supportsPromptCaching: boolean;
|
|
158
|
-
supportsAutoPromptCaching: boolean;
|
|
159
|
-
cacheDiscountFactor: number;
|
|
160
|
-
supportsReasoning: boolean;
|
|
161
|
-
supportsInterleavedThinking: boolean;
|
|
162
|
-
supportsReasoningEffort: boolean;
|
|
163
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
164
|
-
supportsVision: boolean;
|
|
165
|
-
supportsNativePdf: boolean;
|
|
166
|
-
supportsNativeAudio: boolean;
|
|
167
|
-
supportsAssistantPrefill: boolean;
|
|
168
|
-
supportsPredictiveOutput: boolean;
|
|
169
|
-
supportsTokenCounting: boolean;
|
|
170
|
-
supportsSystemPrompt: boolean;
|
|
171
|
-
supportsIntermDevMsgs: boolean;
|
|
172
|
-
};
|
|
173
|
-
openRouterOnly: boolean;
|
|
174
|
-
openrouterFullName?: string | undefined;
|
|
175
|
-
baseUrl?: string | undefined;
|
|
176
|
-
requiresResponsesAPI?: boolean | undefined;
|
|
177
|
-
}, {
|
|
178
|
-
name: string;
|
|
179
|
-
fullName: string;
|
|
180
|
-
provider: "anthropic" | "openai" | "google" | "deepseek" | "xai" | "moonshot" | "dashscope" | "copilot" | "others";
|
|
181
|
-
maxOutputTokens: number;
|
|
182
|
-
inputPrice: number;
|
|
183
|
-
outputPrice: number;
|
|
184
|
-
contextWindow: number;
|
|
185
|
-
capabilities: {
|
|
186
|
-
supportsFunctionCalling: boolean;
|
|
187
|
-
supportsNativeMCPServer: boolean;
|
|
188
|
-
supportsNativeWebSearch: boolean;
|
|
189
|
-
supportsNativeCodeExecution: boolean;
|
|
190
|
-
supportsPromptCaching: boolean;
|
|
191
|
-
supportsAutoPromptCaching: boolean;
|
|
192
|
-
cacheDiscountFactor: number;
|
|
193
|
-
supportsReasoning: boolean;
|
|
194
|
-
supportsInterleavedThinking: boolean;
|
|
195
|
-
supportsReasoningEffort: boolean;
|
|
196
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
197
|
-
supportsVision: boolean;
|
|
198
|
-
supportsNativePdf: boolean;
|
|
199
|
-
supportsNativeAudio: boolean;
|
|
200
|
-
supportsAssistantPrefill: boolean;
|
|
201
|
-
supportsPredictiveOutput: boolean;
|
|
202
|
-
supportsTokenCounting: boolean;
|
|
203
|
-
supportsSystemPrompt: boolean;
|
|
204
|
-
supportsIntermDevMsgs: boolean;
|
|
205
|
-
};
|
|
206
|
-
openRouterOnly: boolean;
|
|
207
|
-
openrouterFullName?: string | undefined;
|
|
208
|
-
baseUrl?: string | undefined;
|
|
209
|
-
requiresResponsesAPI?: boolean | undefined;
|
|
210
|
-
}>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
/** Registry of all model configurations. */
|
|
211
79
|
declare const ModelRegistrySchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
212
80
|
name: z.ZodString;
|
|
213
81
|
fullName: z.ZodString;
|
|
214
|
-
provider: z.ZodEnum<
|
|
82
|
+
provider: z.ZodEnum<typeof ModelProvider>;
|
|
215
83
|
maxOutputTokens: z.ZodNumber;
|
|
216
84
|
inputPrice: z.ZodNumber;
|
|
217
85
|
outputPrice: z.ZodNumber;
|
|
@@ -226,130 +94,24 @@ declare const ModelRegistrySchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
226
94
|
cacheDiscountFactor: z.ZodNumber;
|
|
227
95
|
supportsReasoning: z.ZodBoolean;
|
|
228
96
|
supportsInterleavedThinking: z.ZodBoolean;
|
|
229
|
-
|
|
230
|
-
reasoningEffort: z.ZodEnum<["xhigh", "high", "medium", "low", "none"]>;
|
|
97
|
+
reasoningEffort: z.ZodEnum<typeof ReasoningEffort>;
|
|
231
98
|
supportsVision: z.ZodBoolean;
|
|
232
99
|
supportsNativePdf: z.ZodBoolean;
|
|
233
|
-
supportsNativeAudio: z.ZodBoolean;
|
|
234
100
|
supportsAssistantPrefill: z.ZodBoolean;
|
|
235
101
|
supportsPredictiveOutput: z.ZodBoolean;
|
|
236
102
|
supportsTokenCounting: z.ZodBoolean;
|
|
237
103
|
supportsSystemPrompt: z.ZodBoolean;
|
|
238
104
|
supportsIntermDevMsgs: z.ZodBoolean;
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
supportsNativeWebSearch: boolean;
|
|
243
|
-
supportsNativeCodeExecution: boolean;
|
|
244
|
-
supportsPromptCaching: boolean;
|
|
245
|
-
supportsAutoPromptCaching: boolean;
|
|
246
|
-
cacheDiscountFactor: number;
|
|
247
|
-
supportsReasoning: boolean;
|
|
248
|
-
supportsInterleavedThinking: boolean;
|
|
249
|
-
supportsReasoningEffort: boolean;
|
|
250
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
251
|
-
supportsVision: boolean;
|
|
252
|
-
supportsNativePdf: boolean;
|
|
253
|
-
supportsNativeAudio: boolean;
|
|
254
|
-
supportsAssistantPrefill: boolean;
|
|
255
|
-
supportsPredictiveOutput: boolean;
|
|
256
|
-
supportsTokenCounting: boolean;
|
|
257
|
-
supportsSystemPrompt: boolean;
|
|
258
|
-
supportsIntermDevMsgs: boolean;
|
|
259
|
-
}, {
|
|
260
|
-
supportsFunctionCalling: boolean;
|
|
261
|
-
supportsNativeMCPServer: boolean;
|
|
262
|
-
supportsNativeWebSearch: boolean;
|
|
263
|
-
supportsNativeCodeExecution: boolean;
|
|
264
|
-
supportsPromptCaching: boolean;
|
|
265
|
-
supportsAutoPromptCaching: boolean;
|
|
266
|
-
cacheDiscountFactor: number;
|
|
267
|
-
supportsReasoning: boolean;
|
|
268
|
-
supportsInterleavedThinking: boolean;
|
|
269
|
-
supportsReasoningEffort: boolean;
|
|
270
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
271
|
-
supportsVision: boolean;
|
|
272
|
-
supportsNativePdf: boolean;
|
|
273
|
-
supportsNativeAudio: boolean;
|
|
274
|
-
supportsAssistantPrefill: boolean;
|
|
275
|
-
supportsPredictiveOutput: boolean;
|
|
276
|
-
supportsTokenCounting: boolean;
|
|
277
|
-
supportsSystemPrompt: boolean;
|
|
278
|
-
supportsIntermDevMsgs: boolean;
|
|
279
|
-
}>;
|
|
105
|
+
supportsReasoningEffort: z.ZodBoolean;
|
|
106
|
+
supportsNativeAudio: z.ZodBoolean;
|
|
107
|
+
}, z.core.$strip>;
|
|
280
108
|
openRouterOnly: z.ZodBoolean;
|
|
281
109
|
openrouterFullName: z.ZodOptional<z.ZodString>;
|
|
282
110
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
283
111
|
requiresResponsesAPI: z.ZodOptional<z.ZodBoolean>;
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
maxOutputTokens: number;
|
|
289
|
-
inputPrice: number;
|
|
290
|
-
outputPrice: number;
|
|
291
|
-
contextWindow: number;
|
|
292
|
-
capabilities: {
|
|
293
|
-
supportsFunctionCalling: boolean;
|
|
294
|
-
supportsNativeMCPServer: boolean;
|
|
295
|
-
supportsNativeWebSearch: boolean;
|
|
296
|
-
supportsNativeCodeExecution: boolean;
|
|
297
|
-
supportsPromptCaching: boolean;
|
|
298
|
-
supportsAutoPromptCaching: boolean;
|
|
299
|
-
cacheDiscountFactor: number;
|
|
300
|
-
supportsReasoning: boolean;
|
|
301
|
-
supportsInterleavedThinking: boolean;
|
|
302
|
-
supportsReasoningEffort: boolean;
|
|
303
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
304
|
-
supportsVision: boolean;
|
|
305
|
-
supportsNativePdf: boolean;
|
|
306
|
-
supportsNativeAudio: boolean;
|
|
307
|
-
supportsAssistantPrefill: boolean;
|
|
308
|
-
supportsPredictiveOutput: boolean;
|
|
309
|
-
supportsTokenCounting: boolean;
|
|
310
|
-
supportsSystemPrompt: boolean;
|
|
311
|
-
supportsIntermDevMsgs: boolean;
|
|
312
|
-
};
|
|
313
|
-
openRouterOnly: boolean;
|
|
314
|
-
openrouterFullName?: string | undefined;
|
|
315
|
-
baseUrl?: string | undefined;
|
|
316
|
-
requiresResponsesAPI?: boolean | undefined;
|
|
317
|
-
}, {
|
|
318
|
-
name: string;
|
|
319
|
-
fullName: string;
|
|
320
|
-
provider: "anthropic" | "openai" | "google" | "deepseek" | "xai" | "moonshot" | "dashscope" | "copilot" | "others";
|
|
321
|
-
maxOutputTokens: number;
|
|
322
|
-
inputPrice: number;
|
|
323
|
-
outputPrice: number;
|
|
324
|
-
contextWindow: number;
|
|
325
|
-
capabilities: {
|
|
326
|
-
supportsFunctionCalling: boolean;
|
|
327
|
-
supportsNativeMCPServer: boolean;
|
|
328
|
-
supportsNativeWebSearch: boolean;
|
|
329
|
-
supportsNativeCodeExecution: boolean;
|
|
330
|
-
supportsPromptCaching: boolean;
|
|
331
|
-
supportsAutoPromptCaching: boolean;
|
|
332
|
-
cacheDiscountFactor: number;
|
|
333
|
-
supportsReasoning: boolean;
|
|
334
|
-
supportsInterleavedThinking: boolean;
|
|
335
|
-
supportsReasoningEffort: boolean;
|
|
336
|
-
reasoningEffort: "xhigh" | "high" | "medium" | "low" | "none";
|
|
337
|
-
supportsVision: boolean;
|
|
338
|
-
supportsNativePdf: boolean;
|
|
339
|
-
supportsNativeAudio: boolean;
|
|
340
|
-
supportsAssistantPrefill: boolean;
|
|
341
|
-
supportsPredictiveOutput: boolean;
|
|
342
|
-
supportsTokenCounting: boolean;
|
|
343
|
-
supportsSystemPrompt: boolean;
|
|
344
|
-
supportsIntermDevMsgs: boolean;
|
|
345
|
-
};
|
|
346
|
-
openRouterOnly: boolean;
|
|
347
|
-
openrouterFullName?: string | undefined;
|
|
348
|
-
baseUrl?: string | undefined;
|
|
349
|
-
requiresResponsesAPI?: boolean | undefined;
|
|
350
|
-
}>>;
|
|
351
|
-
type ModelCapabilitiesZ = z.infer<typeof ModelCapabilitiesSchema>;
|
|
352
|
-
type ModelConfigZ = z.infer<typeof ModelConfigSchema>;
|
|
353
|
-
type ModelRegistryZ = z.infer<typeof ModelRegistrySchema>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
type ModelCapabilitiesSchemaType = z.infer<typeof ModelCapabilitiesSchema>;
|
|
114
|
+
type ModelConfigSchemaType = z.infer<typeof ModelConfigSchema>;
|
|
115
|
+
type ModelRegistrySchemaType = z.infer<typeof ModelRegistrySchema>;
|
|
354
116
|
|
|
355
|
-
export { ModelCapabilitiesSchema, type
|
|
117
|
+
export { ModelCapabilitiesSchema, type ModelCapabilitiesSchemaType, ModelConfigSchema, type ModelConfigSchemaType, ModelProviderSchema, ModelRegistrySchema, type ModelRegistrySchemaType, ReasoningEffortSchema };
|
package/dist/schemas.js
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
// src/schemas.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]
|
|
4
|
+
|
|
5
|
+
// src/ModelConfig.ts
|
|
6
|
+
var ReasoningEffort = /* @__PURE__ */ ((ReasoningEffort2) => {
|
|
7
|
+
ReasoningEffort2["XHIGH"] = "xhigh";
|
|
8
|
+
ReasoningEffort2["HIGH"] = "high";
|
|
9
|
+
ReasoningEffort2["MEDIUM"] = "medium";
|
|
10
|
+
ReasoningEffort2["LOW"] = "low";
|
|
11
|
+
ReasoningEffort2["NONE"] = "none";
|
|
12
|
+
return ReasoningEffort2;
|
|
13
|
+
})(ReasoningEffort || {});
|
|
14
|
+
var ModelProvider = /* @__PURE__ */ ((ModelProvider2) => {
|
|
15
|
+
ModelProvider2["ANTHROPIC"] = "anthropic";
|
|
16
|
+
ModelProvider2["OPENAI"] = "openai";
|
|
17
|
+
ModelProvider2["GOOGLE"] = "google";
|
|
18
|
+
ModelProvider2["DEEPSEEK"] = "deepseek";
|
|
19
|
+
ModelProvider2["XAI"] = "xai";
|
|
20
|
+
ModelProvider2["MOONSHOT"] = "moonshot";
|
|
21
|
+
ModelProvider2["DASHSCOPE"] = "dashscope";
|
|
22
|
+
ModelProvider2["COPILOT"] = "copilot";
|
|
23
|
+
ModelProvider2["OTHERS"] = "others";
|
|
24
|
+
return ModelProvider2;
|
|
25
|
+
})(ModelProvider || {});
|
|
26
|
+
|
|
27
|
+
// src/schemas.ts
|
|
28
|
+
var ReasoningEffortSchema = z.nativeEnum(ReasoningEffort);
|
|
29
|
+
var ModelProviderSchema = z.nativeEnum(ModelProvider);
|
|
16
30
|
var ModelCapabilitiesSchema = z.object({
|
|
17
31
|
supportsFunctionCalling: z.boolean(),
|
|
18
32
|
supportsNativeMCPServer: z.boolean(),
|
|
@@ -20,32 +34,32 @@ var ModelCapabilitiesSchema = z.object({
|
|
|
20
34
|
supportsNativeCodeExecution: z.boolean(),
|
|
21
35
|
supportsPromptCaching: z.boolean(),
|
|
22
36
|
supportsAutoPromptCaching: z.boolean(),
|
|
23
|
-
cacheDiscountFactor: z.number()
|
|
37
|
+
cacheDiscountFactor: z.number(),
|
|
24
38
|
supportsReasoning: z.boolean(),
|
|
25
39
|
supportsInterleavedThinking: z.boolean(),
|
|
26
|
-
supportsReasoningEffort: z.boolean(),
|
|
27
40
|
reasoningEffort: ReasoningEffortSchema,
|
|
28
41
|
supportsVision: z.boolean(),
|
|
29
42
|
supportsNativePdf: z.boolean(),
|
|
30
|
-
supportsNativeAudio: z.boolean(),
|
|
31
43
|
supportsAssistantPrefill: z.boolean(),
|
|
32
44
|
supportsPredictiveOutput: z.boolean(),
|
|
33
45
|
supportsTokenCounting: z.boolean(),
|
|
34
46
|
supportsSystemPrompt: z.boolean(),
|
|
35
|
-
supportsIntermDevMsgs: z.boolean()
|
|
47
|
+
supportsIntermDevMsgs: z.boolean(),
|
|
48
|
+
supportsReasoningEffort: z.boolean(),
|
|
49
|
+
supportsNativeAudio: z.boolean()
|
|
36
50
|
});
|
|
37
51
|
var ModelConfigSchema = z.object({
|
|
38
52
|
name: z.string(),
|
|
39
53
|
fullName: z.string(),
|
|
40
54
|
provider: ModelProviderSchema,
|
|
41
|
-
maxOutputTokens: z.number()
|
|
42
|
-
inputPrice: z.number()
|
|
43
|
-
outputPrice: z.number()
|
|
44
|
-
contextWindow: z.number()
|
|
55
|
+
maxOutputTokens: z.number(),
|
|
56
|
+
inputPrice: z.number(),
|
|
57
|
+
outputPrice: z.number(),
|
|
58
|
+
contextWindow: z.number(),
|
|
45
59
|
capabilities: ModelCapabilitiesSchema,
|
|
46
60
|
openRouterOnly: z.boolean(),
|
|
47
61
|
openrouterFullName: z.string().optional(),
|
|
48
|
-
baseUrl: z.string().
|
|
62
|
+
baseUrl: z.string().optional(),
|
|
49
63
|
requiresResponsesAPI: z.boolean().optional()
|
|
50
64
|
});
|
|
51
65
|
var ModelRegistrySchema = z.record(z.string(), ModelConfigSchema);
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas.ts"],"names":[],"mappings":";;;AAWO,IAAM,qBAAA,GAAwB,EAAE,IAAA,CAAK,CAAC,SAAS,MAAA,EAAQ,QAAA,EAAU,KAAA,EAAO,MAAM,CAAC;AAE/E,IAAM,mBAAA,GAAsB,EAAE,IAAA,CAAK;AAAA,EACxC,WAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,uBAAA,GAA0B,EAAE,MAAA,CAAO;AAAA,EAC9C,uBAAA,EAAyB,EAAE,OAAA,EAAQ;AAAA,EACnC,uBAAA,EAAyB,EAAE,OAAA,EAAQ;AAAA,EACnC,uBAAA,EAAyB,EAAE,OAAA,EAAQ;AAAA,EACnC,2BAAA,EAA6B,EAAE,OAAA,EAAQ;AAAA,EACvC,qBAAA,EAAuB,EAAE,OAAA,EAAQ;AAAA,EACjC,yBAAA,EAA2B,EAAE,OAAA,EAAQ;AAAA,EACrC,mBAAA,EAAqB,EAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,CAAC,CAAA;AAAA,EAC5C,iBAAA,EAAmB,EAAE,OAAA,EAAQ;AAAA,EAC7B,2BAAA,EAA6B,EAAE,OAAA,EAAQ;AAAA,EACvC,uBAAA,EAAyB,EAAE,OAAA,EAAQ;AAAA,EACnC,eAAA,EAAiB,qBAAA;AAAA,EACjB,cAAA,EAAgB,EAAE,OAAA,EAAQ;AAAA,EAC1B,iBAAA,EAAmB,EAAE,OAAA,EAAQ;AAAA,EAC7B,mBAAA,EAAqB,EAAE,OAAA,EAAQ;AAAA,EAC/B,wBAAA,EAA0B,EAAE,OAAA,EAAQ;AAAA,EACpC,wBAAA,EAA0B,EAAE,OAAA,EAAQ;AAAA,EACpC,qBAAA,EAAuB,EAAE,OAAA,EAAQ;AAAA,EACjC,oBAAA,EAAsB,EAAE,OAAA,EAAQ;AAAA,EAChC,qBAAA,EAAuB,EAAE,OAAA;AAC3B,CAAC;AAMM,IAAM,iBAAA,GAAoB,EAAE,MAAA,CAAO;AAAA,EACxC,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,EACf,QAAA,EAAU,EAAE,MAAA,EAAO;AAAA,EACnB,QAAA,EAAU,mBAAA;AAAA,EACV,eAAA,EAAiB,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EACrC,UAAA,EAAY,CAAA,CAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA;AAAA,EAC5B,WAAA,EAAa,CAAA,CAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA;AAAA,EAC7B,aAAA,EAAe,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EACnC,YAAA,EAAc,uBAAA;AAAA,EACd,cAAA,EAAgB,EAAE,OAAA,EAAQ;AAAA,EAC1B,kBAAA,EAAoB,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EACxC,SAAS,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,GAAM,QAAA,EAAS;AAAA,EACnC,oBAAA,EAAsB,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AACpC,CAAC;AAMM,IAAM,sBAAsB,CAAA,CAAE,MAAA,CAAO,CAAA,CAAE,MAAA,IAAU,iBAAiB","file":"schemas.js","sourcesContent":["/**\n * Zod schemas for runtime validation of model configurations.\n * @packageDocumentation\n */\n\nimport { z } from 'zod';\n\n// ============================================================================\n// Enums\n// ============================================================================\n\nexport const ReasoningEffortSchema = z.enum(['xhigh', 'high', 'medium', 'low', 'none']);\n\nexport const ModelProviderSchema = z.enum([\n 'anthropic',\n 'openai',\n 'google',\n 'deepseek',\n 'xai',\n 'moonshot',\n 'dashscope',\n 'copilot',\n 'others',\n]);\n\n// ============================================================================\n// Capabilities\n// ============================================================================\n\nexport const ModelCapabilitiesSchema = z.object({\n supportsFunctionCalling: z.boolean(),\n supportsNativeMCPServer: z.boolean(),\n supportsNativeWebSearch: z.boolean(),\n supportsNativeCodeExecution: z.boolean(),\n supportsPromptCaching: z.boolean(),\n supportsAutoPromptCaching: z.boolean(),\n cacheDiscountFactor: z.number().min(0).max(1),\n supportsReasoning: z.boolean(),\n supportsInterleavedThinking: z.boolean(),\n supportsReasoningEffort: z.boolean(),\n reasoningEffort: ReasoningEffortSchema,\n supportsVision: z.boolean(),\n supportsNativePdf: z.boolean(),\n supportsNativeAudio: z.boolean(),\n supportsAssistantPrefill: z.boolean(),\n supportsPredictiveOutput: z.boolean(),\n supportsTokenCounting: z.boolean(),\n supportsSystemPrompt: z.boolean(),\n supportsIntermDevMsgs: z.boolean(),\n});\n\n// ============================================================================\n// Model Config\n// ============================================================================\n\nexport const ModelConfigSchema = z.object({\n name: z.string(),\n fullName: z.string(),\n provider: ModelProviderSchema,\n maxOutputTokens: z.number().positive(),\n inputPrice: z.number().min(0),\n outputPrice: z.number().min(0),\n contextWindow: z.number().positive(),\n capabilities: ModelCapabilitiesSchema,\n openRouterOnly: z.boolean(),\n openrouterFullName: z.string().optional(),\n baseUrl: z.string().url().optional(),\n requiresResponsesAPI: z.boolean().optional(),\n});\n\n// ============================================================================\n// Registry\n// ============================================================================\n\nexport const ModelRegistrySchema = z.record(z.string(), ModelConfigSchema);\n\n// ============================================================================\n// Inferred Types (for reference)\n// ============================================================================\n\nexport type ModelCapabilitiesZ = z.infer<typeof ModelCapabilitiesSchema>;\nexport type ModelConfigZ = z.infer<typeof ModelConfigSchema>;\nexport type ModelRegistryZ = z.infer<typeof ModelRegistrySchema>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ModelConfig.ts","../src/schemas.ts"],"names":["ReasoningEffort","ModelProvider"],"mappings":"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","file":"schemas.js","sourcesContent":["/**\n * Configuration types and constants for language model interactions and capabilities.\n * This module provides a comprehensive type system for describing LLM capabilities,\n * pricing, and provider-specific configurations.\n *\n * @packageDocumentation\n */\n\n/**\n * Default context window size in tokens.\n * Used as fallback when model doesn't specify a custom context window.\n */\nexport const DEFAULT_CONTEXT_WINDOW = 128000;\n\n/**\n * Reasoning effort levels for models that support configurable reasoning depth.\n * Higher effort typically results in better reasoning quality but increased latency and cost.\n */\nexport enum ReasoningEffort {\n /** Extra high reasoning effort - maximum depth analysis */\n XHIGH = 'xhigh',\n /** High reasoning effort - thorough analysis */\n HIGH = 'high',\n /** Medium reasoning effort - balanced analysis */\n MEDIUM = 'medium',\n /** Low reasoning effort - quick analysis */\n LOW = 'low',\n /** No explicit reasoning - standard model behavior */\n NONE = 'none',\n}\n\n/**\n * Supported language model providers.\n * Each provider has specific API formats, capabilities, and pricing structures.\n */\nexport enum ModelProvider {\n /** Anthropic (Claude models) */\n ANTHROPIC = 'anthropic',\n /** OpenAI (GPT, o-series models) */\n OPENAI = 'openai',\n /** Google (Gemini models) */\n GOOGLE = 'google',\n /** DeepSeek (V3, R1 models) */\n DEEPSEEK = 'deepseek',\n /** xAI (Grok models) */\n XAI = 'xai',\n /** Moonshot AI (Kimi models) */\n MOONSHOT = 'moonshot',\n /** Alibaba DashScope (Qwen models) */\n DASHSCOPE = 'dashscope',\n /** GitHub Copilot */\n COPILOT = 'copilot',\n /** Other providers (OpenRouter-only models, etc.) */\n OTHERS = 'others',\n}\n\n/**\n * Feature flags defining a model's supported capabilities and behaviors.\n * These capabilities help determine which features can be used with a specific model.\n */\nexport interface ModelCapabilities {\n /** Whether the model supports function/tool calling */\n supportsFunctionCalling: boolean;\n\n /** Whether the model supports native MCP (Model Context Protocol) servers */\n supportsNativeMCPServer: boolean;\n\n /** Whether the model has built-in web search capability */\n supportsNativeWebSearch: boolean;\n\n /** Whether the model can execute code natively (e.g., Python sandbox) */\n supportsNativeCodeExecution: boolean;\n\n /** Whether the model supports explicit prompt caching */\n supportsPromptCaching: boolean;\n\n /** Whether the model automatically caches prompts without explicit markers */\n supportsAutoPromptCaching: boolean;\n\n /**\n * Cost multiplier for cached tokens (0.0-1.0).\n * Lower values mean greater savings when using cached content.\n * Example: 0.1 means cached tokens cost 10% of normal price.\n */\n cacheDiscountFactor: number;\n\n /** Whether the model supports extended reasoning/thinking */\n supportsReasoning: boolean;\n\n /** Whether reasoning can be interleaved with regular output */\n supportsInterleavedThinking: boolean;\n\n /** Whether the model supports configurable reasoning effort levels */\n supportsReasoningEffort: boolean;\n\n /** Default reasoning effort level when reasoning is enabled */\n reasoningEffort: ReasoningEffort;\n\n /** Whether the model can process images */\n supportsVision: boolean;\n\n /** Whether the model can process PDF documents natively */\n supportsNativePdf: boolean;\n\n /** Whether the model can process audio input natively */\n supportsNativeAudio: boolean;\n\n /** Whether the model supports assistant message prefilling */\n supportsAssistantPrefill: boolean;\n\n /** Whether the model supports predictive/speculative output */\n supportsPredictiveOutput: boolean;\n\n /** Whether the model provides accurate token counting */\n supportsTokenCounting: boolean;\n\n /** Whether the model supports system prompts */\n supportsSystemPrompt: boolean;\n\n /** Whether the model supports intermediate developer messages */\n supportsIntermDevMsgs: boolean;\n}\n\n/**\n * Base model capabilities with sensible defaults.\n * Models should spread this and override specific capabilities.\n */\nexport const DEFAULT_MODEL_CAPABILITIES: ModelCapabilities = {\n supportsFunctionCalling: true,\n supportsNativeMCPServer: false,\n supportsNativeWebSearch: false,\n supportsNativeCodeExecution: false,\n supportsPromptCaching: false,\n supportsAutoPromptCaching: false,\n cacheDiscountFactor: 1.0,\n supportsReasoning: false,\n supportsInterleavedThinking: false,\n reasoningEffort: ReasoningEffort.NONE,\n supportsVision: true,\n supportsNativePdf: false,\n supportsAssistantPrefill: false,\n supportsPredictiveOutput: false,\n supportsTokenCounting: false,\n supportsSystemPrompt: true,\n supportsIntermDevMsgs: false,\n supportsReasoningEffort: false,\n supportsNativeAudio: false,\n};\n\n/**\n * Complete configuration for a language model.\n * Contains all metadata needed to work with the model including\n * pricing, capabilities, and provider-specific settings.\n */\nexport interface ModelConfig {\n /**\n * Short identifier for the model (e.g., \"sonnet45\", \"gpt4o\").\n * Used as the key in the registry and for quick reference.\n */\n name: string;\n\n /**\n * Full API model identifier (e.g., \"claude-sonnet-4-5\", \"gpt-4o-2024-11-20\").\n * This is the actual string sent to the provider's API.\n */\n fullName: string;\n\n /** The model's provider */\n provider: ModelProvider;\n\n /** Maximum tokens the model can generate in a single response */\n maxOutputTokens: number;\n\n /** Cost per million input tokens in USD */\n inputPrice: number;\n\n /** Cost per million output tokens in USD */\n outputPrice: number;\n\n /** Maximum context window size in tokens */\n contextWindow: number;\n\n /** Model capability flags */\n capabilities: ModelCapabilities;\n\n /**\n * Whether this model is only available through OpenRouter.\n * When true, direct API access is not available.\n */\n openRouterOnly: boolean;\n\n /**\n * Model identifier for OpenRouter API.\n * Example: \"anthropic/claude-sonnet-4.5\"\n */\n openrouterFullName?: string;\n\n /**\n * Custom base URL for this specific model.\n * Overrides the provider's default endpoint.\n */\n baseUrl?: string;\n\n /**\n * Whether this model requires OpenAI's Responses API format.\n * Used for special models like deep research that bypass standard chat completions.\n */\n requiresResponsesAPI?: boolean;\n}\n","/**\n * Zod v4 validation schemas for llm-zoo types.\n * Requires zod ^4.0.0 as peer dependency.\n *\n * @example\n * ```typescript\n * import { ModelConfigSchema } from 'llm-zoo/schemas';\n *\n * const result = ModelConfigSchema.safeParse(myConfig);\n * if (!result.success) {\n * console.error(result.error);\n * }\n * ```\n */\n\nimport { z } from 'zod';\nimport { ModelProvider, ReasoningEffort } from './ModelConfig';\n\n// ============================================================================\n// Zod v4 Schemas\n// ============================================================================\n\nexport const ReasoningEffortSchema = z.nativeEnum(ReasoningEffort);\n\nexport const ModelProviderSchema = z.nativeEnum(ModelProvider);\n\n/** Feature flags defining model's supported capabilities and behaviors. */\nexport const ModelCapabilitiesSchema = z.object({\n supportsFunctionCalling: z.boolean(),\n supportsNativeMCPServer: z.boolean(),\n supportsNativeWebSearch: z.boolean(),\n supportsNativeCodeExecution: z.boolean(),\n supportsPromptCaching: z.boolean(),\n supportsAutoPromptCaching: z.boolean(),\n cacheDiscountFactor: z.number(),\n supportsReasoning: z.boolean(),\n supportsInterleavedThinking: z.boolean(),\n reasoningEffort: ReasoningEffortSchema,\n supportsVision: z.boolean(),\n supportsNativePdf: z.boolean(),\n supportsAssistantPrefill: z.boolean(),\n supportsPredictiveOutput: z.boolean(),\n supportsTokenCounting: z.boolean(),\n supportsSystemPrompt: z.boolean(),\n supportsIntermDevMsgs: z.boolean(),\n supportsReasoningEffort: z.boolean(),\n supportsNativeAudio: z.boolean(),\n});\n\n/** Complete configuration for a language model instance. */\nexport const ModelConfigSchema = z.object({\n name: z.string(),\n fullName: z.string(),\n provider: ModelProviderSchema,\n maxOutputTokens: z.number(),\n inputPrice: z.number(),\n outputPrice: z.number(),\n contextWindow: z.number(),\n capabilities: ModelCapabilitiesSchema,\n openRouterOnly: z.boolean(),\n openrouterFullName: z.string().optional(),\n baseUrl: z.string().optional(),\n requiresResponsesAPI: z.boolean().optional(),\n});\n\n/** Registry of all model configurations. */\nexport const ModelRegistrySchema = z.record(z.string(), ModelConfigSchema);\n\n// Export inferred types for convenience\nexport type ModelCapabilitiesSchemaType = z.infer<typeof ModelCapabilitiesSchema>;\nexport type ModelConfigSchemaType = z.infer<typeof ModelConfigSchema>;\nexport type ModelRegistrySchemaType = z.infer<typeof ModelRegistrySchema>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "llm-zoo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "70+ LLM models. Pricing, capabilities, context windows. Always current.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"llm",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
35
|
-
"url": "
|
|
35
|
+
"url": "https://github.com/texra-ai/llm-zoo"
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/texra-ai/llm-zoo",
|
|
38
38
|
"bugs": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"prepublishOnly": "npm run build"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"zod": "^
|
|
75
|
+
"zod": "^4.0.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|
|
78
78
|
"zod": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"tsup": "^8.0.0",
|
|
84
84
|
"typescript": "^5.3.0",
|
|
85
|
-
"zod": "^
|
|
85
|
+
"zod": "^4.0.0"
|
|
86
86
|
},
|
|
87
87
|
"engines": {
|
|
88
88
|
"node": ">=18.0.0"
|