aimodels 0.3.1 → 0.3.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 CHANGED
@@ -31,10 +31,16 @@ declare class ModelCollection extends Array<Model> {
31
31
  withMinContext(tokens: number): ModelCollection;
32
32
  }
33
33
  interface TokenModelContext {
34
- /** Maximum total tokens (input + output) */
34
+ /** Maximum input tokens the model can accept */
35
35
  total: number | null;
36
- /** Maximum output tokens */
36
+ /** Maximum tokens the model can generate in response */
37
37
  maxOutput: number | null;
38
+ /**
39
+ * When set to 1, indicates the model can generate up to maxOutput tokens
40
+ * regardless of input size (as long as input is within total limit).
41
+ * When not set, available output tokens may be reduced based on input size.
42
+ */
43
+ outputIsFixed?: 1;
38
44
  }
39
45
  interface ImageModelContext {
40
46
  /** Maximum outputs per request */
package/dist/index.d.ts CHANGED
@@ -31,10 +31,16 @@ declare class ModelCollection extends Array<Model> {
31
31
  withMinContext(tokens: number): ModelCollection;
32
32
  }
33
33
  interface TokenModelContext {
34
- /** Maximum total tokens (input + output) */
34
+ /** Maximum input tokens the model can accept */
35
35
  total: number | null;
36
- /** Maximum output tokens */
36
+ /** Maximum tokens the model can generate in response */
37
37
  maxOutput: number | null;
38
+ /**
39
+ * When set to 1, indicates the model can generate up to maxOutput tokens
40
+ * regardless of input size (as long as input is within total limit).
41
+ * When not set, available output tokens may be reduced based on input size.
42
+ */
43
+ outputIsFixed?: 1;
38
44
  }
39
45
  interface ImageModelContext {
40
46
  /** Maximum outputs per request */
package/dist/index.js CHANGED
@@ -68,7 +68,10 @@ var ModelCollection = class _ModelCollection extends Array {
68
68
  withMinContext(tokens) {
69
69
  return this.filter((model) => {
70
70
  const context = model.context;
71
- return "total" in context && context.total !== null && context.total >= tokens;
71
+ if (!("total" in context) || context.total === null) {
72
+ return false;
73
+ }
74
+ return context.total >= tokens;
72
75
  });
73
76
  }
74
77
  };
@@ -313,7 +316,7 @@ var anthropic_models_default = {
313
316
  creator: "anthropic",
314
317
  models: [
315
318
  {
316
- id: "claude-3-opus",
319
+ id: "claude-3-opus-20240229",
317
320
  name: "Claude 3 Opus",
318
321
  license: "proprietary",
319
322
  providers: [
@@ -331,11 +334,12 @@ var anthropic_models_default = {
331
334
  ],
332
335
  context: {
333
336
  total: 2e5,
334
- maxOutput: 4096
337
+ maxOutput: 4096,
338
+ outputIsFixed: 1
335
339
  }
336
340
  },
337
341
  {
338
- id: "claude-3-sonnet",
342
+ id: "claude-3-5-sonnet-20241022",
339
343
  name: "Claude 3 Sonnet",
340
344
  license: "proprietary",
341
345
  providers: [
@@ -353,11 +357,12 @@ var anthropic_models_default = {
353
357
  ],
354
358
  context: {
355
359
  total: 2e5,
356
- maxOutput: 4096
360
+ maxOutput: 8192,
361
+ outputIsFixed: 1
357
362
  }
358
363
  },
359
364
  {
360
- id: "claude-3-haiku",
365
+ id: "claude-3-5-haiku-20241022",
361
366
  name: "Claude 3 Haiku",
362
367
  license: "proprietary",
363
368
  providers: [
@@ -375,7 +380,8 @@ var anthropic_models_default = {
375
380
  ],
376
381
  context: {
377
382
  total: 2e5,
378
- maxOutput: 4096
383
+ maxOutput: 8192,
384
+ outputIsFixed: 1
379
385
  }
380
386
  }
381
387
  ]
@@ -645,7 +651,7 @@ var deepseek_models_default = {
645
651
  ],
646
652
  context: {
647
653
  total: 131072,
648
- maxOutput: 131072
654
+ maxOutput: 8192
649
655
  }
650
656
  },
651
657
  {
@@ -663,7 +669,7 @@ var deepseek_models_default = {
663
669
  ],
664
670
  context: {
665
671
  total: 131072,
666
- maxOutput: 131072
672
+ maxOutput: 8192
667
673
  }
668
674
  }
669
675
  ]
@@ -726,6 +732,159 @@ var xai_models_default = {
726
732
  ]
727
733
  };
728
734
 
735
+ // src/data/models/cohere-models.json
736
+ var cohere_models_default = {
737
+ creator: "cohere",
738
+ models: [
739
+ {
740
+ id: "command-r7b-12-2024",
741
+ name: "Command R7B",
742
+ creator: "cohere",
743
+ license: "proprietary",
744
+ providers: ["cohere"],
745
+ can: ["chat", "text-in", "text-out", "reason", "function-out"],
746
+ context: {
747
+ total: 128e3,
748
+ maxOutput: 4096
749
+ }
750
+ },
751
+ {
752
+ id: "command-r-plus-08-2024",
753
+ name: "Command R+",
754
+ creator: "cohere",
755
+ license: "proprietary",
756
+ providers: ["cohere", "bedrock", "azure", "oracle"],
757
+ can: ["chat", "text-in", "text-out", "reason", "function-out"],
758
+ context: {
759
+ total: 128e3,
760
+ maxOutput: 4096
761
+ },
762
+ aliases: ["command-r-plus"]
763
+ },
764
+ {
765
+ id: "command-r-03-2024",
766
+ name: "Command R",
767
+ creator: "cohere",
768
+ license: "proprietary",
769
+ providers: ["cohere", "bedrock", "azure", "oracle"],
770
+ can: ["chat", "text-in", "text-out", "reason", "function-out"],
771
+ context: {
772
+ total: 128e3,
773
+ maxOutput: 4096
774
+ },
775
+ aliases: ["command-r"]
776
+ },
777
+ {
778
+ id: "command",
779
+ name: "Command",
780
+ creator: "cohere",
781
+ license: "proprietary",
782
+ providers: ["cohere", "bedrock", "oracle"],
783
+ can: ["chat", "text-in", "text-out"],
784
+ context: {
785
+ total: 4096,
786
+ maxOutput: 4096
787
+ }
788
+ },
789
+ {
790
+ id: "command-light",
791
+ name: "Command Light",
792
+ creator: "cohere",
793
+ license: "proprietary",
794
+ providers: ["cohere", "bedrock", "oracle"],
795
+ can: ["chat", "text-in", "text-out"],
796
+ context: {
797
+ total: 4096,
798
+ maxOutput: 4096
799
+ }
800
+ },
801
+ {
802
+ id: "embed-english-v3.0",
803
+ name: "Embed English v3.0",
804
+ creator: "cohere",
805
+ license: "proprietary",
806
+ providers: ["cohere", "bedrock", "azure", "oracle"],
807
+ can: ["text-in", "img-in", "vectors-out"],
808
+ context: {
809
+ total: 512,
810
+ maxOutput: 1024
811
+ }
812
+ },
813
+ {
814
+ id: "embed-english-light-v3.0",
815
+ name: "Embed English Light v3.0",
816
+ creator: "cohere",
817
+ license: "proprietary",
818
+ providers: ["cohere", "oracle"],
819
+ can: ["text-in", "img-in", "vectors-out"],
820
+ context: {
821
+ total: 512,
822
+ maxOutput: 384
823
+ }
824
+ },
825
+ {
826
+ id: "embed-multilingual-v3.0",
827
+ name: "Embed Multilingual v3.0",
828
+ creator: "cohere",
829
+ license: "proprietary",
830
+ providers: ["cohere", "bedrock", "azure", "oracle"],
831
+ can: ["text-in", "img-in", "vectors-out"],
832
+ context: {
833
+ total: 512,
834
+ maxOutput: 1024
835
+ }
836
+ },
837
+ {
838
+ id: "embed-multilingual-light-v3.0",
839
+ name: "Embed Multilingual Light v3.0",
840
+ creator: "cohere",
841
+ license: "proprietary",
842
+ providers: ["cohere", "oracle"],
843
+ can: ["text-in", "img-in", "vectors-out"],
844
+ context: {
845
+ total: 512,
846
+ maxOutput: 384
847
+ }
848
+ },
849
+ {
850
+ id: "rerank-v3.5",
851
+ name: "Rerank v3.5",
852
+ creator: "cohere",
853
+ license: "proprietary",
854
+ providers: ["cohere", "bedrock", "azure"],
855
+ can: ["text-in", "text-out"],
856
+ context: {
857
+ total: 4096,
858
+ maxOutput: null
859
+ }
860
+ },
861
+ {
862
+ id: "rerank-english-v3.0",
863
+ name: "Rerank English v3.0",
864
+ creator: "cohere",
865
+ license: "proprietary",
866
+ providers: ["cohere", "azure"],
867
+ can: ["text-in", "text-out"],
868
+ context: {
869
+ total: 4096,
870
+ maxOutput: null
871
+ }
872
+ },
873
+ {
874
+ id: "rerank-multilingual-v3.0",
875
+ name: "Rerank Multilingual v3.0",
876
+ creator: "cohere",
877
+ license: "proprietary",
878
+ providers: ["cohere", "azure"],
879
+ can: ["text-in", "text-out"],
880
+ context: {
881
+ total: 4096,
882
+ maxOutput: null
883
+ }
884
+ }
885
+ ]
886
+ };
887
+
729
888
  // src/builders/models.ts
730
889
  function validateModel(raw) {
731
890
  if (typeof raw !== "object" || raw === null) {
@@ -807,7 +966,8 @@ function buildAllModels() {
807
966
  mistral_models_default,
808
967
  google_models_default,
809
968
  deepseek_models_default,
810
- xai_models_default
969
+ xai_models_default,
970
+ cohere_models_default
811
971
  ];
812
972
  const allModels2 = allModelData.flatMap(
813
973
  (data) => data.models.map((model) => ({
package/dist/index.mjs CHANGED
@@ -40,7 +40,10 @@ var ModelCollection = class _ModelCollection extends Array {
40
40
  withMinContext(tokens) {
41
41
  return this.filter((model) => {
42
42
  const context = model.context;
43
- return "total" in context && context.total !== null && context.total >= tokens;
43
+ if (!("total" in context) || context.total === null) {
44
+ return false;
45
+ }
46
+ return context.total >= tokens;
44
47
  });
45
48
  }
46
49
  };
@@ -285,7 +288,7 @@ var anthropic_models_default = {
285
288
  creator: "anthropic",
286
289
  models: [
287
290
  {
288
- id: "claude-3-opus",
291
+ id: "claude-3-opus-20240229",
289
292
  name: "Claude 3 Opus",
290
293
  license: "proprietary",
291
294
  providers: [
@@ -303,11 +306,12 @@ var anthropic_models_default = {
303
306
  ],
304
307
  context: {
305
308
  total: 2e5,
306
- maxOutput: 4096
309
+ maxOutput: 4096,
310
+ outputIsFixed: 1
307
311
  }
308
312
  },
309
313
  {
310
- id: "claude-3-sonnet",
314
+ id: "claude-3-5-sonnet-20241022",
311
315
  name: "Claude 3 Sonnet",
312
316
  license: "proprietary",
313
317
  providers: [
@@ -325,11 +329,12 @@ var anthropic_models_default = {
325
329
  ],
326
330
  context: {
327
331
  total: 2e5,
328
- maxOutput: 4096
332
+ maxOutput: 8192,
333
+ outputIsFixed: 1
329
334
  }
330
335
  },
331
336
  {
332
- id: "claude-3-haiku",
337
+ id: "claude-3-5-haiku-20241022",
333
338
  name: "Claude 3 Haiku",
334
339
  license: "proprietary",
335
340
  providers: [
@@ -347,7 +352,8 @@ var anthropic_models_default = {
347
352
  ],
348
353
  context: {
349
354
  total: 2e5,
350
- maxOutput: 4096
355
+ maxOutput: 8192,
356
+ outputIsFixed: 1
351
357
  }
352
358
  }
353
359
  ]
@@ -617,7 +623,7 @@ var deepseek_models_default = {
617
623
  ],
618
624
  context: {
619
625
  total: 131072,
620
- maxOutput: 131072
626
+ maxOutput: 8192
621
627
  }
622
628
  },
623
629
  {
@@ -635,7 +641,7 @@ var deepseek_models_default = {
635
641
  ],
636
642
  context: {
637
643
  total: 131072,
638
- maxOutput: 131072
644
+ maxOutput: 8192
639
645
  }
640
646
  }
641
647
  ]
@@ -698,6 +704,159 @@ var xai_models_default = {
698
704
  ]
699
705
  };
700
706
 
707
+ // src/data/models/cohere-models.json
708
+ var cohere_models_default = {
709
+ creator: "cohere",
710
+ models: [
711
+ {
712
+ id: "command-r7b-12-2024",
713
+ name: "Command R7B",
714
+ creator: "cohere",
715
+ license: "proprietary",
716
+ providers: ["cohere"],
717
+ can: ["chat", "text-in", "text-out", "reason", "function-out"],
718
+ context: {
719
+ total: 128e3,
720
+ maxOutput: 4096
721
+ }
722
+ },
723
+ {
724
+ id: "command-r-plus-08-2024",
725
+ name: "Command R+",
726
+ creator: "cohere",
727
+ license: "proprietary",
728
+ providers: ["cohere", "bedrock", "azure", "oracle"],
729
+ can: ["chat", "text-in", "text-out", "reason", "function-out"],
730
+ context: {
731
+ total: 128e3,
732
+ maxOutput: 4096
733
+ },
734
+ aliases: ["command-r-plus"]
735
+ },
736
+ {
737
+ id: "command-r-03-2024",
738
+ name: "Command R",
739
+ creator: "cohere",
740
+ license: "proprietary",
741
+ providers: ["cohere", "bedrock", "azure", "oracle"],
742
+ can: ["chat", "text-in", "text-out", "reason", "function-out"],
743
+ context: {
744
+ total: 128e3,
745
+ maxOutput: 4096
746
+ },
747
+ aliases: ["command-r"]
748
+ },
749
+ {
750
+ id: "command",
751
+ name: "Command",
752
+ creator: "cohere",
753
+ license: "proprietary",
754
+ providers: ["cohere", "bedrock", "oracle"],
755
+ can: ["chat", "text-in", "text-out"],
756
+ context: {
757
+ total: 4096,
758
+ maxOutput: 4096
759
+ }
760
+ },
761
+ {
762
+ id: "command-light",
763
+ name: "Command Light",
764
+ creator: "cohere",
765
+ license: "proprietary",
766
+ providers: ["cohere", "bedrock", "oracle"],
767
+ can: ["chat", "text-in", "text-out"],
768
+ context: {
769
+ total: 4096,
770
+ maxOutput: 4096
771
+ }
772
+ },
773
+ {
774
+ id: "embed-english-v3.0",
775
+ name: "Embed English v3.0",
776
+ creator: "cohere",
777
+ license: "proprietary",
778
+ providers: ["cohere", "bedrock", "azure", "oracle"],
779
+ can: ["text-in", "img-in", "vectors-out"],
780
+ context: {
781
+ total: 512,
782
+ maxOutput: 1024
783
+ }
784
+ },
785
+ {
786
+ id: "embed-english-light-v3.0",
787
+ name: "Embed English Light v3.0",
788
+ creator: "cohere",
789
+ license: "proprietary",
790
+ providers: ["cohere", "oracle"],
791
+ can: ["text-in", "img-in", "vectors-out"],
792
+ context: {
793
+ total: 512,
794
+ maxOutput: 384
795
+ }
796
+ },
797
+ {
798
+ id: "embed-multilingual-v3.0",
799
+ name: "Embed Multilingual v3.0",
800
+ creator: "cohere",
801
+ license: "proprietary",
802
+ providers: ["cohere", "bedrock", "azure", "oracle"],
803
+ can: ["text-in", "img-in", "vectors-out"],
804
+ context: {
805
+ total: 512,
806
+ maxOutput: 1024
807
+ }
808
+ },
809
+ {
810
+ id: "embed-multilingual-light-v3.0",
811
+ name: "Embed Multilingual Light v3.0",
812
+ creator: "cohere",
813
+ license: "proprietary",
814
+ providers: ["cohere", "oracle"],
815
+ can: ["text-in", "img-in", "vectors-out"],
816
+ context: {
817
+ total: 512,
818
+ maxOutput: 384
819
+ }
820
+ },
821
+ {
822
+ id: "rerank-v3.5",
823
+ name: "Rerank v3.5",
824
+ creator: "cohere",
825
+ license: "proprietary",
826
+ providers: ["cohere", "bedrock", "azure"],
827
+ can: ["text-in", "text-out"],
828
+ context: {
829
+ total: 4096,
830
+ maxOutput: null
831
+ }
832
+ },
833
+ {
834
+ id: "rerank-english-v3.0",
835
+ name: "Rerank English v3.0",
836
+ creator: "cohere",
837
+ license: "proprietary",
838
+ providers: ["cohere", "azure"],
839
+ can: ["text-in", "text-out"],
840
+ context: {
841
+ total: 4096,
842
+ maxOutput: null
843
+ }
844
+ },
845
+ {
846
+ id: "rerank-multilingual-v3.0",
847
+ name: "Rerank Multilingual v3.0",
848
+ creator: "cohere",
849
+ license: "proprietary",
850
+ providers: ["cohere", "azure"],
851
+ can: ["text-in", "text-out"],
852
+ context: {
853
+ total: 4096,
854
+ maxOutput: null
855
+ }
856
+ }
857
+ ]
858
+ };
859
+
701
860
  // src/builders/models.ts
702
861
  function validateModel(raw) {
703
862
  if (typeof raw !== "object" || raw === null) {
@@ -779,7 +938,8 @@ function buildAllModels() {
779
938
  mistral_models_default,
780
939
  google_models_default,
781
940
  deepseek_models_default,
782
- xai_models_default
941
+ xai_models_default,
942
+ cohere_models_default
783
943
  ];
784
944
  const allModels2 = allModelData.flatMap(
785
945
  (data) => data.models.map((model) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aimodels",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "A collection of AI model specifications across different providers",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",