@anolilab/ai-model-registry 1.3.0 → 2.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.
Files changed (149) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE.md +8 -13
  3. package/MIGRATION.md +474 -0
  4. package/README.md +275 -200
  5. package/dist/icons-sprite.d.ts +1 -1
  6. package/dist/icons-sprite.js +11 -11
  7. package/dist/index.d.ts +16 -16
  8. package/dist/index.js +1 -16
  9. package/dist/packem_chunks/alibaba.js +1 -0
  10. package/dist/packem_chunks/amazon-bedrock.js +1 -0
  11. package/dist/packem_chunks/anthropic.js +1 -0
  12. package/dist/packem_chunks/api.js +75 -0
  13. package/dist/packem_chunks/azure-open-ai.js +1 -0
  14. package/dist/packem_chunks/cerebras.js +1 -0
  15. package/dist/packem_chunks/chutes.js +1 -0
  16. package/dist/packem_chunks/cloudflare.js +3 -0
  17. package/dist/packem_chunks/deep-infra.js +1 -0
  18. package/dist/packem_chunks/deep-seek.js +1 -0
  19. package/dist/packem_chunks/fireworks-ai.js +1 -0
  20. package/dist/packem_chunks/git-hub-copilot.js +1 -0
  21. package/dist/packem_chunks/git-hub-models.js +1 -0
  22. package/dist/packem_chunks/google-partner.js +1 -0
  23. package/dist/packem_chunks/google-vertex.js +1 -0
  24. package/dist/packem_chunks/google.js +1 -0
  25. package/dist/packem_chunks/groq.js +1 -0
  26. package/dist/packem_chunks/hugging-face.js +1 -0
  27. package/dist/packem_chunks/inception.js +1 -0
  28. package/dist/packem_chunks/inference.js +1 -0
  29. package/dist/packem_chunks/meta.js +1 -0
  30. package/dist/packem_chunks/mistral.js +1 -0
  31. package/dist/packem_chunks/model-scope.js +1 -0
  32. package/dist/packem_chunks/morph.js +1 -0
  33. package/dist/packem_chunks/open-ai.js +1 -0
  34. package/dist/packem_chunks/open-router.js +1 -0
  35. package/dist/packem_chunks/providers.js +1 -0
  36. package/dist/packem_chunks/requesty.js +73 -0
  37. package/dist/packem_chunks/together-ai.js +1 -0
  38. package/dist/packem_chunks/upstage.js +1 -0
  39. package/dist/packem_chunks/v0.js +1 -0
  40. package/dist/packem_chunks/venice.js +1 -0
  41. package/dist/packem_chunks/vercel.js +1 -0
  42. package/dist/packem_chunks/weights-_-biases.js +1 -0
  43. package/dist/packem_chunks/xai.js +1 -0
  44. package/dist/schema.d.ts +1 -1
  45. package/dist/schema.js +1 -1
  46. package/dist/types/alibaba.d.ts +6 -0
  47. package/dist/types/alibaba.js +0 -0
  48. package/dist/types/amazon-bedrock.d.ts +6 -0
  49. package/dist/types/amazon-bedrock.js +0 -0
  50. package/dist/types/anthropic.d.ts +6 -0
  51. package/dist/types/anthropic.js +0 -0
  52. package/dist/types/azure-open-ai.d.ts +6 -0
  53. package/dist/types/azure-open-ai.js +0 -0
  54. package/dist/types/cerebras.d.ts +6 -0
  55. package/dist/types/cerebras.js +0 -0
  56. package/dist/types/chutes.d.ts +6 -0
  57. package/dist/types/chutes.js +0 -0
  58. package/dist/types/cloudflare.d.ts +6 -0
  59. package/dist/types/cloudflare.js +0 -0
  60. package/dist/types/deep-infra.d.ts +6 -0
  61. package/dist/types/deep-infra.js +0 -0
  62. package/dist/types/deep-seek.d.ts +6 -0
  63. package/dist/types/deep-seek.js +0 -0
  64. package/dist/types/fireworks-ai.d.ts +6 -0
  65. package/dist/types/fireworks-ai.js +0 -0
  66. package/dist/types/git-hub-copilot.d.ts +6 -0
  67. package/dist/types/git-hub-copilot.js +0 -0
  68. package/dist/types/git-hub-models.d.ts +6 -0
  69. package/dist/types/git-hub-models.js +0 -0
  70. package/dist/types/google-partner.d.ts +6 -0
  71. package/dist/types/google-partner.js +0 -0
  72. package/dist/types/google-vertex.d.ts +6 -0
  73. package/dist/types/google-vertex.js +0 -0
  74. package/dist/types/google.d.ts +6 -0
  75. package/dist/types/google.js +0 -0
  76. package/dist/types/groq.d.ts +6 -0
  77. package/dist/types/groq.js +0 -0
  78. package/dist/types/hugging-face.d.ts +6 -0
  79. package/dist/types/hugging-face.js +0 -0
  80. package/dist/types/inception.d.ts +6 -0
  81. package/dist/types/inception.js +0 -0
  82. package/dist/types/inference.d.ts +6 -0
  83. package/dist/types/inference.js +0 -0
  84. package/dist/types/meta.d.ts +6 -0
  85. package/dist/types/meta.js +0 -0
  86. package/dist/types/mistral.d.ts +6 -0
  87. package/dist/types/mistral.js +0 -0
  88. package/dist/types/model-scope.d.ts +6 -0
  89. package/dist/types/model-scope.js +0 -0
  90. package/dist/types/morph.d.ts +6 -0
  91. package/dist/types/morph.js +0 -0
  92. package/dist/types/open-ai.d.ts +6 -0
  93. package/dist/types/open-ai.js +0 -0
  94. package/dist/types/open-router.d.ts +6 -0
  95. package/dist/types/open-router.js +0 -0
  96. package/dist/types/providers.d.ts +11 -0
  97. package/dist/types/providers.js +1 -0
  98. package/dist/types/requesty.d.ts +6 -0
  99. package/dist/types/requesty.js +0 -0
  100. package/dist/types/together-ai.d.ts +6 -0
  101. package/dist/types/together-ai.js +0 -0
  102. package/dist/types/upstage.d.ts +6 -0
  103. package/dist/types/upstage.js +0 -0
  104. package/dist/types/v0.d.ts +6 -0
  105. package/dist/types/v0.js +0 -0
  106. package/dist/types/venice.d.ts +6 -0
  107. package/dist/types/venice.js +0 -0
  108. package/dist/types/vercel.d.ts +6 -0
  109. package/dist/types/vercel.js +0 -0
  110. package/dist/types/weights-_-biases.d.ts +6 -0
  111. package/dist/types/weights-_-biases.js +0 -0
  112. package/dist/types/xai.d.ts +6 -0
  113. package/dist/types/xai.js +0 -0
  114. package/package.json +7 -2
  115. package/public/alibaba.json +326 -0
  116. package/public/amazon-bedrock.json +2141 -0
  117. package/public/anthropic.json +396 -0
  118. package/public/api.json +66961 -19318
  119. package/public/azure-open-ai.json +332 -0
  120. package/public/cerebras.json +288 -0
  121. package/public/chutes.json +3220 -0
  122. package/public/cloudflare.json +3094 -0
  123. package/public/deep-infra.json +956 -0
  124. package/public/deep-seek.json +46 -0
  125. package/public/fireworks-ai.json +14486 -0
  126. package/public/git-hub-copilot.json +676 -0
  127. package/public/git-hub-models.json +256 -0
  128. package/public/google-partner.json +536 -0
  129. package/public/google-vertex.json +1376 -0
  130. package/public/google.json +536 -0
  131. package/public/groq.json +882 -0
  132. package/public/hugging-face.json +1096 -0
  133. package/public/inception.json +81 -0
  134. package/public/inference.json +291 -0
  135. package/public/meta.json +151 -0
  136. package/public/mistral.json +2181 -0
  137. package/public/model-scope.json +37839 -0
  138. package/public/morph.json +46 -0
  139. package/public/open-ai.json +606 -0
  140. package/public/open-router.json +15341 -0
  141. package/public/providers.json +43 -0
  142. package/public/requesty.json +13757 -0
  143. package/public/together-ai.json +641 -0
  144. package/public/upstage.json +606 -0
  145. package/public/v0.json +431 -0
  146. package/public/venice.json +501 -0
  147. package/public/vercel.json +4071 -0
  148. package/public/weights-&-biases.json +551 -0
  149. package/public/xai.json +256 -0
package/README.md CHANGED
@@ -1,51 +1,69 @@
1
- # @anolilab/ai-model-registry
1
+ <!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
2
2
 
3
- [![npm version](https://badge.fury.io/js/@anolilab%2Fai-model-registry.svg)](https://badge.fury.io/js/@anolilab%2Fai-model-registry)
4
- [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
5
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.8+-blue.svg)](https://www.typescriptlang.org/)
3
+ <a href="https://www.anolilab.com/open-source" align="center">
6
4
 
7
- A comprehensive, unified registry for AI model providers and their metadata. This package provides a tree-shakable interface to access model information from 50+ AI providers including OpenAI, Anthropic, Google, Meta, Groq, and many others.
5
+ <img src="__assets__/package-og.svg" alt="ai-model-registry" />
8
6
 
9
- ## ✨ Features
7
+ </a>
10
8
 
11
- - **🔄 Unified Interface**: Access models from multiple providers through a single API
12
- - **🛡️ Type Safety**: Full TypeScript support with Zod schema validation
13
- - **📦 Tree Shaking**: Import only what you need to minimize bundle size
14
- - **💰 Rich Metadata**: Comprehensive model information including capabilities, pricing, and limits
15
- - **🔍 Powerful Search**: Advanced search and filtering capabilities across all models
16
- - **🔄 Auto-Sync**: Automatic data synchronization between models with the same ID
17
- - **💸 Pricing Integration**: Real-time pricing data from Helicone API (840+ models)
18
- - **📊 Provider Stats**: Detailed statistics and analytics
9
+ <h3 align="center">Unified registry for AI model providers and their metadata</h3>
19
10
 
20
- ## 📦 Installation
11
+ <!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
21
12
 
22
- ```bash
23
- # Using npm
13
+ <br />
14
+
15
+ <div align="center">
16
+
17
+ [![typescript-image][typescript-badge]][typescript-url]
18
+ [![apache licence][license-badge]][license]
19
+ [![npm downloads][npm-downloads-badge]][npm-downloads]
20
+ [![Chat][chat-badge]][chat]
21
+ [![PRs Welcome][prs-welcome-badge]][prs-welcome]
22
+
23
+ </div>
24
+
25
+ ---
26
+
27
+ <div align="center">
28
+ <p>
29
+ <sup>
30
+ Daniel Bannert's open source work is supported by the community on <a href="https://github.com/sponsors/prisis">GitHub Sponsors</a>
31
+ </sup>
32
+ </p>
33
+ </div>
34
+
35
+ ---
36
+
37
+ ## Install
38
+
39
+ ```sh
24
40
  npm install @anolilab/ai-model-registry
41
+ ```
25
42
 
26
- # Using yarn
43
+ ```sh
27
44
  yarn add @anolilab/ai-model-registry
45
+ ```
28
46
 
29
- # Using pnpm
47
+ ```sh
30
48
  pnpm add @anolilab/ai-model-registry
31
49
  ```
32
50
 
33
- ## 🚀 Quick Start
51
+ ## Usage
34
52
 
35
53
  ```typescript
36
- import { getProviders, getModelsByProvider, getModelById, searchModels, getAllModels } from "@anolilab/ai-model-registry";
54
+ import { getProviders, getModelsByProvider, getModelById, searchModels, getAllModels, type ProviderName } from "@anolilab/ai-model-registry";
37
55
 
38
- // Get all available providers
39
- const providers = getProviders();
56
+ // Get all available providers (async)
57
+ const providers = await getProviders();
40
58
  console.log(providers);
41
59
  // ['Anthropic', 'Google', 'Groq', 'Meta', 'OpenAI', 'DeepSeek', ...]
42
60
 
43
- // Get all models from a specific provider
44
- const anthropicModels = getModelsByProvider("Anthropic");
61
+ // Get all models from a specific provider (type-safe provider name)
62
+ const anthropicModels = await getModelsByProvider("Anthropic" as ProviderName);
45
63
  console.log(`Found ${anthropicModels.length} Anthropic models`);
46
64
 
47
65
  // Get a specific model by ID
48
- const model = getModelById("claude-3-opus-20240229");
66
+ const model = await getModelById("claude-3-opus-20240229");
49
67
  if (model) {
50
68
  console.log(`Model: ${model.name}`);
51
69
  console.log(`Provider: ${model.provider}`);
@@ -54,60 +72,95 @@ if (model) {
54
72
  }
55
73
 
56
74
  // Search for models with specific capabilities
57
- const visionModels = searchModels({ vision: true });
58
- const reasoningModels = searchModels({ reasoning: true });
59
- const toolCallModels = searchModels({ tool_call: true });
75
+ const visionModels = await searchModels({ vision: true });
76
+ const reasoningModels = await searchModels({ reasoning: true });
77
+ const toolCallModels = await searchModels({ tool_call: true });
60
78
 
61
79
  // Get all models for advanced filtering
62
- const allModels = getAllModels();
80
+ const allModels = await getAllModels();
81
+ ```
82
+
83
+ ### Type-Safe Provider and Model Names
84
+
85
+ The package provides TypeScript types for provider names and model IDs:
86
+
87
+ ```typescript
88
+ import type { ProviderName } from "@anolilab/ai-model-registry";
89
+ import type ModelName from "@anolilab/ai-model-registry/types/open-router";
90
+
91
+ // Type-safe provider names
92
+ const provider: ProviderName = "OpenAI"; // ✅ Valid
93
+ const invalid: ProviderName = "InvalidProvider"; // ❌ TypeScript error
94
+
95
+ // Type-safe model IDs for specific providers
96
+ const modelId: ModelName = "meta-llama/llama-3.1-8b-instruct"; // ✅ Valid
97
+ const invalidId: ModelName = "invalid-model"; // ❌ TypeScript error
63
98
  ```
64
99
 
65
- ## 📚 API Reference
100
+ ## Features
101
+
102
+ - Unified interface to access models from multiple providers through a single API
103
+ - Full TypeScript support with Zod schema validation for type safety
104
+ - Type-safe provider names and model IDs with generated union types
105
+ - Dynamic imports for optimal code splitting and tree shaking
106
+ - Provider-specific JSON files for efficient loading
107
+ - Tree shaking support - import only what you need to minimize bundle size
108
+ - Comprehensive model information including capabilities, pricing, and limits
109
+ - Advanced search and filtering capabilities across all models
110
+ - Automatic data synchronization between models with the same ID
111
+ - Real-time pricing data integration from Helicone API (840+ models)
112
+ - Detailed provider statistics and analytics
113
+
114
+ ## API Reference
66
115
 
67
116
  ### Core Functions
68
117
 
69
- #### `getProviders(): string[]`
118
+ All functions are async and use dynamic imports for optimal code splitting.
119
+
120
+ #### `getProviders(): Promise<ProviderName[]>`
70
121
 
71
122
  Returns an array of all available provider names.
72
123
 
73
124
  ```typescript
74
- const providers = getProviders();
125
+ const providers = await getProviders();
75
126
  // ['Anthropic', 'Google', 'Groq', 'Meta', 'OpenAI', ...]
76
127
  ```
77
128
 
78
- #### `getModelsByProvider(provider: string): Model[]`
129
+ #### `getModelsByProvider(provider: ProviderName): Promise<Model[]>`
79
130
 
80
- Returns all models for a specific provider.
131
+ Returns all models for a specific provider. Uses provider-specific JSON files for efficient loading.
81
132
 
82
133
  ```typescript
83
- const openAIModels = getModelsByProvider("OpenAI");
84
- const anthropicModels = getModelsByProvider("Anthropic");
134
+ import type { ProviderName } from "@anolilab/ai-model-registry";
135
+
136
+ const openAIModels = await getModelsByProvider("OpenAI" as ProviderName);
137
+ const anthropicModels = await getModelsByProvider("Anthropic" as ProviderName);
85
138
  ```
86
139
 
87
- #### `getModelById(id: string): Model | undefined`
140
+ #### `getModelById(id: string): Promise<Model | undefined>`
88
141
 
89
142
  Returns a specific model by its ID, or `undefined` if not found.
90
143
 
91
144
  ```typescript
92
- const gpt4 = getModelById("gpt-4");
93
- const claude = getModelById("claude-3-opus-20240229");
145
+ const gpt4 = await getModelById("gpt-4");
146
+ const claude = await getModelById("claude-3-opus-20240229");
94
147
  ```
95
148
 
96
- #### `getAllModels(): Model[]`
149
+ #### `getAllModels(): Promise<Model[]>`
97
150
 
98
- Returns all models (useful for advanced filtering and custom logic).
151
+ Returns all models (useful for advanced filtering and custom logic). Loads all provider files in parallel.
99
152
 
100
153
  ```typescript
101
- const allModels = getAllModels();
154
+ const allModels = await getAllModels();
102
155
  const expensiveModels = allModels.filter((model) => (model.cost.input || 0) > 0.1 || (model.cost.output || 0) > 0.1);
103
156
  ```
104
157
 
105
- #### `getProviderStats(): Record<string, number>`
158
+ #### `getProviderStats(): Promise<Record<ProviderName, number>>`
106
159
 
107
160
  Returns provider statistics with model counts.
108
161
 
109
162
  ```typescript
110
- const stats = getProviderStats();
163
+ const stats = await getProviderStats();
111
164
  console.log(stats);
112
165
  // {
113
166
  // 'OpenAI': 15,
@@ -120,9 +173,9 @@ console.log(stats);
120
173
 
121
174
  ### Advanced Search
122
175
 
123
- #### `searchModels(criteria: SearchCriteria): Model[]`
176
+ #### `searchModels(criteria: SearchCriteria): Promise<Model[]>`
124
177
 
125
- Search models by various criteria with powerful filtering options.
178
+ Search models by various criteria with powerful filtering options. Automatically uses provider-specific files when a provider filter is specified.
126
179
 
127
180
  ```typescript
128
181
  interface SearchCriteria {
@@ -134,7 +187,7 @@ interface SearchCriteria {
134
187
  preview?: boolean;
135
188
 
136
189
  // Provider filter
137
- provider?: string;
190
+ provider?: ProviderName;
138
191
 
139
192
  // Modality filters
140
193
  modalities?: {
@@ -156,41 +209,35 @@ interface SearchCriteria {
156
209
 
157
210
  ```typescript
158
211
  // Find all vision-capable models
159
- const visionModels = searchModels({ vision: true });
212
+ const visionModels = await searchModels({ vision: true });
160
213
 
161
214
  // Find models with reasoning capabilities
162
- const reasoningModels = searchModels({ reasoning: true });
215
+ const reasoningModels = await searchModels({ reasoning: true });
163
216
 
164
217
  // Find models that support tool calling
165
- const toolCallModels = searchModels({ tool_call: true });
218
+ const toolCallModels = await searchModels({ tool_call: true });
166
219
 
167
- // Find models from a specific provider
168
- const openAIModels = searchModels({ provider: "OpenAI" });
220
+ // Find models from a specific provider (uses provider-specific file)
221
+ const openAIModels = await searchModels({ provider: "OpenAI" as ProviderName });
169
222
 
170
223
  // Find models with large context windows
171
- const largeContextModels = searchModels({ context_min: 100000 });
172
-
173
- // Find affordable models
174
- const affordableModels = searchModels({
175
- max_input_cost: 0.01,
176
- max_output_cost: 0.02,
177
- });
224
+ const largeContextModels = await searchModels({ context_min: 100000 });
178
225
 
179
226
  // Find models that accept text and image input
180
- const multimodalModels = searchModels({
227
+ const multimodalModels = await searchModels({
181
228
  modalities: {
182
229
  input: ["text", "image"],
183
230
  },
184
231
  });
185
232
 
186
233
  // Find models with streaming support
187
- const streamingModels = searchModels({ streaming_supported: true });
234
+ const streamingModels = await searchModels({ streaming_supported: true });
188
235
 
189
236
  // Find preview/beta models
190
- const previewModels = searchModels({ preview: true });
237
+ const previewModels = await searchModels({ preview: true });
191
238
  ```
192
239
 
193
- ## 🏗️ Model Schema
240
+ ## Model Schema
194
241
 
195
242
  Each model follows a comprehensive schema with the following structure:
196
243
 
@@ -283,54 +330,154 @@ interface Model {
283
330
  }
284
331
  ```
285
332
 
286
- ## 🌳 Tree Shaking
333
+ ## Tree Shaking and Code Splitting
287
334
 
288
- The package supports tree shaking, so you can import only what you need:
335
+ The package supports tree shaking and uses dynamic imports for optimal code splitting:
289
336
 
290
337
  ```typescript
291
338
  // Only import specific functions
292
- import { getProviders, getModelById } from "@anolilab/ai-model-registry";
339
+ import { getProviders, getModelById, type ProviderName } from "@anolilab/ai-model-registry";
293
340
 
294
341
  // Import schema for validation
295
342
  import { ModelSchema } from "@anolilab/ai-model-registry/schema";
296
343
 
297
344
  // Import icons (if needed)
298
345
  import { getIcon } from "@anolilab/ai-model-registry/icons";
346
+
347
+ // Import provider-specific model ID types
348
+ import type ModelName from "@anolilab/ai-model-registry/types/open-router";
349
+ import type { ProviderName } from "@anolilab/ai-model-registry/types/providers";
299
350
  ```
300
351
 
301
- ## 🏢 Supported Providers
352
+ ### Dynamic Loading
353
+
354
+ The package uses dynamic imports to load provider-specific JSON files on demand:
355
+
356
+ - **Single provider queries**: Only loads the specific provider's JSON file
357
+ - **All models queries**: Loads all provider files in parallel
358
+ - **Automatic caching**: Results are cached to avoid re-loading
359
+ - **Better code splitting**: Bundlers can split provider files into separate chunks
360
+
361
+ ## Supported Providers
302
362
 
303
363
  The registry includes models from 50+ providers:
304
364
 
305
365
  ### Major Providers
306
366
 
307
- - **OpenAI** (GPT-4, GPT-3.5, O1, O3, etc.)
308
- - **Anthropic** (Claude 3.5, Claude 3, Claude 2.1, etc.)
309
- - **Google** (Gemini 2.5, Gemini 1.5, PaLM, etc.)
310
- - **Meta** (Llama 3, Llama 2, Code Llama, etc.)
311
- - **Groq** (Various models with ultra-fast inference)
312
- - **DeepSeek** (DeepSeek R1, DeepSeek V3, etc.)
367
+ - OpenAI (GPT-4, GPT-3.5, O1, O3, etc.)
368
+ - Anthropic (Claude 3.5, Claude 3, Claude 2.1, etc.)
369
+ - Google (Gemini 2.5, Gemini 1.5, PaLM, etc.)
370
+ - Meta (Llama 3, Llama 2, Code Llama, etc.)
371
+ - Groq (Various models with ultra-fast inference)
372
+ - DeepSeek (DeepSeek R1, DeepSeek V3, etc.)
313
373
 
314
374
  ### Specialized Providers
315
375
 
316
- - **Mistral AI** (Mistral Large, Mixtral, etc.)
317
- - **Cohere** (Command R, Command A, etc.)
318
- - **Perplexity** (Sonar, Sonar Pro, etc.)
319
- - **Together AI** (Various open models)
320
- - **Fireworks AI** (Various models)
321
- - **Vercel** (v0 models)
376
+ - Mistral AI (Mistral Large, Mixtral, etc.)
377
+ - Cohere (Command R, Command A, etc.)
378
+ - Perplexity (Sonar, Sonar Pro, etc.)
379
+ - Together AI (Various open models)
380
+ - Fireworks AI (Various models)
381
+ - Vercel (v0 models)
322
382
 
323
383
  ### Open Source & Research
324
384
 
325
- - **HuggingFace** (Various hosted models)
326
- - **ModelScope** (Chinese models)
327
- - **OpenRouter** (Aggregated models)
328
- - **GitHub Copilot** (Code models)
329
- - **Azure** (OpenAI models)
385
+ - HuggingFace (Various hosted models)
386
+ - ModelScope (Chinese models)
387
+ - OpenRouter (Aggregated models)
388
+ - GitHub Copilot (Code models)
389
+ - Azure (OpenAI models)
330
390
 
331
391
  And many more...
332
392
 
333
- ## 🛠️ Development
393
+ ## Pricing Data Integration
394
+
395
+ This package automatically includes real-time pricing data from [Helicone's LLM Cost API](https://helicone.ai/api/llm-costs) during the aggregation process.
396
+
397
+ ### Features
398
+
399
+ - Automatic enrichment: Pricing data is automatically added during aggregation
400
+ - Smart matching: Uses multiple strategies to match models with pricing data
401
+ - Non-destructive: Preserves existing pricing data while filling in missing values
402
+ - Cost conversion: Automatically converts from per 1M tokens to per 1K tokens format
403
+ - 840+ models: Covers pricing for 840+ models across all major providers
404
+
405
+ ### Supported Pricing Providers
406
+
407
+ Helicone provides pricing data for models from:
408
+
409
+ - OpenAI (GPT-4, GPT-3.5, O1, O3, etc.)
410
+ - Anthropic (Claude models)
411
+ - Google (Gemini models)
412
+ - Meta (Llama models)
413
+ - Mistral (Mistral models)
414
+ - Groq (Various models)
415
+ - And many more...
416
+
417
+ ## Model Data Synchronization
418
+
419
+ The provider registry includes a powerful data synchronization system that automatically merges missing data between models with the same ID across different providers.
420
+
421
+ ### How It Works
422
+
423
+ 1. Groups models by ID: Finds all models with the same ID across different providers
424
+ 2. Calculates completeness scores: Evaluates how complete each model's data is (excluding cost fields)
425
+ 3. Uses the most complete model as base: Selects the model with the highest data completeness
426
+ 4. Merges missing data: Fills in missing fields from other models with the same ID
427
+ 5. Preserves cost data: Never overwrites existing cost information
428
+
429
+ ### Protected Fields
430
+
431
+ The following cost-related fields are never synchronized to preserve pricing accuracy:
432
+
433
+ - `cost` (entire cost object)
434
+ - `input` (input cost)
435
+ - `output` (output cost)
436
+ - `inputCacheHit` (cache hit pricing)
437
+ - `imageGeneration` (image generation pricing)
438
+ - `videoGeneration` (video generation pricing)
439
+
440
+ ### Example
441
+
442
+ If you have the same model (e.g., `gpt-4`) from multiple providers:
443
+
444
+ **OpenAI Provider:**
445
+
446
+ ```json
447
+ {
448
+ "id": "gpt-4",
449
+ "name": "GPT-4",
450
+ "cost": { "input": 0.03, "output": 0.06 },
451
+ "description": null,
452
+ "releaseDate": "2023-03-14"
453
+ }
454
+ ```
455
+
456
+ **Azure Provider:**
457
+
458
+ ```json
459
+ {
460
+ "id": "gpt-4",
461
+ "name": null,
462
+ "cost": { "input": 0.03, "output": 0.06 },
463
+ "description": "GPT-4 is a large multimodal model",
464
+ "releaseDate": null
465
+ }
466
+ ```
467
+
468
+ **Result after synchronization:**
469
+
470
+ ```json
471
+ {
472
+ "id": "gpt-4",
473
+ "name": "GPT-4",
474
+ "cost": { "input": 0.03, "output": 0.06 },
475
+ "description": "GPT-4 is a large multimodal model",
476
+ "releaseDate": "2023-03-14"
477
+ }
478
+ ```
479
+
480
+ ## Development
334
481
 
335
482
  ### Prerequisites
336
483
 
@@ -384,7 +531,11 @@ pnpm run build
384
531
  - Fetches pricing data from Helicone API
385
532
  - Enriches models with icon information
386
533
  - Synchronizes data between models with the same ID
387
- - Generates `data/all-models.json` and `src/models-data.ts`
534
+ - Generates `public/api.json` (main API file)
535
+ - Generates `public/{provider-name}.json` (provider-specific files)
536
+ - Generates `public/providers.json` (provider index)
537
+ - Generates `src/types/providers.ts` (ProviderName type)
538
+ - Generates `src/types/{provider-name}.ts` (ModelName types per provider)
388
539
 
389
540
  3. **Generate Icons (`pnpm run generate-icons`)**:
390
541
  - Creates SVG sprite sheet from LobeHub icons and custom icons
@@ -436,120 +587,39 @@ pnpm run lint:types
436
587
  ```
437
588
  packages/ai-model-registry/
438
589
  ├── src/
439
- │ ├── index.ts # Main exports
590
+ │ ├── index.ts # Main exports (async functions)
440
591
  │ ├── schema.ts # Model schema definitions
441
- └── models-data.ts # Generated model data
592
+ ├── icons-sprite.ts # Generated icon sprite
593
+ │ └── types/ # Generated TypeScript types
594
+ │ ├── providers.ts # ProviderName type
595
+ │ ├── open-router.ts # ModelName type for OpenRouter
596
+ │ ├── open-ai.ts # ModelName type for OpenAI
597
+ │ └── ... # Other provider model types
442
598
  ├── scripts/
443
599
  │ ├── aggregate-providers.ts # Data aggregation script
444
600
  │ ├── generate-svg-sprite.ts # Icon generation
445
601
  │ └── download/ # Provider data downloaders
602
+ ├── public/ # Generated JSON files
603
+ │ ├── api.json # Main API file (all models)
604
+ │ ├── providers.json # Provider index
605
+ │ ├── open-router.json # Provider-specific models
606
+ │ ├── open-ai.json # Provider-specific models
607
+ │ └── ... # Other provider files
446
608
  ├── data/
447
- │ ├── all-models.json # Generated model data
448
609
  │ └── providers/ # Raw provider data
449
610
  └── assets/
450
611
  └── icons/ # Provider icons
451
612
  ```
452
613
 
453
- ## 💰 Pricing Data Integration
454
-
455
- This package automatically includes real-time pricing data from [Helicone's LLM Cost API](https://helicone.ai/api/llm-costs) during the aggregation process.
456
-
457
- ### Features
458
-
459
- - **🔄 Automatic Enrichment**: Pricing data is automatically added during aggregation
460
- - **🎯 Smart Matching**: Uses multiple strategies to match models with pricing data
461
- - **🛡️ Non-Destructive**: Preserves existing pricing data while filling in missing values
462
- - **🔄 Cost Conversion**: Automatically converts from per 1M tokens to per 1K tokens format
463
- - **📊 840+ Models**: Covers pricing for 840+ models across all major providers
464
-
465
- ### Supported Pricing Providers
466
-
467
- Helicone provides pricing data for models from:
468
-
469
- - OpenAI (GPT-4, GPT-3.5, O1, O3, etc.)
470
- - Anthropic (Claude models)
471
- - Google (Gemini models)
472
- - Meta (Llama models)
473
- - Mistral (Mistral models)
474
- - Groq (Various models)
475
- - And many more...
476
-
477
- ### Usage
478
-
479
- ```bash
480
- # Aggregate all models with pricing data
481
- pnpm run aggregate
482
-
483
- # Build the package (includes aggregation with pricing)
484
- pnpm run build
485
- ```
486
-
487
- ## 🔄 Model Data Synchronization
488
-
489
- The provider registry includes a powerful data synchronization system that automatically merges missing data between models with the same ID across different providers.
490
-
491
- ### How It Works
492
-
493
- 1. **Groups models by ID**: Finds all models with the same ID across different providers
494
- 2. **Calculates completeness scores**: Evaluates how complete each model's data is (excluding cost fields)
495
- 3. **Uses the most complete model as base**: Selects the model with the highest data completeness
496
- 4. **Merges missing data**: Fills in missing fields from other models with the same ID
497
- 5. **Preserves cost data**: Never overwrites existing cost information
498
-
499
- ### Protected Fields
500
-
501
- The following cost-related fields are **never synchronized** to preserve pricing accuracy:
502
-
503
- - `cost` (entire cost object)
504
- - `input` (input cost)
505
- - `output` (output cost)
506
- - `inputCacheHit` (cache hit pricing)
507
- - `imageGeneration` (image generation pricing)
508
- - `videoGeneration` (video generation pricing)
509
-
510
- ### Example
511
-
512
- If you have the same model (e.g., `gpt-4`) from multiple providers:
513
-
514
- **OpenAI Provider:**
515
-
516
- ```json
517
- {
518
- "id": "gpt-4",
519
- "name": "GPT-4",
520
- "cost": { "input": 0.03, "output": 0.06 },
521
- "description": null,
522
- "releaseDate": "2023-03-14"
523
- }
524
- ```
525
-
526
- **Azure Provider:**
614
+ ## Supported Node.js Versions
527
615
 
528
- ```json
529
- {
530
- "id": "gpt-4",
531
- "name": null,
532
- "cost": { "input": 0.03, "output": 0.06 },
533
- "description": "GPT-4 is a large multimodal model",
534
- "releaseDate": null
535
- }
536
- ```
616
+ Libraries in this ecosystem make the best effort to track [Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
537
617
 
538
- **Result after synchronization:**
618
+ ## Contributing
539
619
 
540
- ```json
541
- {
542
- "id": "gpt-4",
543
- "name": "GPT-4",
544
- "cost": { "input": 0.03, "output": 0.06 },
545
- "description": "GPT-4 is a large multimodal model",
546
- "releaseDate": "2023-03-14"
547
- }
548
- ```
620
+ If you would like to help take a look at the [list of issues](https://github.com/anolilab/ai-models/issues) and check our [Contributing](.github/CONTRIBUTING.md) guide.
549
621
 
550
- ## 🤝 Contributing
551
-
552
- We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
622
+ > **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
553
623
 
554
624
  ### Adding New Providers
555
625
 
@@ -562,24 +632,29 @@ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) f
562
632
 
563
633
  Please use our [Issue Tracker](https://github.com/anolilab/ai-models/issues) to report bugs or request features.
564
634
 
565
- ## 📄 License
635
+ ## Credits
566
636
 
567
- This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE.md) file for details.
637
+ - [Daniel Bannert](https://github.com/prisis)
638
+ - [All Contributors](https://github.com/anolilab/ai-models/graphs/contributors)
568
639
 
569
- ## 🙏 Acknowledgments
640
+ ## Made with ❤️ at Anolilab
570
641
 
571
- - [Helicone](https://helicone.ai/) for providing pricing data
572
- - [OpenRouter](https://openrouter.ai/) for reference data
573
- - All the AI providers for their amazing models
574
- - The open source community for inspiration and tools
642
+ This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
575
643
 
576
- ## 📞 Support
644
+ ## License
577
645
 
578
- - **Documentation**: [GitHub Wiki](https://github.com/anolilab/ai-models/wiki)
579
- - **Issues**: [GitHub Issues](https://github.com/anolilab/ai-models/issues)
580
- - **Discussions**: [GitHub Discussions](https://github.com/anolilab/ai-models/discussions)
581
- - **Email**: support@anolilab.com
646
+ The anolilab ai-model-registry is open-sourced software licensed under the [Apache License 2.0][license-url]
582
647
 
583
- ---
648
+ <!-- badges -->
584
649
 
585
- Made with ❤️ by [AnoliLab](https://anolilab.com)
650
+ [license-badge]: https://img.shields.io/badge/License-Apache--2.0-blue.svg?style=for-the-badge
651
+ [license]: https://github.com/anolilab/ai-models/blob/main/packages/ai-model-registry/LICENSE.md
652
+ [npm-downloads-badge]: https://img.shields.io/npm/dm/@anolilab/ai-model-registry?style=for-the-badge
653
+ [npm-downloads]: https://www.npmjs.com/package/@anolilab/ai-model-registry
654
+ [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
655
+ [prs-welcome]: https://github.com/anolilab/ai-models/blob/main/.github/CONTRIBUTING.md
656
+ [chat-badge]: https://img.shields.io/discord/902465130518949899.svg?style=for-the-badge
657
+ [chat]: https://discord.gg/TtFJY8xkFK
658
+ [typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
659
+ [typescript-url]: https://www.typescriptlang.org/
660
+ [license-url]: LICENSE.md