aimodels 0.2.1 → 0.2.3
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/dist/index.d.mts +20 -23
- package/dist/index.d.ts +20 -23
- package/dist/index.js +170 -48
- package/dist/index.mjs +169 -48
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -13,11 +13,22 @@ interface ModelPrice {
|
|
|
13
13
|
type Capability = "chat" | "reason" | "text-in" | "text-out" | "img-in" | "img-out" | "sound-in" | "sound-out" | "json-out" | "function-out" | "vectors-out";
|
|
14
14
|
|
|
15
15
|
declare class ModelCollection extends Array<Model> {
|
|
16
|
-
|
|
16
|
+
/** Create a new ModelCollection from an array of models */
|
|
17
|
+
constructor(models?: Model[]);
|
|
18
|
+
/** Filter models by one or more capabilities (all must be present) */
|
|
17
19
|
can(...capabilities: Capability[]): ModelCollection;
|
|
20
|
+
/** Filter models by one or more languages (all must be supported) */
|
|
18
21
|
know(...languages: string[]): ModelCollection;
|
|
22
|
+
/** Override array filter to return ModelCollection */
|
|
19
23
|
filter(predicate: (value: Model, index: number, array: Model[]) => boolean): ModelCollection;
|
|
24
|
+
/** Override array slice to return ModelCollection */
|
|
20
25
|
slice(start?: number, end?: number): ModelCollection;
|
|
26
|
+
/** Find a model by its ID */
|
|
27
|
+
id(modelId: string): Model | undefined;
|
|
28
|
+
/** Get models available from a specific provider */
|
|
29
|
+
fromProvider(provider: string): ModelCollection;
|
|
30
|
+
/** Filter models by minimum context window size */
|
|
31
|
+
withMinContext(tokens: number): ModelCollection;
|
|
21
32
|
}
|
|
22
33
|
interface ModelContext {
|
|
23
34
|
/** Maximum total tokens (input + output) */
|
|
@@ -41,26 +52,6 @@ interface Model {
|
|
|
41
52
|
/** Context window information */
|
|
42
53
|
context: ModelContext;
|
|
43
54
|
}
|
|
44
|
-
interface ModelsAPI {
|
|
45
|
-
/** All available models */
|
|
46
|
-
all: ModelCollection;
|
|
47
|
-
/** List of all creators */
|
|
48
|
-
creators: string[];
|
|
49
|
-
/** List of all providers */
|
|
50
|
-
providers: string[];
|
|
51
|
-
/** Get models from a specific creator */
|
|
52
|
-
fromCreator(creator: string): ModelCollection;
|
|
53
|
-
/** Get models from a specific provider */
|
|
54
|
-
fromProvider(provider: string): ModelCollection;
|
|
55
|
-
/** Find a specific model by ID */
|
|
56
|
-
find(id: string): Model | undefined;
|
|
57
|
-
/** Filter models by one or more capabilities (all must be present) */
|
|
58
|
-
can(...capabilities: string[]): ModelCollection;
|
|
59
|
-
/** Filter models by minimum context window */
|
|
60
|
-
withMinContext(tokens: number): ModelCollection;
|
|
61
|
-
/** Get pricing for a model from a specific provider */
|
|
62
|
-
getPrice(modelId: string, provider: string): ModelPrice | undefined;
|
|
63
|
-
}
|
|
64
55
|
|
|
65
56
|
var creators = {
|
|
66
57
|
openai: {
|
|
@@ -84,6 +75,12 @@ var creators$1 = {
|
|
|
84
75
|
creators: creators
|
|
85
76
|
};
|
|
86
77
|
|
|
87
|
-
declare
|
|
78
|
+
declare class ModelsCollection extends ModelCollection {
|
|
79
|
+
get creators(): string[];
|
|
80
|
+
get providers(): string[];
|
|
81
|
+
fromCreator(creator: string): ModelCollection;
|
|
82
|
+
getPrice(modelId: string, provider: string): ModelPrice | undefined;
|
|
83
|
+
}
|
|
84
|
+
declare const models: ModelsCollection;
|
|
88
85
|
|
|
89
|
-
export { creators$1 as creators, models };
|
|
86
|
+
export { type Capability, type Model, ModelCollection, type ModelContext, type ModelPrice, creators$1 as creators, models };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,11 +13,22 @@ interface ModelPrice {
|
|
|
13
13
|
type Capability = "chat" | "reason" | "text-in" | "text-out" | "img-in" | "img-out" | "sound-in" | "sound-out" | "json-out" | "function-out" | "vectors-out";
|
|
14
14
|
|
|
15
15
|
declare class ModelCollection extends Array<Model> {
|
|
16
|
-
|
|
16
|
+
/** Create a new ModelCollection from an array of models */
|
|
17
|
+
constructor(models?: Model[]);
|
|
18
|
+
/** Filter models by one or more capabilities (all must be present) */
|
|
17
19
|
can(...capabilities: Capability[]): ModelCollection;
|
|
20
|
+
/** Filter models by one or more languages (all must be supported) */
|
|
18
21
|
know(...languages: string[]): ModelCollection;
|
|
22
|
+
/** Override array filter to return ModelCollection */
|
|
19
23
|
filter(predicate: (value: Model, index: number, array: Model[]) => boolean): ModelCollection;
|
|
24
|
+
/** Override array slice to return ModelCollection */
|
|
20
25
|
slice(start?: number, end?: number): ModelCollection;
|
|
26
|
+
/** Find a model by its ID */
|
|
27
|
+
id(modelId: string): Model | undefined;
|
|
28
|
+
/** Get models available from a specific provider */
|
|
29
|
+
fromProvider(provider: string): ModelCollection;
|
|
30
|
+
/** Filter models by minimum context window size */
|
|
31
|
+
withMinContext(tokens: number): ModelCollection;
|
|
21
32
|
}
|
|
22
33
|
interface ModelContext {
|
|
23
34
|
/** Maximum total tokens (input + output) */
|
|
@@ -41,26 +52,6 @@ interface Model {
|
|
|
41
52
|
/** Context window information */
|
|
42
53
|
context: ModelContext;
|
|
43
54
|
}
|
|
44
|
-
interface ModelsAPI {
|
|
45
|
-
/** All available models */
|
|
46
|
-
all: ModelCollection;
|
|
47
|
-
/** List of all creators */
|
|
48
|
-
creators: string[];
|
|
49
|
-
/** List of all providers */
|
|
50
|
-
providers: string[];
|
|
51
|
-
/** Get models from a specific creator */
|
|
52
|
-
fromCreator(creator: string): ModelCollection;
|
|
53
|
-
/** Get models from a specific provider */
|
|
54
|
-
fromProvider(provider: string): ModelCollection;
|
|
55
|
-
/** Find a specific model by ID */
|
|
56
|
-
find(id: string): Model | undefined;
|
|
57
|
-
/** Filter models by one or more capabilities (all must be present) */
|
|
58
|
-
can(...capabilities: string[]): ModelCollection;
|
|
59
|
-
/** Filter models by minimum context window */
|
|
60
|
-
withMinContext(tokens: number): ModelCollection;
|
|
61
|
-
/** Get pricing for a model from a specific provider */
|
|
62
|
-
getPrice(modelId: string, provider: string): ModelPrice | undefined;
|
|
63
|
-
}
|
|
64
55
|
|
|
65
56
|
var creators = {
|
|
66
57
|
openai: {
|
|
@@ -84,6 +75,12 @@ var creators$1 = {
|
|
|
84
75
|
creators: creators
|
|
85
76
|
};
|
|
86
77
|
|
|
87
|
-
declare
|
|
78
|
+
declare class ModelsCollection extends ModelCollection {
|
|
79
|
+
get creators(): string[];
|
|
80
|
+
get providers(): string[];
|
|
81
|
+
fromCreator(creator: string): ModelCollection;
|
|
82
|
+
getPrice(modelId: string, provider: string): ModelPrice | undefined;
|
|
83
|
+
}
|
|
84
|
+
declare const models: ModelsCollection;
|
|
88
85
|
|
|
89
|
-
export { creators$1 as creators, models };
|
|
86
|
+
export { type Capability, type Model, ModelCollection, type ModelContext, type ModelPrice, creators$1 as creators, models };
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
ModelCollection: () => ModelCollection,
|
|
23
24
|
creators: () => creators_default,
|
|
24
25
|
models: () => models
|
|
25
26
|
});
|
|
@@ -27,26 +28,43 @@ module.exports = __toCommonJS(index_exports);
|
|
|
27
28
|
|
|
28
29
|
// src/types/models.ts
|
|
29
30
|
var ModelCollection = class _ModelCollection extends Array {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
/** Create a new ModelCollection from an array of models */
|
|
32
|
+
constructor(models2 = []) {
|
|
33
|
+
super();
|
|
34
|
+
if (models2.length > 0) {
|
|
35
|
+
this.push(...models2);
|
|
36
|
+
}
|
|
32
37
|
Object.setPrototypeOf(this, _ModelCollection.prototype);
|
|
33
38
|
}
|
|
39
|
+
/** Filter models by one or more capabilities (all must be present) */
|
|
34
40
|
can(...capabilities) {
|
|
35
|
-
return
|
|
36
|
-
this.filter((model) => capabilities.every((cap) => model.can.includes(cap)))
|
|
37
|
-
);
|
|
41
|
+
return this.filter((model) => capabilities.every((cap) => model.can.includes(cap)));
|
|
38
42
|
}
|
|
43
|
+
/** Filter models by one or more languages (all must be supported) */
|
|
39
44
|
know(...languages) {
|
|
40
|
-
return
|
|
41
|
-
this.filter((model) => languages.every((lang) => model.languages?.includes(lang)))
|
|
42
|
-
);
|
|
45
|
+
return this.filter((model) => languages.every((lang) => model.languages?.includes(lang)));
|
|
43
46
|
}
|
|
44
|
-
|
|
47
|
+
/** Override array filter to return ModelCollection */
|
|
45
48
|
filter(predicate) {
|
|
46
|
-
|
|
49
|
+
const filtered = Array.from(this).filter(predicate);
|
|
50
|
+
return new _ModelCollection(filtered);
|
|
47
51
|
}
|
|
52
|
+
/** Override array slice to return ModelCollection */
|
|
48
53
|
slice(start, end) {
|
|
49
|
-
|
|
54
|
+
const sliced = Array.from(this).slice(start, end);
|
|
55
|
+
return new _ModelCollection(sliced);
|
|
56
|
+
}
|
|
57
|
+
/** Find a model by its ID */
|
|
58
|
+
id(modelId) {
|
|
59
|
+
return this.find((model) => model.id === modelId);
|
|
60
|
+
}
|
|
61
|
+
/** Get models available from a specific provider */
|
|
62
|
+
fromProvider(provider) {
|
|
63
|
+
return this.filter((model) => model.providers.includes(provider));
|
|
64
|
+
}
|
|
65
|
+
/** Filter models by minimum context window size */
|
|
66
|
+
withMinContext(tokens) {
|
|
67
|
+
return this.filter((model) => model.context.total >= tokens);
|
|
50
68
|
}
|
|
51
69
|
};
|
|
52
70
|
|
|
@@ -54,12 +72,31 @@ var ModelCollection = class _ModelCollection extends Array {
|
|
|
54
72
|
var openai_models_default = {
|
|
55
73
|
models: [
|
|
56
74
|
{
|
|
57
|
-
id: "whisper-
|
|
58
|
-
name: "Whisper
|
|
59
|
-
license: "
|
|
75
|
+
id: "whisper-large-v3",
|
|
76
|
+
name: "Whisper Large v3",
|
|
77
|
+
license: "mit",
|
|
60
78
|
providers: [
|
|
61
79
|
"openai",
|
|
62
|
-
"azure"
|
|
80
|
+
"azure",
|
|
81
|
+
"groq"
|
|
82
|
+
],
|
|
83
|
+
can: [
|
|
84
|
+
"sound-in",
|
|
85
|
+
"text-out"
|
|
86
|
+
],
|
|
87
|
+
context: {
|
|
88
|
+
total: null,
|
|
89
|
+
maxOutput: null
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "whisper-large-v3-turbo",
|
|
94
|
+
name: "Whisper Large v3 Turbo",
|
|
95
|
+
license: "mit",
|
|
96
|
+
providers: [
|
|
97
|
+
"openai",
|
|
98
|
+
"azure",
|
|
99
|
+
"groq"
|
|
63
100
|
],
|
|
64
101
|
can: [
|
|
65
102
|
"sound-in",
|
|
@@ -308,11 +345,55 @@ var anthropic_models_default = {
|
|
|
308
345
|
var meta_models_default = {
|
|
309
346
|
models: [
|
|
310
347
|
{
|
|
311
|
-
id: "
|
|
312
|
-
name: "Llama
|
|
313
|
-
license: "llama-
|
|
314
|
-
providers: ["groq"
|
|
315
|
-
can: ["chat", "json-out", "function-out"],
|
|
348
|
+
id: "llama3-70b-8192",
|
|
349
|
+
name: "Llama 3 70B",
|
|
350
|
+
license: "llama-3-community",
|
|
351
|
+
providers: ["groq"],
|
|
352
|
+
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
353
|
+
context: {
|
|
354
|
+
total: 8192,
|
|
355
|
+
maxOutput: 4096
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: "llama3-8b-8192",
|
|
360
|
+
name: "Llama 3 8B",
|
|
361
|
+
license: "llama-3-community",
|
|
362
|
+
providers: ["groq"],
|
|
363
|
+
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
364
|
+
context: {
|
|
365
|
+
total: 8192,
|
|
366
|
+
maxOutput: 4096
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
id: "llama-3.2-11b-vision-preview",
|
|
371
|
+
name: "Llama 3.2 11B Vision",
|
|
372
|
+
license: "llama-3-community",
|
|
373
|
+
providers: ["groq"],
|
|
374
|
+
can: ["chat", "text-in", "text-out", "img-in"],
|
|
375
|
+
context: {
|
|
376
|
+
total: 4096,
|
|
377
|
+
maxOutput: 4096
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: "llama-3.2-90b-vision-preview",
|
|
382
|
+
name: "Llama 3.2 90B Vision",
|
|
383
|
+
license: "llama-3-community",
|
|
384
|
+
providers: ["groq"],
|
|
385
|
+
can: ["chat", "text-in", "text-out", "img-in"],
|
|
386
|
+
context: {
|
|
387
|
+
total: 4096,
|
|
388
|
+
maxOutput: 4096
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
id: "llama-guard-3-8b",
|
|
393
|
+
name: "LlamaGuard 3 8B",
|
|
394
|
+
license: "llama-3-community",
|
|
395
|
+
providers: ["groq"],
|
|
396
|
+
can: ["chat", "text-in", "text-out"],
|
|
316
397
|
context: {
|
|
317
398
|
total: 4096,
|
|
318
399
|
maxOutput: 4096
|
|
@@ -406,13 +487,73 @@ var mistral_models_default = {
|
|
|
406
487
|
]
|
|
407
488
|
};
|
|
408
489
|
|
|
490
|
+
// src/data/models/google-models.json
|
|
491
|
+
var google_models_default = {
|
|
492
|
+
models: [
|
|
493
|
+
{
|
|
494
|
+
id: "gemma2-9b-it",
|
|
495
|
+
name: "Gemma 2 9B Instruct",
|
|
496
|
+
license: "apache-2.0",
|
|
497
|
+
providers: ["groq"],
|
|
498
|
+
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
499
|
+
context: {
|
|
500
|
+
total: 8192,
|
|
501
|
+
maxOutput: 4096
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
]
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
// src/data/models/deepseek-models.json
|
|
508
|
+
var deepseek_models_default = {
|
|
509
|
+
models: [
|
|
510
|
+
{
|
|
511
|
+
id: "deepseek-chat",
|
|
512
|
+
name: "DeepSeek V3",
|
|
513
|
+
license: "apache-2.0",
|
|
514
|
+
providers: ["deepseek"],
|
|
515
|
+
can: [
|
|
516
|
+
"chat",
|
|
517
|
+
"text-in",
|
|
518
|
+
"text-out",
|
|
519
|
+
"json-out",
|
|
520
|
+
"function-out"
|
|
521
|
+
],
|
|
522
|
+
context: {
|
|
523
|
+
total: 131072,
|
|
524
|
+
maxOutput: 131072
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
id: "deepseek-reasoner",
|
|
529
|
+
name: "DeepSeek R1",
|
|
530
|
+
license: "apache-2.0",
|
|
531
|
+
providers: ["deepseek"],
|
|
532
|
+
can: [
|
|
533
|
+
"chat",
|
|
534
|
+
"text-in",
|
|
535
|
+
"text-out",
|
|
536
|
+
"json-out",
|
|
537
|
+
"function-out",
|
|
538
|
+
"reason"
|
|
539
|
+
],
|
|
540
|
+
context: {
|
|
541
|
+
total: 131072,
|
|
542
|
+
maxOutput: 131072
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
};
|
|
547
|
+
|
|
409
548
|
// src/builders/models.ts
|
|
410
549
|
function buildAllModels() {
|
|
411
550
|
return [
|
|
412
551
|
...openai_models_default.models,
|
|
413
552
|
...anthropic_models_default.models,
|
|
414
553
|
...meta_models_default.models,
|
|
415
|
-
...mistral_models_default.models
|
|
554
|
+
...mistral_models_default.models,
|
|
555
|
+
...google_models_default.models,
|
|
556
|
+
...deepseek_models_default.models
|
|
416
557
|
];
|
|
417
558
|
}
|
|
418
559
|
|
|
@@ -639,51 +780,32 @@ var creators_default = {
|
|
|
639
780
|
// src/index.ts
|
|
640
781
|
var allModels = buildAllModels();
|
|
641
782
|
var providersData = buildProvidersData();
|
|
642
|
-
var
|
|
643
|
-
all: new ModelCollection(allModels),
|
|
783
|
+
var ModelsCollection = class extends ModelCollection {
|
|
644
784
|
get creators() {
|
|
645
785
|
return Object.keys(creators_default.creators);
|
|
646
|
-
}
|
|
786
|
+
}
|
|
647
787
|
get providers() {
|
|
648
788
|
return providersData.providers.map((p) => p.id);
|
|
649
|
-
}
|
|
789
|
+
}
|
|
650
790
|
fromCreator(creator) {
|
|
651
791
|
return new ModelCollection(
|
|
652
|
-
|
|
792
|
+
this.filter(
|
|
653
793
|
(model) => model.license.startsWith(creator) || // For open source models
|
|
654
|
-
providersData.providers.find((p) => p.id === creator)?.models[model.id]
|
|
794
|
+
!!providersData.providers.find((p) => p.id === creator)?.models[model.id]
|
|
655
795
|
// For proprietary models
|
|
656
796
|
)
|
|
657
797
|
);
|
|
658
|
-
}
|
|
659
|
-
fromProvider(provider) {
|
|
660
|
-
return new ModelCollection(
|
|
661
|
-
allModels.filter((model) => model.providers.includes(provider))
|
|
662
|
-
);
|
|
663
|
-
},
|
|
664
|
-
find(id) {
|
|
665
|
-
return allModels.find((model) => model.id === id);
|
|
666
|
-
},
|
|
667
|
-
can(...capabilities) {
|
|
668
|
-
return new ModelCollection(
|
|
669
|
-
allModels.filter(
|
|
670
|
-
(model) => capabilities.every((capability) => model.can.includes(capability))
|
|
671
|
-
)
|
|
672
|
-
);
|
|
673
|
-
},
|
|
674
|
-
withMinContext(tokens) {
|
|
675
|
-
return new ModelCollection(
|
|
676
|
-
allModels.filter((model) => model.context.total >= tokens)
|
|
677
|
-
);
|
|
678
|
-
},
|
|
798
|
+
}
|
|
679
799
|
getPrice(modelId, provider) {
|
|
680
800
|
const providerData = providersData.providers.find((p) => p.id === provider);
|
|
681
801
|
const price = providerData?.models[modelId];
|
|
682
802
|
return price?.type === "token" ? price : void 0;
|
|
683
803
|
}
|
|
684
804
|
};
|
|
805
|
+
var models = new ModelsCollection(allModels);
|
|
685
806
|
// Annotate the CommonJS export names for ESM import in node:
|
|
686
807
|
0 && (module.exports = {
|
|
808
|
+
ModelCollection,
|
|
687
809
|
creators,
|
|
688
810
|
models
|
|
689
811
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
// src/types/models.ts
|
|
2
2
|
var ModelCollection = class _ModelCollection extends Array {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/** Create a new ModelCollection from an array of models */
|
|
4
|
+
constructor(models2 = []) {
|
|
5
|
+
super();
|
|
6
|
+
if (models2.length > 0) {
|
|
7
|
+
this.push(...models2);
|
|
8
|
+
}
|
|
5
9
|
Object.setPrototypeOf(this, _ModelCollection.prototype);
|
|
6
10
|
}
|
|
11
|
+
/** Filter models by one or more capabilities (all must be present) */
|
|
7
12
|
can(...capabilities) {
|
|
8
|
-
return
|
|
9
|
-
this.filter((model) => capabilities.every((cap) => model.can.includes(cap)))
|
|
10
|
-
);
|
|
13
|
+
return this.filter((model) => capabilities.every((cap) => model.can.includes(cap)));
|
|
11
14
|
}
|
|
15
|
+
/** Filter models by one or more languages (all must be supported) */
|
|
12
16
|
know(...languages) {
|
|
13
|
-
return
|
|
14
|
-
this.filter((model) => languages.every((lang) => model.languages?.includes(lang)))
|
|
15
|
-
);
|
|
17
|
+
return this.filter((model) => languages.every((lang) => model.languages?.includes(lang)));
|
|
16
18
|
}
|
|
17
|
-
|
|
19
|
+
/** Override array filter to return ModelCollection */
|
|
18
20
|
filter(predicate) {
|
|
19
|
-
|
|
21
|
+
const filtered = Array.from(this).filter(predicate);
|
|
22
|
+
return new _ModelCollection(filtered);
|
|
20
23
|
}
|
|
24
|
+
/** Override array slice to return ModelCollection */
|
|
21
25
|
slice(start, end) {
|
|
22
|
-
|
|
26
|
+
const sliced = Array.from(this).slice(start, end);
|
|
27
|
+
return new _ModelCollection(sliced);
|
|
28
|
+
}
|
|
29
|
+
/** Find a model by its ID */
|
|
30
|
+
id(modelId) {
|
|
31
|
+
return this.find((model) => model.id === modelId);
|
|
32
|
+
}
|
|
33
|
+
/** Get models available from a specific provider */
|
|
34
|
+
fromProvider(provider) {
|
|
35
|
+
return this.filter((model) => model.providers.includes(provider));
|
|
36
|
+
}
|
|
37
|
+
/** Filter models by minimum context window size */
|
|
38
|
+
withMinContext(tokens) {
|
|
39
|
+
return this.filter((model) => model.context.total >= tokens);
|
|
23
40
|
}
|
|
24
41
|
};
|
|
25
42
|
|
|
@@ -27,12 +44,31 @@ var ModelCollection = class _ModelCollection extends Array {
|
|
|
27
44
|
var openai_models_default = {
|
|
28
45
|
models: [
|
|
29
46
|
{
|
|
30
|
-
id: "whisper-
|
|
31
|
-
name: "Whisper
|
|
32
|
-
license: "
|
|
47
|
+
id: "whisper-large-v3",
|
|
48
|
+
name: "Whisper Large v3",
|
|
49
|
+
license: "mit",
|
|
33
50
|
providers: [
|
|
34
51
|
"openai",
|
|
35
|
-
"azure"
|
|
52
|
+
"azure",
|
|
53
|
+
"groq"
|
|
54
|
+
],
|
|
55
|
+
can: [
|
|
56
|
+
"sound-in",
|
|
57
|
+
"text-out"
|
|
58
|
+
],
|
|
59
|
+
context: {
|
|
60
|
+
total: null,
|
|
61
|
+
maxOutput: null
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "whisper-large-v3-turbo",
|
|
66
|
+
name: "Whisper Large v3 Turbo",
|
|
67
|
+
license: "mit",
|
|
68
|
+
providers: [
|
|
69
|
+
"openai",
|
|
70
|
+
"azure",
|
|
71
|
+
"groq"
|
|
36
72
|
],
|
|
37
73
|
can: [
|
|
38
74
|
"sound-in",
|
|
@@ -281,11 +317,55 @@ var anthropic_models_default = {
|
|
|
281
317
|
var meta_models_default = {
|
|
282
318
|
models: [
|
|
283
319
|
{
|
|
284
|
-
id: "
|
|
285
|
-
name: "Llama
|
|
286
|
-
license: "llama-
|
|
287
|
-
providers: ["groq"
|
|
288
|
-
can: ["chat", "json-out", "function-out"],
|
|
320
|
+
id: "llama3-70b-8192",
|
|
321
|
+
name: "Llama 3 70B",
|
|
322
|
+
license: "llama-3-community",
|
|
323
|
+
providers: ["groq"],
|
|
324
|
+
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
325
|
+
context: {
|
|
326
|
+
total: 8192,
|
|
327
|
+
maxOutput: 4096
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: "llama3-8b-8192",
|
|
332
|
+
name: "Llama 3 8B",
|
|
333
|
+
license: "llama-3-community",
|
|
334
|
+
providers: ["groq"],
|
|
335
|
+
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
336
|
+
context: {
|
|
337
|
+
total: 8192,
|
|
338
|
+
maxOutput: 4096
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
id: "llama-3.2-11b-vision-preview",
|
|
343
|
+
name: "Llama 3.2 11B Vision",
|
|
344
|
+
license: "llama-3-community",
|
|
345
|
+
providers: ["groq"],
|
|
346
|
+
can: ["chat", "text-in", "text-out", "img-in"],
|
|
347
|
+
context: {
|
|
348
|
+
total: 4096,
|
|
349
|
+
maxOutput: 4096
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
id: "llama-3.2-90b-vision-preview",
|
|
354
|
+
name: "Llama 3.2 90B Vision",
|
|
355
|
+
license: "llama-3-community",
|
|
356
|
+
providers: ["groq"],
|
|
357
|
+
can: ["chat", "text-in", "text-out", "img-in"],
|
|
358
|
+
context: {
|
|
359
|
+
total: 4096,
|
|
360
|
+
maxOutput: 4096
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
id: "llama-guard-3-8b",
|
|
365
|
+
name: "LlamaGuard 3 8B",
|
|
366
|
+
license: "llama-3-community",
|
|
367
|
+
providers: ["groq"],
|
|
368
|
+
can: ["chat", "text-in", "text-out"],
|
|
289
369
|
context: {
|
|
290
370
|
total: 4096,
|
|
291
371
|
maxOutput: 4096
|
|
@@ -379,13 +459,73 @@ var mistral_models_default = {
|
|
|
379
459
|
]
|
|
380
460
|
};
|
|
381
461
|
|
|
462
|
+
// src/data/models/google-models.json
|
|
463
|
+
var google_models_default = {
|
|
464
|
+
models: [
|
|
465
|
+
{
|
|
466
|
+
id: "gemma2-9b-it",
|
|
467
|
+
name: "Gemma 2 9B Instruct",
|
|
468
|
+
license: "apache-2.0",
|
|
469
|
+
providers: ["groq"],
|
|
470
|
+
can: ["chat", "text-in", "text-out", "json-out", "function-out"],
|
|
471
|
+
context: {
|
|
472
|
+
total: 8192,
|
|
473
|
+
maxOutput: 4096
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
]
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
// src/data/models/deepseek-models.json
|
|
480
|
+
var deepseek_models_default = {
|
|
481
|
+
models: [
|
|
482
|
+
{
|
|
483
|
+
id: "deepseek-chat",
|
|
484
|
+
name: "DeepSeek V3",
|
|
485
|
+
license: "apache-2.0",
|
|
486
|
+
providers: ["deepseek"],
|
|
487
|
+
can: [
|
|
488
|
+
"chat",
|
|
489
|
+
"text-in",
|
|
490
|
+
"text-out",
|
|
491
|
+
"json-out",
|
|
492
|
+
"function-out"
|
|
493
|
+
],
|
|
494
|
+
context: {
|
|
495
|
+
total: 131072,
|
|
496
|
+
maxOutput: 131072
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
id: "deepseek-reasoner",
|
|
501
|
+
name: "DeepSeek R1",
|
|
502
|
+
license: "apache-2.0",
|
|
503
|
+
providers: ["deepseek"],
|
|
504
|
+
can: [
|
|
505
|
+
"chat",
|
|
506
|
+
"text-in",
|
|
507
|
+
"text-out",
|
|
508
|
+
"json-out",
|
|
509
|
+
"function-out",
|
|
510
|
+
"reason"
|
|
511
|
+
],
|
|
512
|
+
context: {
|
|
513
|
+
total: 131072,
|
|
514
|
+
maxOutput: 131072
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
]
|
|
518
|
+
};
|
|
519
|
+
|
|
382
520
|
// src/builders/models.ts
|
|
383
521
|
function buildAllModels() {
|
|
384
522
|
return [
|
|
385
523
|
...openai_models_default.models,
|
|
386
524
|
...anthropic_models_default.models,
|
|
387
525
|
...meta_models_default.models,
|
|
388
|
-
...mistral_models_default.models
|
|
526
|
+
...mistral_models_default.models,
|
|
527
|
+
...google_models_default.models,
|
|
528
|
+
...deepseek_models_default.models
|
|
389
529
|
];
|
|
390
530
|
}
|
|
391
531
|
|
|
@@ -612,50 +752,31 @@ var creators_default = {
|
|
|
612
752
|
// src/index.ts
|
|
613
753
|
var allModels = buildAllModels();
|
|
614
754
|
var providersData = buildProvidersData();
|
|
615
|
-
var
|
|
616
|
-
all: new ModelCollection(allModels),
|
|
755
|
+
var ModelsCollection = class extends ModelCollection {
|
|
617
756
|
get creators() {
|
|
618
757
|
return Object.keys(creators_default.creators);
|
|
619
|
-
}
|
|
758
|
+
}
|
|
620
759
|
get providers() {
|
|
621
760
|
return providersData.providers.map((p) => p.id);
|
|
622
|
-
}
|
|
761
|
+
}
|
|
623
762
|
fromCreator(creator) {
|
|
624
763
|
return new ModelCollection(
|
|
625
|
-
|
|
764
|
+
this.filter(
|
|
626
765
|
(model) => model.license.startsWith(creator) || // For open source models
|
|
627
|
-
providersData.providers.find((p) => p.id === creator)?.models[model.id]
|
|
766
|
+
!!providersData.providers.find((p) => p.id === creator)?.models[model.id]
|
|
628
767
|
// For proprietary models
|
|
629
768
|
)
|
|
630
769
|
);
|
|
631
|
-
}
|
|
632
|
-
fromProvider(provider) {
|
|
633
|
-
return new ModelCollection(
|
|
634
|
-
allModels.filter((model) => model.providers.includes(provider))
|
|
635
|
-
);
|
|
636
|
-
},
|
|
637
|
-
find(id) {
|
|
638
|
-
return allModels.find((model) => model.id === id);
|
|
639
|
-
},
|
|
640
|
-
can(...capabilities) {
|
|
641
|
-
return new ModelCollection(
|
|
642
|
-
allModels.filter(
|
|
643
|
-
(model) => capabilities.every((capability) => model.can.includes(capability))
|
|
644
|
-
)
|
|
645
|
-
);
|
|
646
|
-
},
|
|
647
|
-
withMinContext(tokens) {
|
|
648
|
-
return new ModelCollection(
|
|
649
|
-
allModels.filter((model) => model.context.total >= tokens)
|
|
650
|
-
);
|
|
651
|
-
},
|
|
770
|
+
}
|
|
652
771
|
getPrice(modelId, provider) {
|
|
653
772
|
const providerData = providersData.providers.find((p) => p.id === provider);
|
|
654
773
|
const price = providerData?.models[modelId];
|
|
655
774
|
return price?.type === "token" ? price : void 0;
|
|
656
775
|
}
|
|
657
776
|
};
|
|
777
|
+
var models = new ModelsCollection(allModels);
|
|
658
778
|
export {
|
|
779
|
+
ModelCollection,
|
|
659
780
|
creators_default as creators,
|
|
660
781
|
models
|
|
661
782
|
};
|