aimodels 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@ aimodels is useful when you need to programmatically access info about AI models
9
9
  aimodels powers:
10
10
  - [aimodels.dev](https://aimodels.dev) - a website about AI models
11
11
  - [aiwrapper](https://github.com/mitkury/aiwrapper) - an AI wrapper for running AI models
12
- - [Supa](https://github.com/supaorg/supa) - an open alternative to ChatGPT
12
+ - [Sila](https://github.com/silaorg/sila) - an open alternative to ChatGPT
13
13
 
14
14
  ## Installation
15
15
 
@@ -55,60 +55,6 @@ function renderModelControls(model) {
55
55
  };
56
56
  }
57
57
 
58
- // 4. Make decisions based on context window size
59
- function selectModelBasedOnInputLength(inputTokens) {
60
- // Find models that can handle your content's size
61
- const suitableModels = models.canChat().filter(model =>
62
- (model.context.total || 0) >= inputTokens
63
- );
64
-
65
- // Sort by context window size (smallest suitable model first)
66
- return suitableModels.sort((a, b) =>
67
- (a.context.total || 0) - (b.context.total || 0)
68
- )[0];
69
- }
70
-
71
- const contentLength = 10000; // tokens
72
- const recommendedModel = selectModelBasedOnInputLength(contentLength);
73
- console.log(`Recommended model: ${recommendedModel?.name}`);
74
-
75
- // 5. Utility function to trim chat messages to fit a model's context window
76
- function trimChatHistory(messages, model, reserveTokens = 500) {
77
- // Only proceed if we have a valid model with a context window
78
- if (!model || !model.context?.total) {
79
- console.warn('Invalid model or missing context window information');
80
- return messages;
81
- }
82
-
83
- const contextWindow = model.context.total;
84
- let totalTokens = 0;
85
- const availableTokens = contextWindow - reserveTokens;
86
- const trimmedMessages = [];
87
-
88
- // This is a simplified token counting approach
89
- // In production, you may use a proper tokenizer for your model
90
- for (const msg of messages.reverse()) {
91
- // If the model can't process images, remove any image attachments
92
- if (!model.canSee() && msg.attachments?.some(a => a.type === 'image')) {
93
- msg.attachments = msg.attachments.filter(a => a.type !== 'image');
94
- }
95
-
96
- const estimatedTokens = JSON.stringify(msg).length / 4;
97
- if (totalTokens + estimatedTokens <= availableTokens) {
98
- trimmedMessages.unshift(msg);
99
- totalTokens += estimatedTokens;
100
- } else {
101
- break;
102
- }
103
- }
104
-
105
- return trimmedMessages;
106
- }
107
-
108
- // Example usage
109
- const chatHistory = [/* array of message objects */];
110
- const gpt5 = models.id('gpt-5.1');
111
- const fittedMessages = trimChatHistory(chatHistory, gpt5);
112
58
  ```
113
59
 
114
60
  ### Available API Methods
package/dist/index.d.ts CHANGED
@@ -68,7 +68,7 @@ interface Provider extends Organization {
68
68
  /**
69
69
  * Defines all possible model capabilities
70
70
  */
71
- type Capability = "chat" | "reason" | "txt-in" | "txt-out" | "img-in" | "img-out" | "audio-in" | "audio-out" | "json-out" | "fn-out" | "vec-out";
71
+ type Capability = "chat" | "reason" | "txt-in" | "txt-out" | "img-in" | "img-out" | "audio-in" | "audio-out" | "video-in" | "video-out" | "json-out" | "fn-out" | "vec-out";
72
72
 
73
73
  interface BaseContext {
74
74
  /** The type discriminator */
@@ -91,7 +91,7 @@ interface TokenContext extends BaseContext {
91
91
  * This is a flexible object that can contain any properties or nested objects
92
92
  * related to model-specific extensions (e.g., reasoning, experimental features).
93
93
  */
94
- extended?: Record<string, any>;
94
+ extended?: Record<string, unknown>;
95
95
  }
96
96
  interface CharacterContext extends BaseContext {
97
97
  type: "character";
package/dist/index.js CHANGED
@@ -1,5 +1,97 @@
1
1
  // src/data.js
2
2
  var models = {
3
+ "claude-sonnet-4-5-20250929": {
4
+ "id": "claude-sonnet-4-5-20250929",
5
+ "name": "Claude Sonnet 4.5",
6
+ "license": "proprietary",
7
+ "capabilities": [
8
+ "chat",
9
+ "txt-in",
10
+ "txt-out",
11
+ "img-in",
12
+ "fn-out",
13
+ "reason"
14
+ ],
15
+ "context": {
16
+ "type": "token",
17
+ "total": 2e5,
18
+ "maxOutput": 64e3,
19
+ "outputIsFixed": 1
20
+ },
21
+ "aliases": [
22
+ "claude-sonnet-4-5"
23
+ ],
24
+ "creatorId": "anthropic"
25
+ },
26
+ "claude-haiku-4-5-20251001": {
27
+ "id": "claude-haiku-4-5-20251001",
28
+ "name": "Claude Haiku 4.5",
29
+ "license": "proprietary",
30
+ "capabilities": [
31
+ "chat",
32
+ "txt-in",
33
+ "txt-out",
34
+ "img-in",
35
+ "fn-out",
36
+ "reason"
37
+ ],
38
+ "context": {
39
+ "type": "token",
40
+ "total": 2e5,
41
+ "maxOutput": 64e3,
42
+ "outputIsFixed": 1
43
+ },
44
+ "aliases": [
45
+ "claude-haiku-4-5"
46
+ ],
47
+ "creatorId": "anthropic"
48
+ },
49
+ "claude-opus-4-5-20251101": {
50
+ "id": "claude-opus-4-5-20251101",
51
+ "name": "Claude Opus 4.5",
52
+ "license": "proprietary",
53
+ "capabilities": [
54
+ "chat",
55
+ "txt-in",
56
+ "txt-out",
57
+ "img-in",
58
+ "fn-out",
59
+ "reason"
60
+ ],
61
+ "context": {
62
+ "type": "token",
63
+ "total": 2e5,
64
+ "maxOutput": 64e3,
65
+ "outputIsFixed": 1
66
+ },
67
+ "aliases": [
68
+ "claude-opus-4-5"
69
+ ],
70
+ "creatorId": "anthropic"
71
+ },
72
+ "claude-opus-4-1-20250805": {
73
+ "id": "claude-opus-4-1-20250805",
74
+ "name": "Claude Opus 4.1",
75
+ "license": "proprietary",
76
+ "capabilities": [
77
+ "chat",
78
+ "txt-in",
79
+ "txt-out",
80
+ "img-in",
81
+ "fn-out",
82
+ "reason"
83
+ ],
84
+ "context": {
85
+ "type": "token",
86
+ "total": 2e5,
87
+ "maxOutput": 32e3,
88
+ "outputIsFixed": 1
89
+ },
90
+ "aliases": [
91
+ "claude-opus-4-1"
92
+ ],
93
+ "creatorId": "anthropic"
94
+ },
3
95
  "claude-opus-4-20250514": {
4
96
  "id": "claude-opus-4-20250514",
5
97
  "name": "Claude Opus 4",
@@ -527,13 +619,13 @@ var models = {
527
619
  "context": {
528
620
  "type": "token",
529
621
  "total": 131072,
530
- "maxOutput": 8192
622
+ "maxOutput": 65536
531
623
  },
532
624
  "creatorId": "deepseek"
533
625
  },
534
- "gemini-2.5-pro-preview-03-25": {
535
- "id": "gemini-2.5-pro-preview-03-25",
536
- "name": "Gemini 2.5 Pro (Preview)",
626
+ "gemini-3-pro-preview": {
627
+ "id": "gemini-3-pro-preview",
628
+ "name": "Gemini 3 Pro Preview",
537
629
  "license": "proprietary",
538
630
  "capabilities": [
539
631
  "chat",
@@ -543,21 +635,19 @@ var models = {
543
635
  "fn-out",
544
636
  "img-in",
545
637
  "audio-in",
638
+ "video-in",
546
639
  "reason"
547
640
  ],
548
641
  "context": {
549
642
  "type": "token",
550
- "total": 1114112,
643
+ "total": 1048576,
551
644
  "maxOutput": 65536
552
645
  },
553
- "aliases": [
554
- "gemini-2.5"
555
- ],
556
646
  "creatorId": "google"
557
647
  },
558
- "gemini-2.5-pro-exp-03-25": {
559
- "id": "gemini-2.5-pro-exp-03-25",
560
- "name": "Gemini 2.5 Pro (Experimental)",
648
+ "gemini-3-flash-preview": {
649
+ "id": "gemini-3-flash-preview",
650
+ "name": "Gemini 3 Flash Preview",
561
651
  "license": "proprietary",
562
652
  "capabilities": [
563
653
  "chat",
@@ -567,240 +657,228 @@ var models = {
567
657
  "fn-out",
568
658
  "img-in",
569
659
  "audio-in",
660
+ "video-in",
570
661
  "reason"
571
662
  ],
572
663
  "context": {
573
664
  "type": "token",
574
- "total": 1114112,
665
+ "total": 1048576,
575
666
  "maxOutput": 65536
576
667
  },
577
- "aliases": [
578
- "gemini-2.5-exp"
579
- ],
580
668
  "creatorId": "google"
581
669
  },
582
- "gemini-2.5-flash-preview": {
583
- "id": "gemini-2.5-flash-preview",
584
- "name": "Gemini 2.5 Flash Preview",
670
+ "gemini-2.5-pro": {
671
+ "id": "gemini-2.5-pro",
672
+ "name": "Gemini 2.5 Pro",
585
673
  "license": "proprietary",
586
674
  "capabilities": [
587
675
  "chat",
588
676
  "txt-in",
589
677
  "txt-out",
678
+ "img-in",
679
+ "audio-in",
680
+ "video-in",
590
681
  "json-out",
591
682
  "fn-out",
592
- "img-in",
593
683
  "reason"
594
684
  ],
595
685
  "context": {
596
686
  "type": "token",
597
687
  "total": 1048576,
598
- "maxOutput": 32768
688
+ "maxOutput": 65536
599
689
  },
690
+ "aliases": [
691
+ "gemini-2.5"
692
+ ],
600
693
  "creatorId": "google"
601
694
  },
602
- "gemma-3-1b": {
603
- "id": "gemma-3-1b",
604
- "name": "Gemma 3 1B",
605
- "license": "apache-2.0",
606
- "capabilities": [
607
- "chat",
608
- "txt-in",
609
- "txt-out",
610
- "json-out",
611
- "fn-out"
612
- ],
613
- "context": {
614
- "type": "token",
615
- "total": 40960,
616
- "maxOutput": 8192
695
+ "gemini-2.5-pro-preview-06-05": {
696
+ "id": "gemini-2.5-pro-preview-06-05",
697
+ "extends": "gemini-2.5-pro",
698
+ "overrides": {
699
+ "name": "Gemini 2.5 Pro Preview 06-05"
617
700
  },
618
701
  "creatorId": "google"
619
702
  },
620
- "gemma-3-4b": {
621
- "id": "gemma-3-4b",
622
- "name": "Gemma 3 4B",
623
- "license": "apache-2.0",
703
+ "gemini-2.5-flash": {
704
+ "id": "gemini-2.5-flash",
705
+ "name": "Gemini 2.5 Flash",
706
+ "license": "proprietary",
624
707
  "capabilities": [
625
708
  "chat",
626
709
  "txt-in",
627
710
  "txt-out",
711
+ "img-in",
712
+ "audio-in",
713
+ "video-in",
628
714
  "json-out",
629
715
  "fn-out",
630
- "img-in"
716
+ "reason"
631
717
  ],
632
718
  "context": {
633
719
  "type": "token",
634
- "total": 40960,
635
- "maxOutput": 8192
720
+ "total": 1048576,
721
+ "maxOutput": 65536
636
722
  },
723
+ "aliases": [
724
+ "gemini-flash-latest"
725
+ ],
637
726
  "creatorId": "google"
638
727
  },
639
- "gemma-3-12b": {
640
- "id": "gemma-3-12b",
641
- "name": "Gemma 3 12B",
642
- "license": "apache-2.0",
728
+ "gemini-2.5-flash-preview-09-2025": {
729
+ "id": "gemini-2.5-flash-preview-09-2025",
730
+ "extends": "gemini-2.5-flash",
731
+ "overrides": {
732
+ "name": "Gemini 2.5 Flash Preview 09-25"
733
+ },
734
+ "creatorId": "google"
735
+ },
736
+ "gemini-2.5-flash-lite": {
737
+ "id": "gemini-2.5-flash-lite",
738
+ "name": "Gemini 2.5 Flash Lite",
739
+ "license": "proprietary",
643
740
  "capabilities": [
644
741
  "chat",
645
742
  "txt-in",
646
743
  "txt-out",
744
+ "img-in",
745
+ "audio-in",
746
+ "video-in",
647
747
  "json-out",
648
748
  "fn-out",
649
- "img-in"
749
+ "reason"
650
750
  ],
651
751
  "context": {
652
752
  "type": "token",
653
- "total": 40960,
654
- "maxOutput": 8192
753
+ "total": 1048576,
754
+ "maxOutput": 65536
755
+ },
756
+ "aliases": [
757
+ "gemini-flash-lite-latest"
758
+ ],
759
+ "creatorId": "google"
760
+ },
761
+ "gemini-2.5-flash-lite-preview-09-2025": {
762
+ "id": "gemini-2.5-flash-lite-preview-09-2025",
763
+ "extends": "gemini-2.5-flash-lite",
764
+ "overrides": {
765
+ "name": "Gemini 2.5 Flash Lite Preview 09-25"
655
766
  },
656
767
  "creatorId": "google"
657
768
  },
658
- "gemma-3-27b": {
659
- "id": "gemma-3-27b",
660
- "name": "Gemma 3 27B",
661
- "license": "apache-2.0",
769
+ "gemini-2.0-flash": {
770
+ "id": "gemini-2.0-flash",
771
+ "name": "Gemini 2.0 Flash",
772
+ "license": "proprietary",
662
773
  "capabilities": [
663
774
  "chat",
664
775
  "txt-in",
665
776
  "txt-out",
777
+ "img-in",
778
+ "audio-in",
779
+ "video-in",
666
780
  "json-out",
667
- "fn-out",
668
- "img-in"
781
+ "fn-out"
669
782
  ],
670
783
  "context": {
671
784
  "type": "token",
672
- "total": 40960,
785
+ "total": 1048576,
673
786
  "maxOutput": 8192
674
787
  },
675
788
  "creatorId": "google"
676
789
  },
677
- "text-embedding-004": {
678
- "id": "text-embedding-004",
679
- "name": "Text Embedding 004",
790
+ "gemini-2.0-flash-lite": {
791
+ "id": "gemini-2.0-flash-lite",
792
+ "name": "Gemini 2.0 Flash Lite",
680
793
  "license": "proprietary",
681
794
  "capabilities": [
795
+ "chat",
682
796
  "txt-in",
683
- "vec-out"
797
+ "txt-out",
798
+ "img-in",
799
+ "audio-in",
800
+ "video-in",
801
+ "json-out",
802
+ "fn-out"
684
803
  ],
685
804
  "context": {
686
805
  "type": "token",
687
- "total": 2048,
688
- "maxOutput": 768
806
+ "total": 1048576,
807
+ "maxOutput": 8192
689
808
  },
690
809
  "creatorId": "google"
691
810
  },
692
- "aqa": {
693
- "id": "aqa",
694
- "name": "Attributed Question Answering",
695
- "license": "proprietary",
811
+ "gemma-3-1b": {
812
+ "id": "gemma-3-1b",
813
+ "name": "Gemma 3 1B",
814
+ "license": "apache-2.0",
696
815
  "capabilities": [
816
+ "chat",
697
817
  "txt-in",
698
- "txt-out"
818
+ "txt-out",
819
+ "json-out",
820
+ "fn-out"
699
821
  ],
700
822
  "context": {
701
823
  "type": "token",
702
- "total": 7168,
703
- "maxOutput": 1024
824
+ "total": 40960,
825
+ "maxOutput": 8192
704
826
  },
705
827
  "creatorId": "google"
706
828
  },
707
- "gemini-2.5-pro-preview-06-05": {
708
- "id": "gemini-2.5-pro-preview-06-05",
709
- "name": "Gemini 2.5 Pro Preview",
710
- "license": "proprietary",
829
+ "gemma-3-4b": {
830
+ "id": "gemma-3-4b",
831
+ "name": "Gemma 3 4B",
832
+ "license": "apache-2.0",
711
833
  "capabilities": [
712
834
  "chat",
713
835
  "txt-in",
714
836
  "txt-out",
715
- "img-in",
716
837
  "json-out",
717
838
  "fn-out",
718
- "reason"
839
+ "img-in"
719
840
  ],
720
841
  "context": {
721
842
  "type": "token",
722
- "total": 1048576,
723
- "maxOutput": 65536
724
- },
725
- "creatorId": "google"
726
- },
727
- "gemini-2.5-pro-preview-05-06": {
728
- "id": "gemini-2.5-pro-preview-05-06",
729
- "extends": "gemini-2.5-pro-preview-06-05",
730
- "overrides": {
731
- "name": "Gemini 2.5 Pro Preview 05-06"
732
- },
733
- "creatorId": "google"
734
- },
735
- "gemini-2.5-flash-preview-05-20": {
736
- "id": "gemini-2.5-flash-preview-05-20",
737
- "extends": "gemini-2.5-flash-preview",
738
- "overrides": {
739
- "name": "Gemini 2.5 Flash Preview 05-20"
740
- },
741
- "creatorId": "google"
742
- },
743
- "gemini-2.5-flash-preview-04-17-thinking": {
744
- "id": "gemini-2.5-flash-preview-04-17-thinking",
745
- "extends": "gemini-2.5-flash-preview",
746
- "overrides": {
747
- "name": "Gemini 2.5 Flash Preview (Thinking)",
748
- "capabilities": [
749
- "chat",
750
- "txt-in",
751
- "txt-out",
752
- "img-in",
753
- "json-out",
754
- "fn-out",
755
- "reason"
756
- ],
757
- "context": {
758
- "type": "token",
759
- "total": 1048576,
760
- "maxOutput": 65536
761
- }
843
+ "total": 40960,
844
+ "maxOutput": 8192
762
845
  },
763
846
  "creatorId": "google"
764
847
  },
765
- "gemini-2.5-flash-preview-tts": {
766
- "id": "gemini-2.5-flash-preview-tts",
767
- "name": "Gemini 2.5 Flash Preview TTS",
768
- "license": "proprietary",
848
+ "gemma-3-12b": {
849
+ "id": "gemma-3-12b",
850
+ "name": "Gemma 3 12B",
851
+ "license": "apache-2.0",
769
852
  "capabilities": [
770
853
  "chat",
771
854
  "txt-in",
772
855
  "txt-out",
773
- "audio-out"
856
+ "json-out",
857
+ "fn-out",
858
+ "img-in"
774
859
  ],
775
860
  "context": {
776
861
  "type": "token",
777
- "total": 8192,
778
- "maxOutput": 16384
779
- },
780
- "creatorId": "google"
781
- },
782
- "gemini-2.5-pro-preview-tts": {
783
- "id": "gemini-2.5-pro-preview-tts",
784
- "extends": "gemini-2.5-flash-preview-tts",
785
- "overrides": {
786
- "name": "Gemini 2.5 Pro Preview TTS"
862
+ "total": 40960,
863
+ "maxOutput": 8192
787
864
  },
788
865
  "creatorId": "google"
789
866
  },
790
- "gemini-2.5-flash-preview-native-audio-dialog": {
791
- "id": "gemini-2.5-flash-preview-native-audio-dialog",
792
- "name": "Gemini 2.5 Flash Preview Native Audio Dialog",
793
- "license": "proprietary",
867
+ "gemma-3-27b": {
868
+ "id": "gemma-3-27b",
869
+ "name": "Gemma 3 27B",
870
+ "license": "apache-2.0",
794
871
  "capabilities": [
795
872
  "chat",
796
873
  "txt-in",
797
874
  "txt-out",
798
- "audio-in",
799
- "audio-out"
875
+ "json-out",
876
+ "fn-out",
877
+ "img-in"
800
878
  ],
801
879
  "context": {
802
880
  "type": "token",
803
- "total": 131072,
881
+ "total": 40960,
804
882
  "maxOutput": 8192
805
883
  },
806
884
  "creatorId": "google"
@@ -867,6 +945,53 @@ var models = {
867
945
  },
868
946
  "creatorId": "google"
869
947
  },
948
+ "text-embedding-004": {
949
+ "id": "text-embedding-004",
950
+ "name": "Text Embedding 004",
951
+ "license": "proprietary",
952
+ "capabilities": [
953
+ "txt-in",
954
+ "vec-out"
955
+ ],
956
+ "context": {
957
+ "type": "token",
958
+ "total": 2048,
959
+ "maxOutput": 768
960
+ },
961
+ "creatorId": "google"
962
+ },
963
+ "gemini-embedding-001": {
964
+ "id": "gemini-embedding-001",
965
+ "name": "Gemini Embedding 001",
966
+ "license": "proprietary",
967
+ "capabilities": [
968
+ "txt-in",
969
+ "vec-out"
970
+ ],
971
+ "context": {
972
+ "type": "embedding",
973
+ "total": 2048,
974
+ "unit": "tokens",
975
+ "dimensions": 3072,
976
+ "embeddingType": "text"
977
+ },
978
+ "creatorId": "google"
979
+ },
980
+ "aqa": {
981
+ "id": "aqa",
982
+ "name": "Attributed Question Answering",
983
+ "license": "proprietary",
984
+ "capabilities": [
985
+ "txt-in",
986
+ "txt-out"
987
+ ],
988
+ "context": {
989
+ "type": "token",
990
+ "total": 7168,
991
+ "maxOutput": 1024
992
+ },
993
+ "creatorId": "google"
994
+ },
870
995
  "gemini-2.5-flash-image": {
871
996
  "id": "gemini-2.5-flash-image",
872
997
  "name": "Gemini 2.5 Flash Image (Nano Banana)",
@@ -906,6 +1031,56 @@ var models = {
906
1031
  },
907
1032
  "creatorId": "google"
908
1033
  },
1034
+ "imagen-4.0-generate-001": {
1035
+ "id": "imagen-4.0-generate-001",
1036
+ "name": "Imagen 4.0",
1037
+ "license": "proprietary",
1038
+ "capabilities": [
1039
+ "txt-in",
1040
+ "img-out"
1041
+ ],
1042
+ "context": {
1043
+ "maxOutput": 4,
1044
+ "sizes": [
1045
+ "1024x1024",
1046
+ "896x1280",
1047
+ "1280x896",
1048
+ "768x1408",
1049
+ "1408x768",
1050
+ "2048x2048",
1051
+ "1792x2560",
1052
+ "2560x1792",
1053
+ "1536x2816",
1054
+ "2816x1536"
1055
+ ]
1056
+ },
1057
+ "creatorId": "google"
1058
+ },
1059
+ "imagen-4.0-ultra-generate-001": {
1060
+ "id": "imagen-4.0-ultra-generate-001",
1061
+ "name": "Imagen 4.0 Ultra",
1062
+ "license": "proprietary",
1063
+ "capabilities": [
1064
+ "txt-in",
1065
+ "img-out"
1066
+ ],
1067
+ "context": {
1068
+ "maxOutput": 4,
1069
+ "sizes": [
1070
+ "1024x1024",
1071
+ "896x1280",
1072
+ "1280x896",
1073
+ "768x1408",
1074
+ "1408x768",
1075
+ "2048x2048",
1076
+ "1792x2560",
1077
+ "2560x1792",
1078
+ "1536x2816",
1079
+ "2816x1536"
1080
+ ]
1081
+ },
1082
+ "creatorId": "google"
1083
+ },
909
1084
  "veo-2.0-generate-001": {
910
1085
  "id": "veo-2.0-generate-001",
911
1086
  "name": "Veo 2",
@@ -921,6 +1096,54 @@ var models = {
921
1096
  },
922
1097
  "creatorId": "google"
923
1098
  },
1099
+ "veo-3.0-generate-preview": {
1100
+ "id": "veo-3.0-generate-preview",
1101
+ "name": "Veo 3.0 Generate",
1102
+ "license": "proprietary",
1103
+ "capabilities": [
1104
+ "txt-in",
1105
+ "img-in",
1106
+ "video-out"
1107
+ ],
1108
+ "context": {
1109
+ "type": "token",
1110
+ "total": 480,
1111
+ "maxOutput": 8192
1112
+ },
1113
+ "creatorId": "google"
1114
+ },
1115
+ "veo-3.1-generate-preview": {
1116
+ "id": "veo-3.1-generate-preview",
1117
+ "name": "Veo 3.1 Generate",
1118
+ "license": "proprietary",
1119
+ "capabilities": [
1120
+ "txt-in",
1121
+ "img-in",
1122
+ "video-out"
1123
+ ],
1124
+ "context": {
1125
+ "type": "token",
1126
+ "total": 480,
1127
+ "maxOutput": 8192
1128
+ },
1129
+ "creatorId": "google"
1130
+ },
1131
+ "veo-3.1-fast-generate-preview": {
1132
+ "id": "veo-3.1-fast-generate-preview",
1133
+ "name": "Veo 3.1 Fast Generate",
1134
+ "license": "proprietary",
1135
+ "capabilities": [
1136
+ "txt-in",
1137
+ "img-in",
1138
+ "video-out"
1139
+ ],
1140
+ "context": {
1141
+ "type": "token",
1142
+ "total": 480,
1143
+ "maxOutput": 8192
1144
+ },
1145
+ "creatorId": "google"
1146
+ },
924
1147
  "llama-4-scout": {
925
1148
  "id": "llama-4-scout",
926
1149
  "name": "Llama 4 Scout",
@@ -1055,6 +1278,151 @@ var models = {
1055
1278
  },
1056
1279
  "creatorId": "meta"
1057
1280
  },
1281
+ "llama-3.1-8b-instant": {
1282
+ "id": "llama-3.1-8b-instant",
1283
+ "name": "Llama 3.1 8B",
1284
+ "license": "llama-3-community",
1285
+ "capabilities": [
1286
+ "chat",
1287
+ "txt-in",
1288
+ "txt-out",
1289
+ "json-out",
1290
+ "fn-out"
1291
+ ],
1292
+ "context": {
1293
+ "type": "token",
1294
+ "total": 131072,
1295
+ "maxOutput": 131072
1296
+ },
1297
+ "aliases": [
1298
+ "llama-3.1-8b"
1299
+ ],
1300
+ "creatorId": "meta"
1301
+ },
1302
+ "llama-3.3-70b-versatile": {
1303
+ "id": "llama-3.3-70b-versatile",
1304
+ "name": "Llama 3.3 70B",
1305
+ "license": "llama-3-community",
1306
+ "capabilities": [
1307
+ "chat",
1308
+ "txt-in",
1309
+ "txt-out",
1310
+ "json-out",
1311
+ "fn-out"
1312
+ ],
1313
+ "context": {
1314
+ "type": "token",
1315
+ "total": 131072,
1316
+ "maxOutput": 32768
1317
+ },
1318
+ "aliases": [
1319
+ "llama-3.3-70b"
1320
+ ],
1321
+ "creatorId": "meta"
1322
+ },
1323
+ "meta-llama/llama-guard-4-12b": {
1324
+ "id": "meta-llama/llama-guard-4-12b",
1325
+ "name": "LlamaGuard 4 12B",
1326
+ "license": "llama-4-community",
1327
+ "capabilities": [
1328
+ "chat",
1329
+ "txt-in",
1330
+ "txt-out"
1331
+ ],
1332
+ "context": {
1333
+ "type": "token",
1334
+ "total": 131072,
1335
+ "maxOutput": 1024
1336
+ },
1337
+ "aliases": [
1338
+ "llama-guard-4-12b"
1339
+ ],
1340
+ "creatorId": "meta"
1341
+ },
1342
+ "meta-llama/llama-4-maverick-17b-128e-instruct": {
1343
+ "id": "meta-llama/llama-4-maverick-17b-128e-instruct",
1344
+ "name": "Llama 4 Maverick 17B 128E",
1345
+ "license": "llama-4-community",
1346
+ "capabilities": [
1347
+ "chat",
1348
+ "txt-in",
1349
+ "txt-out",
1350
+ "json-out",
1351
+ "fn-out",
1352
+ "img-in",
1353
+ "reason"
1354
+ ],
1355
+ "context": {
1356
+ "type": "token",
1357
+ "total": 131072,
1358
+ "maxOutput": 8192
1359
+ },
1360
+ "aliases": [
1361
+ "llama-4-maverick-17b-128e"
1362
+ ],
1363
+ "creatorId": "meta"
1364
+ },
1365
+ "meta-llama/llama-4-scout-17b-16e-instruct": {
1366
+ "id": "meta-llama/llama-4-scout-17b-16e-instruct",
1367
+ "name": "Llama 4 Scout 17B 16E",
1368
+ "license": "llama-4-community",
1369
+ "capabilities": [
1370
+ "chat",
1371
+ "txt-in",
1372
+ "txt-out",
1373
+ "json-out",
1374
+ "fn-out",
1375
+ "img-in",
1376
+ "reason"
1377
+ ],
1378
+ "context": {
1379
+ "type": "token",
1380
+ "total": 131072,
1381
+ "maxOutput": 8192
1382
+ },
1383
+ "aliases": [
1384
+ "llama-4-scout-17b-16e"
1385
+ ],
1386
+ "creatorId": "meta"
1387
+ },
1388
+ "meta-llama/llama-prompt-guard-2-22m": {
1389
+ "id": "meta-llama/llama-prompt-guard-2-22m",
1390
+ "name": "Llama Prompt Guard 2 22M",
1391
+ "license": "llama-3-community",
1392
+ "capabilities": [
1393
+ "chat",
1394
+ "txt-in",
1395
+ "txt-out"
1396
+ ],
1397
+ "context": {
1398
+ "type": "token",
1399
+ "total": 512,
1400
+ "maxOutput": 512
1401
+ },
1402
+ "aliases": [
1403
+ "llama-prompt-guard-2-22m"
1404
+ ],
1405
+ "creatorId": "meta"
1406
+ },
1407
+ "meta-llama/llama-prompt-guard-2-86m": {
1408
+ "id": "meta-llama/llama-prompt-guard-2-86m",
1409
+ "name": "Llama Prompt Guard 2 86M",
1410
+ "license": "llama-3-community",
1411
+ "capabilities": [
1412
+ "chat",
1413
+ "txt-in",
1414
+ "txt-out"
1415
+ ],
1416
+ "context": {
1417
+ "type": "token",
1418
+ "total": 512,
1419
+ "maxOutput": 512
1420
+ },
1421
+ "aliases": [
1422
+ "llama-prompt-guard-2-86m"
1423
+ ],
1424
+ "creatorId": "meta"
1425
+ },
1058
1426
  "mistral-medium-3-2025-05-07": {
1059
1427
  "id": "mistral-medium-3-2025-05-07",
1060
1428
  "name": "Mistral Medium 3",
@@ -1212,6 +1580,18 @@ var models = {
1212
1580
  ],
1213
1581
  "creatorId": "openai"
1214
1582
  },
1583
+ "gpt-5.2": {
1584
+ "id": "gpt-5.2",
1585
+ "extends": "gpt-5.1",
1586
+ "overrides": {
1587
+ "name": "GPT-5.2",
1588
+ "aliases": [
1589
+ "gpt-5.2-latest",
1590
+ "gpt-5.2-chat-latest"
1591
+ ]
1592
+ },
1593
+ "creatorId": "openai"
1594
+ },
1215
1595
  "gpt-4o": {
1216
1596
  "id": "gpt-4o",
1217
1597
  "name": "GPT-4o",
@@ -1277,6 +1657,42 @@ var models = {
1277
1657
  ],
1278
1658
  "creatorId": "openai"
1279
1659
  },
1660
+ "gpt-oss-120b": {
1661
+ "id": "gpt-oss-120b",
1662
+ "name": "GPT OSS 120B",
1663
+ "license": "proprietary",
1664
+ "capabilities": [
1665
+ "chat",
1666
+ "txt-in",
1667
+ "txt-out",
1668
+ "fn-out",
1669
+ "reason"
1670
+ ],
1671
+ "context": {
1672
+ "type": "token",
1673
+ "total": 131072,
1674
+ "maxOutput": 65536
1675
+ },
1676
+ "creatorId": "openai"
1677
+ },
1678
+ "gpt-oss-20b": {
1679
+ "id": "gpt-oss-20b",
1680
+ "name": "GPT OSS 20B",
1681
+ "license": "proprietary",
1682
+ "capabilities": [
1683
+ "chat",
1684
+ "txt-in",
1685
+ "txt-out",
1686
+ "fn-out",
1687
+ "reason"
1688
+ ],
1689
+ "context": {
1690
+ "type": "token",
1691
+ "total": 131072,
1692
+ "maxOutput": 65536
1693
+ },
1694
+ "creatorId": "openai"
1695
+ },
1280
1696
  "whisper-1": {
1281
1697
  "id": "whisper-1",
1282
1698
  "name": "Whisper",
@@ -1835,6 +2251,113 @@ var models = {
1835
2251
  "grok-4-heavy-latest"
1836
2252
  ],
1837
2253
  "creatorId": "xai"
2254
+ },
2255
+ "grok-code-fast-1": {
2256
+ "id": "grok-code-fast-1",
2257
+ "name": "Grok Code Fast 1",
2258
+ "creator": "xai",
2259
+ "license": "proprietary",
2260
+ "capabilities": [
2261
+ "chat",
2262
+ "txt-in",
2263
+ "txt-out",
2264
+ "reason",
2265
+ "fn-out",
2266
+ "json-out"
2267
+ ],
2268
+ "context": {
2269
+ "type": "token",
2270
+ "total": 256e3,
2271
+ "maxOutput": 1e4
2272
+ },
2273
+ "releasedAt": "2025-08-28",
2274
+ "creatorId": "xai"
2275
+ },
2276
+ "grok-4-fast": {
2277
+ "id": "grok-4-fast",
2278
+ "name": "Grok 4 Fast",
2279
+ "creator": "xai",
2280
+ "license": "proprietary",
2281
+ "capabilities": [
2282
+ "chat",
2283
+ "txt-in",
2284
+ "txt-out",
2285
+ "img-in",
2286
+ "reason",
2287
+ "fn-out",
2288
+ "json-out"
2289
+ ],
2290
+ "context": {
2291
+ "type": "token",
2292
+ "total": 2e6,
2293
+ "maxOutput": 3e4
2294
+ },
2295
+ "releasedAt": "2025-09-19",
2296
+ "creatorId": "xai"
2297
+ },
2298
+ "grok-4-fast-non-reasoning": {
2299
+ "id": "grok-4-fast-non-reasoning",
2300
+ "name": "Grok 4 Fast (Non-Reasoning)",
2301
+ "creator": "xai",
2302
+ "license": "proprietary",
2303
+ "capabilities": [
2304
+ "chat",
2305
+ "txt-in",
2306
+ "txt-out",
2307
+ "img-in",
2308
+ "fn-out",
2309
+ "json-out"
2310
+ ],
2311
+ "context": {
2312
+ "type": "token",
2313
+ "total": 2e6,
2314
+ "maxOutput": 3e4
2315
+ },
2316
+ "releasedAt": "2025-09-19",
2317
+ "creatorId": "xai"
2318
+ },
2319
+ "grok-4-1-fast": {
2320
+ "id": "grok-4-1-fast",
2321
+ "name": "Grok 4.1 Fast",
2322
+ "creator": "xai",
2323
+ "license": "proprietary",
2324
+ "capabilities": [
2325
+ "chat",
2326
+ "txt-in",
2327
+ "txt-out",
2328
+ "img-in",
2329
+ "reason",
2330
+ "fn-out",
2331
+ "json-out"
2332
+ ],
2333
+ "context": {
2334
+ "type": "token",
2335
+ "total": 2e6,
2336
+ "maxOutput": 3e4
2337
+ },
2338
+ "releasedAt": "2025-11-19",
2339
+ "creatorId": "xai"
2340
+ },
2341
+ "grok-4-1-fast-non-reasoning": {
2342
+ "id": "grok-4-1-fast-non-reasoning",
2343
+ "name": "Grok 4.1 Fast (Non-Reasoning)",
2344
+ "creator": "xai",
2345
+ "license": "proprietary",
2346
+ "capabilities": [
2347
+ "chat",
2348
+ "txt-in",
2349
+ "txt-out",
2350
+ "img-in",
2351
+ "fn-out",
2352
+ "json-out"
2353
+ ],
2354
+ "context": {
2355
+ "type": "token",
2356
+ "total": 2e6,
2357
+ "maxOutput": 3e4
2358
+ },
2359
+ "releasedAt": "2025-11-19",
2360
+ "creatorId": "xai"
1838
2361
  }
1839
2362
  };
1840
2363
  var providers = {
@@ -1892,7 +2415,32 @@ var providers = {
1892
2415
  "name": "Groq",
1893
2416
  "apiUrl": "https://api.groq.com/openai/v1",
1894
2417
  "apiDocsUrl": "https://console.groq.com/docs/api-reference",
1895
- "pricing": {}
2418
+ "pricing": {},
2419
+ "models": [
2420
+ {
2421
+ "creator": "meta",
2422
+ "include": [
2423
+ "llama3-8b-8192",
2424
+ "llama3-70b-8192",
2425
+ "llama-guard-3-8b",
2426
+ "llama-3.1-8b-instant",
2427
+ "llama-3.3-70b-versatile",
2428
+ "meta-llama/llama-guard-4-12b",
2429
+ "meta-llama/llama-4-maverick-17b-128e-instruct",
2430
+ "meta-llama/llama-4-scout-17b-16e-instruct",
2431
+ "meta-llama/llama-prompt-guard-2-22m",
2432
+ "meta-llama/llama-prompt-guard-2-86m"
2433
+ ]
2434
+ },
2435
+ {
2436
+ "creator": "openai",
2437
+ "include": [
2438
+ "gpt-oss-120b",
2439
+ "gpt-oss-20b",
2440
+ "whisper-1"
2441
+ ]
2442
+ }
2443
+ ]
1896
2444
  },
1897
2445
  "mistral": {
1898
2446
  "id": "mistral",
@@ -1910,7 +2458,17 @@ var providers = {
1910
2458
  "name": "OpenAI",
1911
2459
  "apiUrl": "https://api.openai.com/v1",
1912
2460
  "apiDocsUrl": "https://platform.openai.com/docs/api-reference",
1913
- "pricing": {}
2461
+ "pricing": {},
2462
+ "models": [
2463
+ {
2464
+ "creator": "openai",
2465
+ "include": "all",
2466
+ "exclude": [
2467
+ "gpt-oss-120b",
2468
+ "gpt-oss-20b"
2469
+ ]
2470
+ }
2471
+ ]
1914
2472
  },
1915
2473
  "openrouter": {
1916
2474
  "id": "openrouter",
@@ -2262,21 +2820,33 @@ var Model = class _Model {
2262
2820
  get providerIds() {
2263
2821
  const ids = /* @__PURE__ */ new Set();
2264
2822
  const creatorId = this.creatorId;
2265
- if (creatorId && ModelCollection.providersData[creatorId]) {
2266
- ids.add(creatorId);
2267
- }
2823
+ if (!creatorId) return [];
2824
+ const includesModel = (entry) => {
2825
+ if (entry.creator !== creatorId) return false;
2826
+ if (entry.include === "all") {
2827
+ return !entry.exclude || !entry.exclude.includes(this.id);
2828
+ }
2829
+ return Array.isArray(entry.include) && entry.include.includes(this.id);
2830
+ };
2268
2831
  for (const [providerId, provider] of Object.entries(ModelCollection.providersData)) {
2832
+ const isNative = providerId === creatorId;
2269
2833
  const entries = provider.models;
2270
- if (!entries) continue;
2271
- for (const entry of entries) {
2272
- if (entry.creator !== creatorId) continue;
2273
- if (entry.include === "all") {
2274
- if (!entry.exclude || !entry.exclude.includes(this.id)) {
2275
- ids.add(providerId);
2276
- }
2277
- } else if (Array.isArray(entry.include) && entry.include.includes(this.id)) {
2834
+ if (isNative) {
2835
+ if (!entries || entries.length === 0) {
2836
+ ids.add(providerId);
2837
+ continue;
2838
+ }
2839
+ const creatorEntry = entries.find((e) => e.creator === creatorId);
2840
+ if (!creatorEntry) {
2841
+ ids.add(providerId);
2842
+ } else if (includesModel(creatorEntry)) {
2278
2843
  ids.add(providerId);
2279
2844
  }
2845
+ continue;
2846
+ }
2847
+ if (!entries) continue;
2848
+ if (entries.some(includesModel)) {
2849
+ ids.add(providerId);
2280
2850
  }
2281
2851
  }
2282
2852
  return Array.from(ids);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aimodels",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "A collection of AI model specifications across different providers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,16 +25,17 @@
25
25
  "build:ts": "tsup",
26
26
  "build": "npm run build:ts && npm test",
27
27
  "test": "vitest run",
28
+ "test:all": "vitest run --include tests/**/*.test.ts",
28
29
  "test:watch": "vitest watch",
29
30
  "test:coverage": "vitest run --coverage",
30
31
  "typecheck": "tsc --noEmit",
31
32
  "lint": "eslint src --ext .ts",
32
33
  "clean": "rm -rf dist",
33
- "prepare": "echo \"skip prepare for this publish\"",
34
+ "prepare": "npm run build",
34
35
  "preversion": "npm run typecheck && npm run lint && npm test",
35
36
  "version": "git add -A",
36
37
  "postversion": "git push && git push --tags",
37
- "prepublishOnly": "echo \"skip prepublishOnly for this publish\"",
38
+ "prepublishOnly": "npm run typecheck && npm run lint && npm run build",
38
39
  "postpublish": "npm run clean",
39
40
  "rules": "airul generate",
40
41
  "rules:comment": "# Generate AI rules from documentation",