llm-zoo 1.0.0
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/LICENSE +21 -0
- package/README.md +269 -0
- package/dist/index-CQCjbg9k.d.cts +226 -0
- package/dist/index-CQCjbg9k.d.ts +226 -0
- package/dist/index.cjs +1778 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +260 -0
- package/dist/index.d.ts +260 -0
- package/dist/index.js +1733 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/index.cjs +1535 -0
- package/dist/providers/index.cjs.map +1 -0
- package/dist/providers/index.d.cts +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +1523 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/schemas.cjs +61 -0
- package/dist/schemas.cjs.map +1 -0
- package/dist/schemas.d.cts +355 -0
- package/dist/schemas.d.ts +355 -0
- package/dist/schemas.js +55 -0
- package/dist/schemas.js.map +1 -0
- package/package.json +91 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { M as ModelConfig, a as ModelProvider, b as ModelCapabilities } from './index-CQCjbg9k.js';
|
|
2
|
+
export { A as ANTHROPIC_MODELS, C as COPILOT_MODELS, h as DASHSCOPE_MODELS, f as DEEPSEEK_MODELS, c as DEFAULT_CONTEXT_WINDOW, D as DEFAULT_MODEL_CAPABILITIES, G as GOOGLE_MODELS, g as MOONSHOT_MODELS, e as OPENAI_DEEP_RESEARCH_MODELS, O as OPENAI_MODELS, d as OPENAI_REASONING_MODELS, i as OTHER_MODELS, R as ReasoningEffort, X as XAI_MODELS } from './index-CQCjbg9k.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Central registry of all available language model configurations.
|
|
6
|
+
* This module aggregates model configurations from all providers and
|
|
7
|
+
* exports them as a unified registry.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Complete registry of all available model configurations.
|
|
14
|
+
* Models are indexed by their short name (e.g., "sonnet45", "gpt4o").
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { MODEL_CONFIGS } from 'llm-model-registry';
|
|
19
|
+
*
|
|
20
|
+
* const sonnetConfig = MODEL_CONFIGS['sonnet45'];
|
|
21
|
+
* console.log(sonnetConfig.contextWindow); // 200000
|
|
22
|
+
* console.log(sonnetConfig.inputPrice); // 3.0 ($/1M tokens)
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const MODEL_CONFIGS: Record<string, ModelConfig>;
|
|
26
|
+
/**
|
|
27
|
+
* Array of all available model short names.
|
|
28
|
+
* Derived from MODEL_CONFIGS keys.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* import { MODELS } from 'llm-model-registry';
|
|
33
|
+
*
|
|
34
|
+
* console.log(MODELS); // ['opus45T', 'opus45', 'sonnet45', ...]
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const MODELS: string[];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Utility functions for working with model configurations.
|
|
41
|
+
* @packageDocumentation
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get a model by short name.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const claude = lookup('sonnet45');
|
|
50
|
+
* const gpt = lookup('gpt4o');
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare function lookup(name: string): ModelConfig | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve a model by its full API identifier.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const model = resolve('claude-sonnet-4-5');
|
|
60
|
+
* const model2 = resolve('gpt-4o-2024-11-20');
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare function resolve(fullName: string): ModelConfig | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Check if a model exists.
|
|
66
|
+
*/
|
|
67
|
+
declare function exists(name: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get all models from a provider.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* const claudeModels = from(ModelProvider.ANTHROPIC);
|
|
74
|
+
* const geminiModels = from(ModelProvider.GOOGLE);
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
declare function from(provider: ModelProvider): ModelConfig[];
|
|
78
|
+
/**
|
|
79
|
+
* Find models matching a capability predicate.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* // Vision + reasoning models
|
|
84
|
+
* const smart = where(c => c.supportsVision && c.supportsReasoning);
|
|
85
|
+
*
|
|
86
|
+
* // Models with great caching
|
|
87
|
+
* const cached = where(c => c.cacheDiscountFactor <= 0.1);
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare function where(predicate: (capabilities: ModelCapabilities) => boolean): ModelConfig[];
|
|
91
|
+
/**
|
|
92
|
+
* Get models supporting a specific capability.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const reasoners = supporting('supportsReasoning');
|
|
97
|
+
* const visionaries = supporting('supportsVision');
|
|
98
|
+
* const coders = supporting('supportsNativeCodeExecution');
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
declare function supporting(capability: keyof ModelCapabilities): ModelConfig[];
|
|
102
|
+
/**
|
|
103
|
+
* Filter by context window size.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* const longContext = withContext(200000); // 200K+ context
|
|
108
|
+
* const million = withContext(1000000); // 1M+ context
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
declare function withContext(minTokens: number): ModelConfig[];
|
|
112
|
+
/**
|
|
113
|
+
* Get models accessible via direct API (not OpenRouter-only).
|
|
114
|
+
*/
|
|
115
|
+
declare function directAccess(): ModelConfig[];
|
|
116
|
+
/**
|
|
117
|
+
* Get models only available through OpenRouter.
|
|
118
|
+
*/
|
|
119
|
+
declare function openRouterOnly(): ModelConfig[];
|
|
120
|
+
/**
|
|
121
|
+
* Calculate exact cost for a request.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* // Basic usage
|
|
126
|
+
* const price = cost('sonnet45', { input: 10000, output: 5000 });
|
|
127
|
+
*
|
|
128
|
+
* // With prompt caching
|
|
129
|
+
* const cached = cost('sonnet45', {
|
|
130
|
+
* input: 10000,
|
|
131
|
+
* output: 5000,
|
|
132
|
+
* cached: 8000 // 8K tokens were cache hits
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
declare function cost(model: ModelConfig | string, tokens: {
|
|
137
|
+
input: number;
|
|
138
|
+
output: number;
|
|
139
|
+
cached?: number;
|
|
140
|
+
}): number;
|
|
141
|
+
/**
|
|
142
|
+
* Estimate worst-case cost (max output tokens).
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* const worst = maxCost('gpt4o', 50000);
|
|
147
|
+
* console.log(`Budget up to $${worst.toFixed(2)}`);
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
declare function maxCost(model: ModelConfig | string, inputTokens: number): number;
|
|
151
|
+
/**
|
|
152
|
+
* Compare cost across models for the same workload.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const comparison = compareCosts(
|
|
157
|
+
* ['sonnet45', 'gpt4o', 'gemini25p'],
|
|
158
|
+
* { input: 10000, output: 2000 }
|
|
159
|
+
* );
|
|
160
|
+
* // Returns sorted by cost: [{ model, cost }, ...]
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
declare function compareCosts(models: (ModelConfig | string)[], tokens: {
|
|
164
|
+
input: number;
|
|
165
|
+
output: number;
|
|
166
|
+
cached?: number;
|
|
167
|
+
}): {
|
|
168
|
+
model: ModelConfig;
|
|
169
|
+
cost: number;
|
|
170
|
+
}[];
|
|
171
|
+
/**
|
|
172
|
+
* Find the cheapest model meeting your requirements.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```typescript
|
|
176
|
+
* // Cheapest with vision
|
|
177
|
+
* const budget = cheapest({ supportsVision: true });
|
|
178
|
+
*
|
|
179
|
+
* // Cheapest reasoning model with 100K+ context
|
|
180
|
+
* const thinker = cheapest(
|
|
181
|
+
* { supportsReasoning: true },
|
|
182
|
+
* { minContext: 100000 }
|
|
183
|
+
* );
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
declare function cheapest(capabilities: Partial<ModelCapabilities>, options?: {
|
|
187
|
+
minContext?: number;
|
|
188
|
+
provider?: ModelProvider;
|
|
189
|
+
}): ModelConfig | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* Find the most capable model within a budget.
|
|
192
|
+
* Returns the priciest model under the limit (more expensive = usually better).
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```typescript
|
|
196
|
+
* // Best model under $5/1M combined tokens
|
|
197
|
+
* const best = smartpick(5);
|
|
198
|
+
*
|
|
199
|
+
* // Best reasoning model under $10
|
|
200
|
+
* const bestReasoner = smartpick(10, { supportsReasoning: true });
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
declare function smartpick(maxPricePerMillion: number, capabilities?: Partial<ModelCapabilities>): ModelConfig | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* Rank models by a metric.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* const byPrice = ranked('price'); // Cheapest first
|
|
210
|
+
* const byContext = ranked('context', 'desc'); // Largest context first
|
|
211
|
+
* const byOutput = ranked('output', 'desc'); // Most output first
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
declare function ranked(by: 'price' | 'context' | 'output', order?: 'asc' | 'desc'): ModelConfig[];
|
|
215
|
+
/**
|
|
216
|
+
* Get registry statistics and insights.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```typescript
|
|
220
|
+
* const { totalModels, providers, capabilities } = insights();
|
|
221
|
+
* console.log(`${totalModels} models across ${Object.keys(providers).length} providers`);
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
declare function insights(): {
|
|
225
|
+
totalModels: number;
|
|
226
|
+
providers: Record<ModelProvider, number>;
|
|
227
|
+
capabilities: Record<string, number>;
|
|
228
|
+
pricing: {
|
|
229
|
+
cheapest: ModelConfig;
|
|
230
|
+
mostExpensive: ModelConfig;
|
|
231
|
+
};
|
|
232
|
+
context: {
|
|
233
|
+
smallest: ModelConfig;
|
|
234
|
+
largest: ModelConfig;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/** @deprecated Use `lookup()` instead */
|
|
238
|
+
declare const getModel: typeof lookup;
|
|
239
|
+
/** @deprecated Use `resolve()` instead */
|
|
240
|
+
declare const getModelByFullName: typeof resolve;
|
|
241
|
+
/** @deprecated Use `exists()` instead */
|
|
242
|
+
declare const hasModel: typeof exists;
|
|
243
|
+
/** @deprecated Use `from()` instead */
|
|
244
|
+
declare const getModelsByProvider: typeof from;
|
|
245
|
+
/** @deprecated Use `where()` instead */
|
|
246
|
+
declare const filterByCapability: typeof where;
|
|
247
|
+
/** @deprecated Use `supporting()` instead */
|
|
248
|
+
declare const getModelsWithCapability: typeof supporting;
|
|
249
|
+
/** @deprecated Use `cost()` instead */
|
|
250
|
+
declare function calculateCost(model: ModelConfig | string, inputTokens: number, outputTokens: number, cachedInputTokens?: number): number;
|
|
251
|
+
/** @deprecated Use `maxCost()` instead */
|
|
252
|
+
declare const estimateMaxCost: typeof maxCost;
|
|
253
|
+
/** @deprecated Use `ranked()` instead */
|
|
254
|
+
declare function sortModelsByMetric(metric: 'price' | 'context' | 'output', ascending?: boolean): ModelConfig[];
|
|
255
|
+
/** @deprecated Use `cheapest()` instead */
|
|
256
|
+
declare function findCheapestModel(requirements: Partial<ModelCapabilities>, minContextWindow?: number): ModelConfig | undefined;
|
|
257
|
+
/** @deprecated Use `insights()` instead */
|
|
258
|
+
declare const getRegistryStats: typeof insights;
|
|
259
|
+
|
|
260
|
+
export { MODELS, MODEL_CONFIGS, ModelCapabilities, ModelConfig, ModelProvider, calculateCost, cheapest, compareCosts, cost, directAccess, estimateMaxCost, exists, filterByCapability, findCheapestModel, from, getModel, getModelByFullName, getModelsByProvider, getModelsWithCapability, getRegistryStats, hasModel, insights, lookup, maxCost, openRouterOnly, ranked, resolve, smartpick, sortModelsByMetric, supporting, where, withContext };
|