aimodels 0.3.0 → 0.3.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/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +169 -4
- package/dist/index.mjs +169 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -23,7 +23,7 @@ declare class ModelCollection extends Array<Model> {
|
|
|
23
23
|
filter(predicate: (value: Model, index: number, array: Model[]) => boolean): ModelCollection;
|
|
24
24
|
/** Override array slice to return ModelCollection */
|
|
25
25
|
slice(start?: number, end?: number): ModelCollection;
|
|
26
|
-
/** Find a model by its ID */
|
|
26
|
+
/** Find a model by its ID or alias */
|
|
27
27
|
id(modelId: string): Model | undefined;
|
|
28
28
|
/** Get models available from a specific provider */
|
|
29
29
|
fromProvider(provider: string): ModelCollection;
|
|
@@ -60,6 +60,8 @@ interface Model {
|
|
|
60
60
|
can: Capability[];
|
|
61
61
|
/** Languages the model knows */
|
|
62
62
|
languages?: string[];
|
|
63
|
+
/** Alternative identifiers for this model */
|
|
64
|
+
aliases?: string[];
|
|
63
65
|
/** Context window information */
|
|
64
66
|
context: ModelContext;
|
|
65
67
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare class ModelCollection extends Array<Model> {
|
|
|
23
23
|
filter(predicate: (value: Model, index: number, array: Model[]) => boolean): ModelCollection;
|
|
24
24
|
/** Override array slice to return ModelCollection */
|
|
25
25
|
slice(start?: number, end?: number): ModelCollection;
|
|
26
|
-
/** Find a model by its ID */
|
|
26
|
+
/** Find a model by its ID or alias */
|
|
27
27
|
id(modelId: string): Model | undefined;
|
|
28
28
|
/** Get models available from a specific provider */
|
|
29
29
|
fromProvider(provider: string): ModelCollection;
|
|
@@ -60,6 +60,8 @@ interface Model {
|
|
|
60
60
|
can: Capability[];
|
|
61
61
|
/** Languages the model knows */
|
|
62
62
|
languages?: string[];
|
|
63
|
+
/** Alternative identifiers for this model */
|
|
64
|
+
aliases?: string[];
|
|
63
65
|
/** Context window information */
|
|
64
66
|
context: ModelContext;
|
|
65
67
|
}
|
package/dist/index.js
CHANGED
|
@@ -54,9 +54,11 @@ var ModelCollection = class _ModelCollection extends Array {
|
|
|
54
54
|
const sliced = Array.from(this).slice(start, end);
|
|
55
55
|
return new _ModelCollection(sliced);
|
|
56
56
|
}
|
|
57
|
-
/** Find a model by its ID */
|
|
57
|
+
/** Find a model by its ID or alias */
|
|
58
58
|
id(modelId) {
|
|
59
|
-
return this.find(
|
|
59
|
+
return this.find(
|
|
60
|
+
(model) => model.id === modelId || model.aliases?.includes(modelId)
|
|
61
|
+
);
|
|
60
62
|
}
|
|
61
63
|
/** Get models available from a specific provider */
|
|
62
64
|
fromProvider(provider) {
|
|
@@ -724,6 +726,159 @@ var xai_models_default = {
|
|
|
724
726
|
]
|
|
725
727
|
};
|
|
726
728
|
|
|
729
|
+
// src/data/models/cohere-models.json
|
|
730
|
+
var cohere_models_default = {
|
|
731
|
+
creator: "cohere",
|
|
732
|
+
models: [
|
|
733
|
+
{
|
|
734
|
+
id: "command-r7b-12-2024",
|
|
735
|
+
name: "Command R7B",
|
|
736
|
+
creator: "cohere",
|
|
737
|
+
license: "proprietary",
|
|
738
|
+
providers: ["cohere"],
|
|
739
|
+
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
740
|
+
context: {
|
|
741
|
+
total: 128e3,
|
|
742
|
+
maxOutput: 4096
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
id: "command-r-plus-08-2024",
|
|
747
|
+
name: "Command R+",
|
|
748
|
+
creator: "cohere",
|
|
749
|
+
license: "proprietary",
|
|
750
|
+
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
751
|
+
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
752
|
+
context: {
|
|
753
|
+
total: 128e3,
|
|
754
|
+
maxOutput: 4096
|
|
755
|
+
},
|
|
756
|
+
aliases: ["command-r-plus"]
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
id: "command-r-03-2024",
|
|
760
|
+
name: "Command R",
|
|
761
|
+
creator: "cohere",
|
|
762
|
+
license: "proprietary",
|
|
763
|
+
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
764
|
+
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
765
|
+
context: {
|
|
766
|
+
total: 128e3,
|
|
767
|
+
maxOutput: 4096
|
|
768
|
+
},
|
|
769
|
+
aliases: ["command-r"]
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
id: "command",
|
|
773
|
+
name: "Command",
|
|
774
|
+
creator: "cohere",
|
|
775
|
+
license: "proprietary",
|
|
776
|
+
providers: ["cohere", "bedrock", "oracle"],
|
|
777
|
+
can: ["chat", "text-in", "text-out"],
|
|
778
|
+
context: {
|
|
779
|
+
total: 4096,
|
|
780
|
+
maxOutput: 4096
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
id: "command-light",
|
|
785
|
+
name: "Command Light",
|
|
786
|
+
creator: "cohere",
|
|
787
|
+
license: "proprietary",
|
|
788
|
+
providers: ["cohere", "bedrock", "oracle"],
|
|
789
|
+
can: ["chat", "text-in", "text-out"],
|
|
790
|
+
context: {
|
|
791
|
+
total: 4096,
|
|
792
|
+
maxOutput: 4096
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
id: "embed-english-v3.0",
|
|
797
|
+
name: "Embed English v3.0",
|
|
798
|
+
creator: "cohere",
|
|
799
|
+
license: "proprietary",
|
|
800
|
+
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
801
|
+
can: ["text-in", "img-in", "vectors-out"],
|
|
802
|
+
context: {
|
|
803
|
+
total: 512,
|
|
804
|
+
maxOutput: 1024
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
id: "embed-english-light-v3.0",
|
|
809
|
+
name: "Embed English Light v3.0",
|
|
810
|
+
creator: "cohere",
|
|
811
|
+
license: "proprietary",
|
|
812
|
+
providers: ["cohere", "oracle"],
|
|
813
|
+
can: ["text-in", "img-in", "vectors-out"],
|
|
814
|
+
context: {
|
|
815
|
+
total: 512,
|
|
816
|
+
maxOutput: 384
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
id: "embed-multilingual-v3.0",
|
|
821
|
+
name: "Embed Multilingual v3.0",
|
|
822
|
+
creator: "cohere",
|
|
823
|
+
license: "proprietary",
|
|
824
|
+
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
825
|
+
can: ["text-in", "img-in", "vectors-out"],
|
|
826
|
+
context: {
|
|
827
|
+
total: 512,
|
|
828
|
+
maxOutput: 1024
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
id: "embed-multilingual-light-v3.0",
|
|
833
|
+
name: "Embed Multilingual Light v3.0",
|
|
834
|
+
creator: "cohere",
|
|
835
|
+
license: "proprietary",
|
|
836
|
+
providers: ["cohere", "oracle"],
|
|
837
|
+
can: ["text-in", "img-in", "vectors-out"],
|
|
838
|
+
context: {
|
|
839
|
+
total: 512,
|
|
840
|
+
maxOutput: 384
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
id: "rerank-v3.5",
|
|
845
|
+
name: "Rerank v3.5",
|
|
846
|
+
creator: "cohere",
|
|
847
|
+
license: "proprietary",
|
|
848
|
+
providers: ["cohere", "bedrock", "azure"],
|
|
849
|
+
can: ["text-in", "text-out"],
|
|
850
|
+
context: {
|
|
851
|
+
total: 4096,
|
|
852
|
+
maxOutput: null
|
|
853
|
+
}
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
id: "rerank-english-v3.0",
|
|
857
|
+
name: "Rerank English v3.0",
|
|
858
|
+
creator: "cohere",
|
|
859
|
+
license: "proprietary",
|
|
860
|
+
providers: ["cohere", "azure"],
|
|
861
|
+
can: ["text-in", "text-out"],
|
|
862
|
+
context: {
|
|
863
|
+
total: 4096,
|
|
864
|
+
maxOutput: null
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
id: "rerank-multilingual-v3.0",
|
|
869
|
+
name: "Rerank Multilingual v3.0",
|
|
870
|
+
creator: "cohere",
|
|
871
|
+
license: "proprietary",
|
|
872
|
+
providers: ["cohere", "azure"],
|
|
873
|
+
can: ["text-in", "text-out"],
|
|
874
|
+
context: {
|
|
875
|
+
total: 4096,
|
|
876
|
+
maxOutput: null
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
]
|
|
880
|
+
};
|
|
881
|
+
|
|
727
882
|
// src/builders/models.ts
|
|
728
883
|
function validateModel(raw) {
|
|
729
884
|
if (typeof raw !== "object" || raw === null) {
|
|
@@ -761,6 +916,14 @@ function validateModel(raw) {
|
|
|
761
916
|
if (!model.can.every((c) => validCapabilities.includes(c))) {
|
|
762
917
|
throw new Error(`Model has invalid capabilities: ${model.can.join(", ")}`);
|
|
763
918
|
}
|
|
919
|
+
if (model.aliases !== void 0) {
|
|
920
|
+
if (!Array.isArray(model.aliases)) {
|
|
921
|
+
throw new Error("Model aliases must be an array");
|
|
922
|
+
}
|
|
923
|
+
if (!model.aliases.every((a) => typeof a === "string")) {
|
|
924
|
+
throw new Error("Model aliases must be strings");
|
|
925
|
+
}
|
|
926
|
+
}
|
|
764
927
|
if (typeof model.context !== "object" || model.context === null) {
|
|
765
928
|
throw new Error("Model context must be an object");
|
|
766
929
|
}
|
|
@@ -785,7 +948,8 @@ function validateModel(raw) {
|
|
|
785
948
|
providers: model.providers,
|
|
786
949
|
can: model.can,
|
|
787
950
|
context: model.context,
|
|
788
|
-
...model.languages ? { languages: model.languages } : {}
|
|
951
|
+
...model.languages ? { languages: model.languages } : {},
|
|
952
|
+
...model.aliases ? { aliases: model.aliases } : {}
|
|
789
953
|
};
|
|
790
954
|
}
|
|
791
955
|
function buildAllModels() {
|
|
@@ -796,7 +960,8 @@ function buildAllModels() {
|
|
|
796
960
|
mistral_models_default,
|
|
797
961
|
google_models_default,
|
|
798
962
|
deepseek_models_default,
|
|
799
|
-
xai_models_default
|
|
963
|
+
xai_models_default,
|
|
964
|
+
cohere_models_default
|
|
800
965
|
];
|
|
801
966
|
const allModels2 = allModelData.flatMap(
|
|
802
967
|
(data) => data.models.map((model) => ({
|
package/dist/index.mjs
CHANGED
|
@@ -26,9 +26,11 @@ var ModelCollection = class _ModelCollection extends Array {
|
|
|
26
26
|
const sliced = Array.from(this).slice(start, end);
|
|
27
27
|
return new _ModelCollection(sliced);
|
|
28
28
|
}
|
|
29
|
-
/** Find a model by its ID */
|
|
29
|
+
/** Find a model by its ID or alias */
|
|
30
30
|
id(modelId) {
|
|
31
|
-
return this.find(
|
|
31
|
+
return this.find(
|
|
32
|
+
(model) => model.id === modelId || model.aliases?.includes(modelId)
|
|
33
|
+
);
|
|
32
34
|
}
|
|
33
35
|
/** Get models available from a specific provider */
|
|
34
36
|
fromProvider(provider) {
|
|
@@ -696,6 +698,159 @@ var xai_models_default = {
|
|
|
696
698
|
]
|
|
697
699
|
};
|
|
698
700
|
|
|
701
|
+
// src/data/models/cohere-models.json
|
|
702
|
+
var cohere_models_default = {
|
|
703
|
+
creator: "cohere",
|
|
704
|
+
models: [
|
|
705
|
+
{
|
|
706
|
+
id: "command-r7b-12-2024",
|
|
707
|
+
name: "Command R7B",
|
|
708
|
+
creator: "cohere",
|
|
709
|
+
license: "proprietary",
|
|
710
|
+
providers: ["cohere"],
|
|
711
|
+
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
712
|
+
context: {
|
|
713
|
+
total: 128e3,
|
|
714
|
+
maxOutput: 4096
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
id: "command-r-plus-08-2024",
|
|
719
|
+
name: "Command R+",
|
|
720
|
+
creator: "cohere",
|
|
721
|
+
license: "proprietary",
|
|
722
|
+
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
723
|
+
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
724
|
+
context: {
|
|
725
|
+
total: 128e3,
|
|
726
|
+
maxOutput: 4096
|
|
727
|
+
},
|
|
728
|
+
aliases: ["command-r-plus"]
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
id: "command-r-03-2024",
|
|
732
|
+
name: "Command R",
|
|
733
|
+
creator: "cohere",
|
|
734
|
+
license: "proprietary",
|
|
735
|
+
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
736
|
+
can: ["chat", "text-in", "text-out", "reason", "function-out"],
|
|
737
|
+
context: {
|
|
738
|
+
total: 128e3,
|
|
739
|
+
maxOutput: 4096
|
|
740
|
+
},
|
|
741
|
+
aliases: ["command-r"]
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
id: "command",
|
|
745
|
+
name: "Command",
|
|
746
|
+
creator: "cohere",
|
|
747
|
+
license: "proprietary",
|
|
748
|
+
providers: ["cohere", "bedrock", "oracle"],
|
|
749
|
+
can: ["chat", "text-in", "text-out"],
|
|
750
|
+
context: {
|
|
751
|
+
total: 4096,
|
|
752
|
+
maxOutput: 4096
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
id: "command-light",
|
|
757
|
+
name: "Command Light",
|
|
758
|
+
creator: "cohere",
|
|
759
|
+
license: "proprietary",
|
|
760
|
+
providers: ["cohere", "bedrock", "oracle"],
|
|
761
|
+
can: ["chat", "text-in", "text-out"],
|
|
762
|
+
context: {
|
|
763
|
+
total: 4096,
|
|
764
|
+
maxOutput: 4096
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
id: "embed-english-v3.0",
|
|
769
|
+
name: "Embed English v3.0",
|
|
770
|
+
creator: "cohere",
|
|
771
|
+
license: "proprietary",
|
|
772
|
+
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
773
|
+
can: ["text-in", "img-in", "vectors-out"],
|
|
774
|
+
context: {
|
|
775
|
+
total: 512,
|
|
776
|
+
maxOutput: 1024
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
id: "embed-english-light-v3.0",
|
|
781
|
+
name: "Embed English Light v3.0",
|
|
782
|
+
creator: "cohere",
|
|
783
|
+
license: "proprietary",
|
|
784
|
+
providers: ["cohere", "oracle"],
|
|
785
|
+
can: ["text-in", "img-in", "vectors-out"],
|
|
786
|
+
context: {
|
|
787
|
+
total: 512,
|
|
788
|
+
maxOutput: 384
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
id: "embed-multilingual-v3.0",
|
|
793
|
+
name: "Embed Multilingual v3.0",
|
|
794
|
+
creator: "cohere",
|
|
795
|
+
license: "proprietary",
|
|
796
|
+
providers: ["cohere", "bedrock", "azure", "oracle"],
|
|
797
|
+
can: ["text-in", "img-in", "vectors-out"],
|
|
798
|
+
context: {
|
|
799
|
+
total: 512,
|
|
800
|
+
maxOutput: 1024
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
id: "embed-multilingual-light-v3.0",
|
|
805
|
+
name: "Embed Multilingual Light v3.0",
|
|
806
|
+
creator: "cohere",
|
|
807
|
+
license: "proprietary",
|
|
808
|
+
providers: ["cohere", "oracle"],
|
|
809
|
+
can: ["text-in", "img-in", "vectors-out"],
|
|
810
|
+
context: {
|
|
811
|
+
total: 512,
|
|
812
|
+
maxOutput: 384
|
|
813
|
+
}
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
id: "rerank-v3.5",
|
|
817
|
+
name: "Rerank v3.5",
|
|
818
|
+
creator: "cohere",
|
|
819
|
+
license: "proprietary",
|
|
820
|
+
providers: ["cohere", "bedrock", "azure"],
|
|
821
|
+
can: ["text-in", "text-out"],
|
|
822
|
+
context: {
|
|
823
|
+
total: 4096,
|
|
824
|
+
maxOutput: null
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
id: "rerank-english-v3.0",
|
|
829
|
+
name: "Rerank English v3.0",
|
|
830
|
+
creator: "cohere",
|
|
831
|
+
license: "proprietary",
|
|
832
|
+
providers: ["cohere", "azure"],
|
|
833
|
+
can: ["text-in", "text-out"],
|
|
834
|
+
context: {
|
|
835
|
+
total: 4096,
|
|
836
|
+
maxOutput: null
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
id: "rerank-multilingual-v3.0",
|
|
841
|
+
name: "Rerank Multilingual v3.0",
|
|
842
|
+
creator: "cohere",
|
|
843
|
+
license: "proprietary",
|
|
844
|
+
providers: ["cohere", "azure"],
|
|
845
|
+
can: ["text-in", "text-out"],
|
|
846
|
+
context: {
|
|
847
|
+
total: 4096,
|
|
848
|
+
maxOutput: null
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
]
|
|
852
|
+
};
|
|
853
|
+
|
|
699
854
|
// src/builders/models.ts
|
|
700
855
|
function validateModel(raw) {
|
|
701
856
|
if (typeof raw !== "object" || raw === null) {
|
|
@@ -733,6 +888,14 @@ function validateModel(raw) {
|
|
|
733
888
|
if (!model.can.every((c) => validCapabilities.includes(c))) {
|
|
734
889
|
throw new Error(`Model has invalid capabilities: ${model.can.join(", ")}`);
|
|
735
890
|
}
|
|
891
|
+
if (model.aliases !== void 0) {
|
|
892
|
+
if (!Array.isArray(model.aliases)) {
|
|
893
|
+
throw new Error("Model aliases must be an array");
|
|
894
|
+
}
|
|
895
|
+
if (!model.aliases.every((a) => typeof a === "string")) {
|
|
896
|
+
throw new Error("Model aliases must be strings");
|
|
897
|
+
}
|
|
898
|
+
}
|
|
736
899
|
if (typeof model.context !== "object" || model.context === null) {
|
|
737
900
|
throw new Error("Model context must be an object");
|
|
738
901
|
}
|
|
@@ -757,7 +920,8 @@ function validateModel(raw) {
|
|
|
757
920
|
providers: model.providers,
|
|
758
921
|
can: model.can,
|
|
759
922
|
context: model.context,
|
|
760
|
-
...model.languages ? { languages: model.languages } : {}
|
|
923
|
+
...model.languages ? { languages: model.languages } : {},
|
|
924
|
+
...model.aliases ? { aliases: model.aliases } : {}
|
|
761
925
|
};
|
|
762
926
|
}
|
|
763
927
|
function buildAllModels() {
|
|
@@ -768,7 +932,8 @@ function buildAllModels() {
|
|
|
768
932
|
mistral_models_default,
|
|
769
933
|
google_models_default,
|
|
770
934
|
deepseek_models_default,
|
|
771
|
-
xai_models_default
|
|
935
|
+
xai_models_default,
|
|
936
|
+
cohere_models_default
|
|
772
937
|
];
|
|
773
938
|
const allModels2 = allModelData.flatMap(
|
|
774
939
|
(data) => data.models.map((model) => ({
|