adaptive-memory-multi-model-router 2.15.3 → 2.16.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 (37) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/README_ja.md +2 -2
  3. package/README_zh.md +1 -1
  4. package/apps/cost-calculator/README.md +72 -0
  5. package/apps/cost-calculator/calculator.css +280 -0
  6. package/apps/cost-calculator/calculator.js +150 -0
  7. package/apps/cost-calculator/index.html +321 -0
  8. package/apps/cost-calculator/package.json +13 -0
  9. package/articles/ANNOUNCEMENT_reddit_ml.md +76 -0
  10. package/articles/ANNOUNCEMENT_vc/347/244/276/345/214/272.md +71 -0
  11. package/articles/ANNOUNCEMENT_vercel.md +85 -0
  12. package/dist/providers/providerConfig.d.ts +5 -1
  13. package/dist/providers/providerConfig.js +1006 -1
  14. package/dist/providers/providerConfig.js.map +1 -1
  15. package/docs/llms.txt +3 -3
  16. package/package.json +2 -2
  17. package/packages/a3m-vercel-ai/README.md +161 -0
  18. package/packages/a3m-vercel-ai/dist/a3m-language-model.d.ts +12 -0
  19. package/packages/a3m-vercel-ai/dist/a3m-language-model.d.ts.map +1 -0
  20. package/packages/a3m-vercel-ai/dist/a3m-language-model.js +289 -0
  21. package/packages/a3m-vercel-ai/dist/a3m-language-model.js.map +1 -0
  22. package/packages/a3m-vercel-ai/dist/index.d.ts +82 -0
  23. package/packages/a3m-vercel-ai/dist/index.d.ts.map +1 -0
  24. package/packages/a3m-vercel-ai/dist/index.js +79 -0
  25. package/packages/a3m-vercel-ai/dist/index.js.map +1 -0
  26. package/packages/a3m-vercel-ai/dist/types.d.ts +97 -0
  27. package/packages/a3m-vercel-ai/dist/types.d.ts.map +1 -0
  28. package/packages/a3m-vercel-ai/dist/types.js +5 -0
  29. package/packages/a3m-vercel-ai/dist/types.js.map +1 -0
  30. package/packages/a3m-vercel-ai/package-lock.json +969 -0
  31. package/packages/a3m-vercel-ai/package.json +46 -0
  32. package/packages/a3m-vercel-ai/src/a3m-language-model.ts +381 -0
  33. package/packages/a3m-vercel-ai/src/index.ts +104 -0
  34. package/packages/a3m-vercel-ai/src/types.ts +116 -0
  35. package/packages/a3m-vercel-ai/tsconfig.json +20 -0
  36. package/src/providers/providerConfig.ts +1053 -1
  37. package/summary.txt +38 -0
@@ -6,7 +6,11 @@
6
6
  * 2. Config file at ~/.config/a3m-router/providers.json
7
7
  * 3. Runtime registration via registerProvider()
8
8
  *
9
- * 40+ providers across free, cheap, mid-tier, premium, and enterprise tiers.
9
+ * 70+ providers across free, cheap, mid-tier, premium, and enterprise tiers.
10
+ * Coverage: Cloudflare Workers AI, HuggingFace Inference, Modal, Lepton, NVIDIA NIM,
11
+ * Baseten, RunPod, Predibase, Featherless, Abacus, Hyperbolic, Stability AI,
12
+ * SiliconFlow, Yandex, Tencent, VolcEngine, Baidu, Kuaishou, 360 AI, Naver, Kakao,
13
+ * AWS Bedrock/SageMaker, Azure, and more.
10
14
  */
11
15
 
12
16
  import * as fs from 'fs';
@@ -721,6 +725,1054 @@ export const DEFAULT_PROVIDERS: Record<string, ProviderDefinition> = {
721
725
  priority: 4,
722
726
  maxTokens: 8192,
723
727
  },
728
+
729
+ // ========================================================================
730
+ // CLOUDFLARE WORKERS AI (global edge network, free tier)
731
+ // ========================================================================
732
+ cloudflare: {
733
+ id: 'cloudflare',
734
+ name: 'Cloudflare Workers AI',
735
+ baseUrl: 'https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1/run',
736
+ apiKeyEnv: 'CLOUDFLARE_API_TOKEN',
737
+ models: [
738
+ '@cf/meta/llama-3.1-8b-instruct',
739
+ '@cf/meta/llama-3.3-70b-instruct',
740
+ '@cf/meta/llama-3.1-70b-instruct',
741
+ '@cf/qwen/qwen2.5-72b-instruct',
742
+ '@cf/qwen/qwen2.5-32b-instruct',
743
+ '@cf/mistral/mistral-7b-instruct-v0.2',
744
+ '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b',
745
+ '@cf/thebloke/llama-2-13b-chat-awq',
746
+ '@cf/google/gemma-2-27b-it',
747
+ '@cf/fb/detr-image-model',
748
+ ],
749
+ costPerK: { input: 0, output: 0 }, // Free tier available
750
+ tier: 'free',
751
+ format: 'openai',
752
+ type: 'api',
753
+ priority: 4,
754
+ maxTokens: 8192,
755
+ strategy: 'balanced',
756
+ },
757
+
758
+ // ========================================================================
759
+ // HUGGINGFACE INFERENCE API (largest model hub)
760
+ // ========================================================================
761
+ huggingface: {
762
+ id: 'huggingface',
763
+ name: 'HuggingFace Inference',
764
+ baseUrl: 'https://api-inference.huggingface.co/v1/chat/completions',
765
+ apiKeyEnv: 'HF_TOKEN',
766
+ models: [
767
+ 'meta-llama/Llama-3.1-8B-Instruct',
768
+ 'meta-llama/Llama-3.3-70B-Instruct',
769
+ 'mistralai/Mistral-7B-Instruct-v0.2',
770
+ 'mistralai/Mixtral-8x7B-Instruct-v0.1',
771
+ 'Qwen/Qwen2.5-72B-Instruct',
772
+ 'Qwen/Qwen2.5-32B-Instruct',
773
+ 'Qwen/Qwen2.5-14B-Instruct',
774
+ 'deepseek-ai/DeepSeek-V3',
775
+ 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B',
776
+ 'google/gemma-2-27b-it',
777
+ 'google/gemma-2-9b-it',
778
+ 'anthropic/claude-3.5-sonnet',
779
+ 'meta-llama/Llama-4-Maverick-17B-128E-Instruct',
780
+ 'nvidia/Llama-3.1-Nemotron-70B-Instruct-HF',
781
+ ],
782
+ costPerK: { input: 0.06, output: 0.06 }, // Free tier available
783
+ tier: 'cheap',
784
+ format: 'openai',
785
+ type: 'api',
786
+ priority: 8,
787
+ maxTokens: 32768,
788
+ strategy: 'balanced',
789
+ },
790
+
791
+ // ========================================================================
792
+ // MODAL (serverless GPU compute)
793
+ // ========================================================================
794
+ modal: {
795
+ id: 'modal',
796
+ name: 'Modal',
797
+ baseUrl: 'https://api.modal.com/v1/chat/completions',
798
+ apiKeyEnv: 'MODAL_API_TOKEN',
799
+ models: [
800
+ 'meta-llama/Llama-3.1-8B-Instruct',
801
+ 'meta-llama/Llama-3.3-70B-Instruct',
802
+ 'mistralai/Mistral-7B-Instruct-v0.2',
803
+ 'Qwen/Qwen2.5-72B-Instruct',
804
+ ],
805
+ costPerK: { input: 0, output: 0 }, // Pay-per-second GPU compute
806
+ tier: 'cheap',
807
+ format: 'openai',
808
+ type: 'api',
809
+ priority: 9,
810
+ maxTokens: 16384,
811
+ strategy: 'aggressive',
812
+ },
813
+
814
+ // ========================================================================
815
+ // LEPTON AI (serverless, competitive pricing)
816
+ // ========================================================================
817
+ lepton: {
818
+ id: 'lepton',
819
+ name: 'Lepton AI',
820
+ baseUrl: 'https://api.lepton.ai/v1/chat/completions',
821
+ apiKeyEnv: 'LEPTON_API_TOKEN',
822
+ models: [
823
+ 'llama-3.1-8b',
824
+ 'llama-3.1-70b',
825
+ 'mixtral-8x7b',
826
+ 'qwen2.5-72b',
827
+ 'qwen2.5-32b',
828
+ 'gemma-2-27b',
829
+ ],
830
+ costPerK: { input: 0.08, output: 0.08 },
831
+ tier: 'cheap',
832
+ format: 'openai',
833
+ type: 'api',
834
+ priority: 9,
835
+ maxTokens: 16384,
836
+ strategy: 'balanced',
837
+ },
838
+
839
+ // ========================================================================
840
+ // BASETEN (model deployment platform)
841
+ // ========================================================================
842
+ baseten: {
843
+ id: 'baseten',
844
+ name: 'Baseten',
845
+ baseUrl: 'https://api.baseten.co/v1/chat/completions',
846
+ apiKeyEnv: 'BASETEN_API_KEY',
847
+ models: [
848
+ 'llama-3.1-8b-instruct',
849
+ 'llama-3.1-70b-instruct',
850
+ 'mixtral-8x7b-instruct',
851
+ 'wizardlm-2-8x22b',
852
+ ],
853
+ costPerK: { input: 0.5, output: 0.5 },
854
+ tier: 'mid',
855
+ format: 'openai',
856
+ type: 'api',
857
+ priority: 18,
858
+ maxTokens: 8192,
859
+ },
860
+
861
+ // ========================================================================
862
+ // RUNPOD (serverless inference)
863
+ // ========================================================================
864
+ runpod: {
865
+ id: 'runpod',
866
+ name: 'RunPod Serverless',
867
+ baseUrl: 'https://api.runpod.ai/v2/{endpoint_id}/openai/v1/chat/completions',
868
+ apiKeyEnv: 'RUNPOD_API_KEY',
869
+ models: [
870
+ 'meta-llama/Llama-3.1-8B-Instruct',
871
+ 'meta-llama/Llama-3.3-70B-Instruct',
872
+ 'mistralai/Mistral-7B-Instruct-v0.2',
873
+ 'mistralai/Mixtral-8x7B-Instruct-v0.1',
874
+ 'Qwen/Qwen2.5-72B-Instruct',
875
+ ],
876
+ costPerK: { input: 0.2, output: 0.2 },
877
+ tier: 'cheap',
878
+ format: 'openai',
879
+ type: 'api',
880
+ priority: 10,
881
+ maxTokens: 16384,
882
+ },
883
+
884
+ // ========================================================================
885
+ // PREDIBASE (managed fine-tuning + inference)
886
+ // ========================================================================
887
+ predibase: {
888
+ id: 'predibase',
889
+ name: 'Predibase',
890
+ baseUrl: 'https://serving.predibase.com/{workspace}/v2/predict',
891
+ apiKeyEnv: 'PREDIBASE_API_KEY',
892
+ models: [
893
+ 'llama-3.1-8b-instruct',
894
+ 'llama-3.1-70b-instruct',
895
+ 'mistral-7b-instruct',
896
+ 'mixtral-8x7b-instruct',
897
+ 'llama-2-70b-chat',
898
+ ],
899
+ costPerK: { input: 0.4, output: 0.4 },
900
+ tier: 'mid',
901
+ format: 'openai',
902
+ type: 'api',
903
+ priority: 19,
904
+ maxTokens: 8192,
905
+ },
906
+
907
+ // ========================================================================
908
+ // FEATHERLESS AI (inference optimization platform)
909
+ // ========================================================================
910
+ featherless: {
911
+ id: 'featherless',
912
+ name: 'Featherless AI',
913
+ baseUrl: 'https://api.featherless.ai/v1/chat/completions',
914
+ apiKeyEnv: 'FEATHERLESS_API_KEY',
915
+ models: [
916
+ 'anthropic/claude-3.5-sonnet',
917
+ 'meta-llama/llama-3.1-70b-instruct',
918
+ 'mistralai/mistral-large-3-675b-instruct',
919
+ ],
920
+ costPerK: { input: 1.0, output: 2.0 },
921
+ tier: 'mid',
922
+ format: 'openai',
923
+ type: 'api',
924
+ priority: 18,
925
+ maxTokens: 8192,
926
+ },
927
+
928
+ // ========================================================================
929
+ // ABACUS AI (end-to-end ML platform)
930
+ // ========================================================================
931
+ abacus: {
932
+ id: 'abacus',
933
+ name: 'Abacus AI',
934
+ baseUrl: 'https://api.abacus.ai/v1/chat/completions',
935
+ apiKeyEnv: 'ABACUS_API_KEY',
936
+ models: [
937
+ 'Llama-3.1-8B-Instruct',
938
+ 'Llama-3.1-70B-Instruct',
939
+ 'Mistral-7B-Instruct',
940
+ 'Mixtral-8x7B-Instruct',
941
+ 'Qwen2.5-72B-Instruct',
942
+ 'GPT-4o-mini',
943
+ 'Claude-3.5-Sonnet',
944
+ ],
945
+ costPerK: { input: 0.15, output: 0.15 },
946
+ tier: 'cheap',
947
+ format: 'openai',
948
+ type: 'api',
949
+ priority: 11,
950
+ maxTokens: 8192,
951
+ },
952
+
953
+ // ========================================================================
954
+ // STABILITY AI (image + language models)
955
+ // ========================================================================
956
+ stability: {
957
+ id: 'stability',
958
+ name: 'Stability AI',
959
+ baseUrl: 'https://api.stability.ai/v1/chat/completions',
960
+ apiKeyEnv: 'STABILITY_API_KEY',
961
+ models: [
962
+ 'stable-diffusion-xl-base-1.0',
963
+ 'stable-diffusion-3-medium',
964
+ 'stable-diffusion-core',
965
+ ],
966
+ costPerK: { input: 0.5, output: 0.5 },
967
+ tier: 'mid',
968
+ format: 'openai',
969
+ type: 'api',
970
+ priority: 20,
971
+ maxTokens: 8192,
972
+ supports_multimodal: true,
973
+ },
974
+
975
+ // ========================================================================
976
+ // HYPERBOLIC LABS (compute marketplace)
977
+ // ========================================================================
978
+ hyperbolic: {
979
+ id: 'hyperbolic',
980
+ name: 'Hyperbolic',
981
+ baseUrl: 'https://api.hyperbolic.xyz/v1/chat/completions',
982
+ apiKeyEnv: 'HYPERBOLIC_API_KEY',
983
+ models: [
984
+ 'meta-llama/Llama-3.1-8B-Instruct',
985
+ 'meta-llama/Llama-3.1-70B-Instruct',
986
+ 'meta-llama/Llama-3.1-405B-Instruct',
987
+ 'mistralai/Mistral-7B-Instruct-v0.2',
988
+ 'mistralai/Mixtral-8x7B-Instruct-v0.1',
989
+ 'Qwen/Qwen2.5-72B-Instruct',
990
+ 'deepseek-ai/DeepSeek-V3',
991
+ 'deepseek-ai/DeepSeek-R1',
992
+ ],
993
+ costPerK: { input: 0.08, output: 0.08 },
994
+ tier: 'cheap',
995
+ format: 'openai',
996
+ type: 'api',
997
+ priority: 9,
998
+ maxTokens: 32768,
999
+ strategy: 'aggressive',
1000
+ },
1001
+
1002
+ // ========================================================================
1003
+ // TEXTSYNTH (inference API)
1004
+ // ========================================================================
1005
+ textsynth: {
1006
+ id: 'textsynth',
1007
+ name: 'TextSynth',
1008
+ baseUrl: 'https://api.textsynth.com/v1/chat/completions',
1009
+ apiKeyEnv: 'TEXTSYNTH_API_KEY',
1010
+ models: [
1011
+ 'llama-3.1-8b-instruct',
1012
+ 'llama-3.1-70b-instruct',
1013
+ 'mixtral-8x7b',
1014
+ 'gemma-2-27b',
1015
+ ],
1016
+ costPerK: { input: 0.1, output: 0.1 },
1017
+ tier: 'cheap',
1018
+ format: 'openai',
1019
+ type: 'api',
1020
+ priority: 11,
1021
+ maxTokens: 8192,
1022
+ },
1023
+
1024
+ // ========================================================================
1025
+ // INSTILL AI (v3 API, open source)
1026
+ // ========================================================================
1027
+ instill: {
1028
+ id: 'instill',
1029
+ name: 'Instill AI',
1030
+ baseUrl: 'https://api.instill.ai/v1alpha/v1/chat/completions',
1031
+ apiKeyEnv: 'INSTILL_API_KEY',
1032
+ models: [
1033
+ 'meta-llama/llama-3.1-8b-instruct',
1034
+ 'meta-llama/llama-3.1-70b-instruct',
1035
+ 'mistralai/mistral-7b-instruct-v0.2',
1036
+ 'qwen/qwen2.5-72b-instruct',
1037
+ ],
1038
+ costPerK: { input: 0.2, output: 0.2 },
1039
+ tier: 'mid',
1040
+ format: 'openai',
1041
+ type: 'api',
1042
+ priority: 20,
1043
+ maxTokens: 8192,
1044
+ },
1045
+
1046
+ // ========================================================================
1047
+ // SILICONFLOW (China-based inference platform)
1048
+ // ========================================================================
1049
+ siliconflow: {
1050
+ id: 'siliconflow',
1051
+ name: 'SiliconFlow',
1052
+ baseUrl: 'https://api.siliconflow.cn/v1/chat/completions',
1053
+ apiKeyEnv: 'SILICONFLOW_API_KEY',
1054
+ models: [
1055
+ 'Qwen/Qwen2.5-72B-Instruct',
1056
+ 'Qwen/Qwen2.5-32B-Instruct',
1057
+ 'deepseek-ai/DeepSeek-V3',
1058
+ 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B',
1059
+ 'meta-llama/Llama-3.1-70B-Instruct',
1060
+ 'mistralai/Mixtral-8x7B-Instruct-v0.1',
1061
+ ],
1062
+ costPerK: { input: 0.04, output: 0.04 },
1063
+ tier: 'cheap',
1064
+ format: 'openai',
1065
+ type: 'api',
1066
+ priority: 9,
1067
+ maxTokens: 16384,
1068
+ strategy: 'aggressive',
1069
+ },
1070
+
1071
+ // ========================================================================
1072
+ // HYPERSTACK (GPU compute marketplace)
1073
+ // ========================================================================
1074
+ hyperstack: {
1075
+ id: 'hyperstack',
1076
+ name: 'Hyperstack',
1077
+ baseUrl: 'https://api.hyperstack.cloud/v1/chat/completions',
1078
+ apiKeyEnv: 'HYPERSTACK_API_KEY',
1079
+ models: [
1080
+ 'meta-llama/Llama-3.1-8B-Instruct',
1081
+ 'meta-llama/Llama-3.1-70B-Instruct',
1082
+ 'mistralai/Mistral-7B-Instruct-v0.2',
1083
+ 'Qwen/Qwen2.5-72B-Instruct',
1084
+ ],
1085
+ costPerK: { input: 0.1, output: 0.1 },
1086
+ tier: 'cheap',
1087
+ format: 'openai',
1088
+ type: 'api',
1089
+ priority: 11,
1090
+ maxTokens: 16384,
1091
+ },
1092
+
1093
+ // ========================================================================
1094
+ // LIVEPEOPLE (real-time conversational AI)
1095
+ // ========================================================================
1096
+ livepeople: {
1097
+ id: 'livepeople',
1098
+ name: 'LivePeople',
1099
+ baseUrl: 'https://api.livepeople.ai/v1/chat/completions',
1100
+ apiKeyEnv: 'LIVEPEOPLE_API_KEY',
1101
+ models: [
1102
+ 'livepeople-gpt-4o-mini',
1103
+ 'livepeople-gpt-4o',
1104
+ 'livepeople-claude-3-opus',
1105
+ ],
1106
+ costPerK: { input: 1.0, output: 2.0 },
1107
+ tier: 'mid',
1108
+ format: 'openai',
1109
+ type: 'api',
1110
+ priority: 22,
1111
+ maxTokens: 8192,
1112
+ },
1113
+
1114
+ // ========================================================================
1115
+ // YANDEX CLOUD (Yandex GPT)
1116
+ // ========================================================================
1117
+ yandex: {
1118
+ id: 'yandex',
1119
+ name: 'Yandex Cloud',
1120
+ baseUrl: 'https://llm.api.cloud.yandex.net/foundationModels/v1/conversation',
1121
+ apiKeyEnv: 'YANDEX_API_KEY',
1122
+ models: [
1123
+ 'gpt-4o-mini',
1124
+ 'yandexgpt-4',
1125
+ 'yandexgpt-3',
1126
+ 'yandexgpt-light',
1127
+ ],
1128
+ costPerK: { input: 0.3, output: 0.3 },
1129
+ tier: 'mid',
1130
+ format: 'openai',
1131
+ type: 'api',
1132
+ priority: 21,
1133
+ maxTokens: 8192,
1134
+ },
1135
+
1136
+ // ========================================================================
1137
+ // TENCent Hunyuan (Tencent Cloud)
1138
+ // ========================================================================
1139
+ tencent: {
1140
+ id: 'tencent',
1141
+ name: 'Tencent Hunyuan',
1142
+ baseUrl: 'https://api.tc.semnov.com/v1/chat/completions',
1143
+ apiKeyEnv: 'TENCENT_SECRET_ID',
1144
+ models: [
1145
+ 'hunyuan-pro',
1146
+ 'hunyuan-standard',
1147
+ 'hunyuan-lite',
1148
+ ],
1149
+ costPerK: { input: 0.06, output: 0.06 },
1150
+ tier: 'cheap',
1151
+ format: 'openai',
1152
+ type: 'api',
1153
+ priority: 12,
1154
+ maxTokens: 8192,
1155
+ strategy: 'balanced',
1156
+ },
1157
+
1158
+ // ========================================================================
1159
+ // VOLCENGINE (ByteDance AI platform)
1160
+ // ========================================================================
1161
+ volcengine: {
1162
+ id: 'volcengine',
1163
+ name: 'VolcEngine (Doubao)',
1164
+ baseUrl: 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
1165
+ apiKeyEnv: 'VOLCENGINE_API_KEY',
1166
+ models: [
1167
+ 'doubao-pro-32k',
1168
+ 'doubao-pro-128k',
1169
+ 'doubao-lite-32k',
1170
+ 'doubao-edge-4k',
1171
+ ],
1172
+ costPerK: { input: 0.1, output: 0.1 },
1173
+ tier: 'cheap',
1174
+ format: 'openai',
1175
+ type: 'api',
1176
+ priority: 13,
1177
+ maxTokens: 128000,
1178
+ strategy: 'balanced',
1179
+ },
1180
+
1181
+ // ========================================================================
1182
+ // BAIDU QIANFAN (Baidu Cloud)
1183
+ // ========================================================================
1184
+ baidu: {
1185
+ id: 'baidu',
1186
+ name: 'Baidu Qianfan',
1187
+ baseUrl: 'https://qianfan.baidubce.com/v2/chat/completions',
1188
+ apiKeyEnv: 'BAIDU_QIANFAN_API_KEY',
1189
+ models: [
1190
+ 'ernie-4.0-8k-latest',
1191
+ 'ernie-4.0-128k',
1192
+ 'ernie-3.5-8k-pro',
1193
+ 'ernie-speed-128k',
1194
+ 'ernie-speed-pro-128k',
1195
+ 'ernie-lite-8k',
1196
+ ],
1197
+ costPerK: { input: 0.3, output: 0.6 },
1198
+ tier: 'mid',
1199
+ format: 'openai',
1200
+ type: 'api',
1201
+ priority: 20,
1202
+ maxTokens: 128000,
1203
+ },
1204
+
1205
+ // ========================================================================
1206
+ // KUAISHOU (Kling AI video + text)
1207
+ // ========================================================================
1208
+ kuaishou: {
1209
+ id: 'kuaishou',
1210
+ name: 'Kuaishou (Kling)',
1211
+ baseUrl: 'https://api.kuaishou.com/v2/chat/completions',
1212
+ apiKeyEnv: 'KUAISHOU_API_KEY',
1213
+ models: [
1214
+ 'kling-2.0-pro',
1215
+ 'kling-2.0-standard',
1216
+ 'kling-1.6-lite',
1217
+ ],
1218
+ costPerK: { input: 0.1, output: 0.1 },
1219
+ tier: 'cheap',
1220
+ format: 'openai',
1221
+ type: 'api',
1222
+ priority: 13,
1223
+ maxTokens: 8192,
1224
+ supports_multimodal: true,
1225
+ },
1226
+
1227
+ // ========================================================================
1228
+ // 360 AI (360 Cloud Brain)
1229
+ // ========================================================================
1230
+ ai360: {
1231
+ id: 'ai360',
1232
+ name: '360 AI',
1233
+ baseUrl: 'https://ai.360.cn/v1/chat/completions',
1234
+ apiKeyEnv: 'AI360_API_KEY',
1235
+ models: [
1236
+ '360gpt-pro',
1237
+ '360gpt-s2-ultra',
1238
+ '360gpt-t2-pro',
1239
+ ],
1240
+ costPerK: { input: 0.1, output: 0.1 },
1241
+ tier: 'cheap',
1242
+ format: 'openai',
1243
+ type: 'api',
1244
+ priority: 14,
1245
+ maxTokens: 8192,
1246
+ },
1247
+
1248
+ // ========================================================================
1249
+ // NAVER CLOUD (Clova)
1250
+ // ========================================================================
1251
+ naver: {
1252
+ id: 'naver',
1253
+ name: 'Naver Clova',
1254
+ baseUrl: 'https://clovastudio.ncloud.com/v1/api/chat-completions',
1255
+ apiKeyEnv: 'NAVER_CLIENT_ID',
1256
+ models: [
1257
+ 'clova-x',
1258
+ 'hyperspace-1.5',
1259
+ 'clova-cx',
1260
+ ],
1261
+ costPerK: { input: 0.5, output: 1.0 },
1262
+ tier: 'mid',
1263
+ format: 'openai',
1264
+ type: 'api',
1265
+ priority: 21,
1266
+ maxTokens: 8192,
1267
+ strategy: 'conservative',
1268
+ },
1269
+
1270
+ // ========================================================================
1271
+ // KAKAO BRAIN (KoChat)
1272
+ // ========================================================================
1273
+ kakao: {
1274
+ id: 'kakao',
1275
+ name: 'Kakao Brain',
1276
+ baseUrl: 'https://api.kakaobrain.com/v1/chat/completions',
1277
+ apiKeyEnv: 'KAKAO_API_KEY',
1278
+ models: [
1279
+ 'kochat-2-pro',
1280
+ 'kochat-2-ultra',
1281
+ 'kochat-1.8b',
1282
+ 'kochat-6b',
1283
+ ],
1284
+ costPerK: { input: 0.2, output: 0.2 },
1285
+ tier: 'mid',
1286
+ format: 'openai',
1287
+ type: 'api',
1288
+ priority: 22,
1289
+ maxTokens: 8192,
1290
+ },
1291
+
1292
+ // ========================================================================
1293
+ // SAGEMAKER (AWS SageMaker Endpoints)
1294
+ // ========================================================================
1295
+ sagemaker: {
1296
+ id: 'sagemaker',
1297
+ name: 'AWS SageMaker',
1298
+ baseUrl: 'https://runtime.sagemaker.{region}.amazonaws.com/endpoint/{endpoint_name}/invocations',
1299
+ apiKeyEnv: 'AWS_ACCESS_KEY_ID',
1300
+ models: [], // User configures their own endpoints
1301
+ costPerK: { input: 0, output: 0 }, // User-defined pricing
1302
+ tier: 'enterprise',
1303
+ format: 'openai',
1304
+ type: 'api',
1305
+ priority: 30,
1306
+ maxTokens: 8192,
1307
+ },
1308
+
1309
+ // ========================================================================
1310
+ // SCALE AI (Scale Nucleus + API)
1311
+ // ========================================================================
1312
+ scale: {
1313
+ id: 'scale',
1314
+ name: 'Scale AI',
1315
+ baseUrl: 'https://api.scale.com/v1/chat/completions',
1316
+ apiKeyEnv: 'SCALE_API_KEY',
1317
+ models: [
1318
+ 'scale-gpt-4o',
1319
+ 'scale-claude-3-opus',
1320
+ ],
1321
+ costPerK: { input: 2.0, output: 10.0 },
1322
+ tier: 'premium',
1323
+ format: 'openai',
1324
+ type: 'api',
1325
+ priority: 25,
1326
+ maxTokens: 8192,
1327
+ },
1328
+
1329
+ // ========================================================================
1330
+ // TITANIUM NETWORK (AI Gateway)
1331
+ // ========================================================================
1332
+ titanium: {
1333
+ id: 'titanium',
1334
+ name: 'Titanium Network',
1335
+ baseUrl: 'https://api.titaniumapi.dev/v1/chat/completions',
1336
+ apiKeyEnv: 'TITANIUM_API_KEY',
1337
+ models: [
1338
+ 'gpt-4o-mini',
1339
+ 'gpt-4o',
1340
+ 'claude-3-haiku',
1341
+ 'claude-3-sonnet',
1342
+ ],
1343
+ costPerK: { input: 0.3, output: 0.3 },
1344
+ tier: 'mid',
1345
+ format: 'openai',
1346
+ type: 'api',
1347
+ priority: 16,
1348
+ maxTokens: 8192,
1349
+ },
1350
+
1351
+ // ========================================================================
1352
+ // ANTHROPIC via AWS (Bedrock Claude on AWS)
1353
+ // ========================================================================
1354
+ bedrock_anthropic: {
1355
+ id: 'bedrock_anthropic',
1356
+ name: 'AWS Bedrock (Anthropic)',
1357
+ baseUrl: 'https://bedrock-runtime.{region}.amazonaws.com/model/anthropic.claude-3-5-sonnet-20241022/invoke',
1358
+ apiKeyEnv: 'AWS_ACCESS_KEY_ID',
1359
+ models: [
1360
+ 'anthropic.claude-3-5-sonnet-20241022',
1361
+ 'anthropic.claude-3-opus-20240307',
1362
+ 'anthropic.claude-3-sonnet-20240229',
1363
+ 'anthropic.claude-3-haiku-20240307',
1364
+ ],
1365
+ costPerK: { input: 3.0, output: 15.0 },
1366
+ tier: 'enterprise',
1367
+ format: 'openai',
1368
+ type: 'api',
1369
+ priority: 23,
1370
+ maxTokens: 8192,
1371
+ strategy: 'conservative',
1372
+ },
1373
+
1374
+ // ========================================================================
1375
+ // OPENAI via Azure (already have azure_openai, this is direct Azure OpenAI)
1376
+ // ========================================================================
1377
+ azure_openai_direct: {
1378
+ id: 'azure_openai_direct',
1379
+ name: 'Azure OpenAI (Direct)',
1380
+ baseUrl: 'https://{resource}.openai.azure.com/openai/deployments/{deployment}/chat/completions',
1381
+ apiKeyEnv: 'AZURE_OPENAI_API_KEY',
1382
+ models: [
1383
+ 'gpt-4o',
1384
+ 'gpt-4o-mini',
1385
+ 'gpt-4-turbo',
1386
+ 'gpt-4',
1387
+ 'gpt-35-turbo',
1388
+ ],
1389
+ costPerK: { input: 2.5, output: 10.0 },
1390
+ tier: 'enterprise',
1391
+ format: 'openai',
1392
+ type: 'api',
1393
+ priority: 22,
1394
+ maxTokens: 128000,
1395
+ strategy: 'conservative',
1396
+ },
1397
+
1398
+ // ========================================================================
1399
+ // AIZEL CLOUD (Russian AI platform)
1400
+ // ========================================================================
1401
+ aizel: {
1402
+ id: 'aizel',
1403
+ name: 'Aizel Cloud',
1404
+ baseUrl: 'https://api.aizel.ai/v1/chat/completions',
1405
+ apiKeyEnv: 'AIZEL_API_KEY',
1406
+ models: [
1407
+ 'aizel-8b',
1408
+ 'aizel-72b',
1409
+ 'aizel-claude',
1410
+ ],
1411
+ costPerK: { input: 0.15, output: 0.15 },
1412
+ tier: 'cheap',
1413
+ format: 'openai',
1414
+ type: 'api',
1415
+ priority: 15,
1416
+ maxTokens: 8192,
1417
+ },
1418
+
1419
+ // ========================================================================
1420
+ // SKYFIRE (AI API aggregator)
1421
+ // ========================================================================
1422
+ skyfire: {
1423
+ id: 'skyfire',
1424
+ name: 'SkyFire',
1425
+ baseUrl: 'https://api.skyfireai.com/v1/chat/completions',
1426
+ apiKeyEnv: 'SKYFIRE_API_KEY',
1427
+ models: [
1428
+ 'skyfire-gpt-4o-mini',
1429
+ 'skyfire-claude-3-sonnet',
1430
+ 'skyfire-gemini-pro',
1431
+ 'skyfire-llama-3.1-70b',
1432
+ ],
1433
+ costPerK: { input: 0.5, output: 0.5 },
1434
+ tier: 'mid',
1435
+ format: 'openai',
1436
+ type: 'api',
1437
+ priority: 18,
1438
+ maxTokens: 8192,
1439
+ },
1440
+
1441
+ // ========================================================================
1442
+ // POE (Quora's AI platform with 1000s of models)
1443
+ // ========================================================================
1444
+ poe: {
1445
+ id: 'poe',
1446
+ name: 'Poe API',
1447
+ baseUrl: 'https://api.poe.com/v1/chat/completions',
1448
+ apiKeyEnv: 'POE_API_KEY',
1449
+ models: [
1450
+ 'GPT-4o',
1451
+ 'Claude-3.5-Sonnet',
1452
+ 'Claude-3-Opus',
1453
+ 'Claude-3-Haiku',
1454
+ 'Gemini-1.5-Pro',
1455
+ 'Gemini-1.5-Flash',
1456
+ 'Llama-3.1-405B',
1457
+ 'Llama-3.1-70B',
1458
+ 'Llama-3.1-8B',
1459
+ 'Mixtral-8x22B',
1460
+ 'Qwen-2.5-72B',
1461
+ ],
1462
+ costPerK: { input: 0.5, output: 0.5 },
1463
+ tier: 'mid',
1464
+ format: 'openai',
1465
+ type: 'api',
1466
+ priority: 17,
1467
+ maxTokens: 8192,
1468
+ strategy: 'balanced',
1469
+ },
1470
+
1471
+ // ========================================================================
1472
+ // PHIND (AI search for developers)
1473
+ // ========================================================================
1474
+ phind: {
1475
+ id: 'phind',
1476
+ name: 'Phind',
1477
+ baseUrl: 'https://api.phind.com/agent/v1/chat/completions',
1478
+ apiKeyEnv: 'PHIND_API_KEY',
1479
+ models: [
1480
+ 'phind-codestral-2501',
1481
+ 'phind-nemo-2407',
1482
+ 'claude-3.5-sonnet',
1483
+ 'gpt-4o',
1484
+ ],
1485
+ costPerK: { input: 0.2, output: 0.2 },
1486
+ tier: 'cheap',
1487
+ format: 'openai',
1488
+ type: 'api',
1489
+ priority: 12,
1490
+ maxTokens: 8192,
1491
+ },
1492
+
1493
+ // ========================================================================
1494
+ // BANANA (serverless model inference)
1495
+ // ========================================================================
1496
+ banana: {
1497
+ id: 'banana',
1498
+ name: 'Banana',
1499
+ baseUrl: 'https://api.banana.dev/v1/chat/completions',
1500
+ apiKeyEnv: 'BANANA_API_KEY',
1501
+ models: [
1502
+ 'llama-3.1-8b-instruct',
1503
+ 'llama-3.1-70b-instruct',
1504
+ 'mistral-7b-instruct',
1505
+ 'mixtral-8x7b',
1506
+ 'qwen2.5-72b',
1507
+ ],
1508
+ costPerK: { input: 0.2, output: 0.2 },
1509
+ tier: 'cheap',
1510
+ format: 'openai',
1511
+ type: 'api',
1512
+ priority: 12,
1513
+ maxTokens: 8192,
1514
+ },
1515
+
1516
+ // ========================================================================
1517
+ // FOREFRONT AI (enterprise AI platform)
1518
+ // ========================================================================
1519
+ forefront: {
1520
+ id: 'forefront',
1521
+ name: 'Forefront AI',
1522
+ baseUrl: 'https://api.forefront.ai/v1/chat/completions',
1523
+ apiKeyEnv: 'FOREAHEAD_API_KEY',
1524
+ models: [
1525
+ 'gpt-4o-mini',
1526
+ 'gpt-4o',
1527
+ 'claude-3-opus',
1528
+ 'claude-3-sonnet',
1529
+ 'claude-3-haiku',
1530
+ 'gemini-pro-1.5',
1531
+ ],
1532
+ costPerK: { input: 0.5, output: 1.0 },
1533
+ tier: 'mid',
1534
+ format: 'openai',
1535
+ type: 'api',
1536
+ priority: 18,
1537
+ maxTokens: 8192,
1538
+ },
1539
+
1540
+ // ========================================================================
1541
+ // JASPER (AI copywriting)
1542
+ // ========================================================================
1543
+ jasper: {
1544
+ id: 'jasper',
1545
+ name: 'Jasper',
1546
+ baseUrl: 'https://api.jasper.ai/v1/chat/completions',
1547
+ apiKeyEnv: 'JASPER_API_KEY',
1548
+ models: [
1549
+ 'jasper-gpt-4o',
1550
+ 'jasper-claude-3-opus',
1551
+ 'jasper-gemini-pro',
1552
+ ],
1553
+ costPerK: { input: 1.0, output: 2.0 },
1554
+ tier: 'mid',
1555
+ format: 'openai',
1556
+ type: 'api',
1557
+ priority: 24,
1558
+ maxTokens: 8192,
1559
+ },
1560
+
1561
+ // ========================================================================
1562
+ // WRITESONIC (AI content generation)
1563
+ // ========================================================================
1564
+ writesonic: {
1565
+ id: 'writesonic',
1566
+ name: 'Writesonic',
1567
+ baseUrl: 'https://api.writesonic.com/v1/chat/completions',
1568
+ apiKeyEnv: 'WRITESONIC_API_KEY',
1569
+ models: [
1570
+ 'claude-3-opus',
1571
+ 'claude-3-sonnet',
1572
+ 'gpt-4o',
1573
+ 'gpt-4o-mini',
1574
+ ],
1575
+ costPerK: { input: 0.5, output: 1.0 },
1576
+ tier: 'mid',
1577
+ format: 'openai',
1578
+ type: 'api',
1579
+ priority: 23,
1580
+ maxTokens: 8192,
1581
+ },
1582
+
1583
+ // ========================================================================
1584
+ // YOU.COM (AI-powered search)
1585
+ // ========================================================================
1586
+ you: {
1587
+ id: 'you',
1588
+ name: 'You.com',
1589
+ baseUrl: 'https://api.you.com/v1/chat/completions',
1590
+ apiKeyEnv: 'YOU_API_KEY',
1591
+ models: [
1592
+ 'gpt-4o-mini',
1593
+ 'claude-3-sonnet',
1594
+ 'claude-3-haiku',
1595
+ 'llama-3.1-70b',
1596
+ ],
1597
+ costPerK: { input: 0.3, output: 0.3 },
1598
+ tier: 'mid',
1599
+ format: 'openai',
1600
+ type: 'api',
1601
+ priority: 19,
1602
+ maxTokens: 8192,
1603
+ },
1604
+
1605
+ // ========================================================================
1606
+ // KOMO AI (AI search engine)
1607
+ // ========================================================================
1608
+ komo: {
1609
+ id: 'komo',
1610
+ name: 'Komo AI',
1611
+ baseUrl: 'https://api.komo.ai/v1/chat/completions',
1612
+ apiKeyEnv: 'KOMO_API_KEY',
1613
+ models: [
1614
+ 'komo-gpt-4o-mini',
1615
+ 'komo-claude-3-haiku',
1616
+ 'komo-llama-3.1-70b',
1617
+ ],
1618
+ costPerK: { input: 0.2, output: 0.2 },
1619
+ tier: 'cheap',
1620
+ format: 'openai',
1621
+ type: 'api',
1622
+ priority: 14,
1623
+ maxTokens: 8192,
1624
+ },
1625
+
1626
+ // ========================================================================
1627
+ // SHINE (AI platform - Chinese market)
1628
+ // ========================================================================
1629
+ shine: {
1630
+ id: 'shine',
1631
+ name: 'Shine AI',
1632
+ baseUrl: 'https://api.shineai.com/v1/chat/completions',
1633
+ apiKeyEnv: 'SHINE_API_KEY',
1634
+ models: [
1635
+ 'shine-gpt-4o-mini',
1636
+ 'shine-claude-3-haiku',
1637
+ 'shine-qwen2.5-72b',
1638
+ ],
1639
+ costPerK: { input: 0.08, output: 0.08 },
1640
+ tier: 'cheap',
1641
+ format: 'openai',
1642
+ type: 'api',
1643
+ priority: 14,
1644
+ maxTokens: 8192,
1645
+ },
1646
+
1647
+ // ========================================================================
1648
+ // ZHIPU (already exists - adding GLM-4 variant for distinction)
1649
+ // Note: Already defined as 'zhipu' above. This section reserved.
1650
+ // ========================================================================
1651
+
1652
+ // ========================================================================
1653
+ // AIDELabs (AI research platform)
1654
+ // ========================================================================
1655
+ aide: {
1656
+ id: 'aide',
1657
+ name: 'AIDE Labs',
1658
+ baseUrl: 'https://api.aidelabs.ai/v1/chat/completions',
1659
+ apiKeyEnv: 'AIDE_API_KEY',
1660
+ models: [
1661
+ 'aide-gpt-4o-mini',
1662
+ 'aide-claude-3-sonnet',
1663
+ 'aide-llama-3.1-70b',
1664
+ 'aide-qwen-72b',
1665
+ ],
1666
+ costPerK: { input: 0.1, output: 0.1 },
1667
+ tier: 'cheap',
1668
+ format: 'openai',
1669
+ type: 'api',
1670
+ priority: 14,
1671
+ maxTokens: 16384,
1672
+ strategy: 'balanced',
1673
+ },
1674
+
1675
+ // ========================================================================
1676
+ // WRITER (enterprise AI writing platform)
1677
+ // ========================================================================
1678
+ writer: {
1679
+ id: 'writer',
1680
+ name: 'Writer API',
1681
+ baseUrl: 'https://api.writer.com/v1/chat/completions',
1682
+ apiKeyEnv: 'WRITER_API_KEY',
1683
+ models: [
1684
+ 'palmyra-x',
1685
+ 'palmyra-instruct',
1686
+ 'palmyra-lora',
1687
+ ],
1688
+ costPerK: { input: 0.5, output: 1.0 },
1689
+ tier: 'mid',
1690
+ format: 'openai',
1691
+ type: 'api',
1692
+ priority: 24,
1693
+ maxTokens: 8192,
1694
+ },
1695
+
1696
+ // ========================================================================
1697
+ // DBRX (Databricks DBRX model)
1698
+ // ========================================================================
1699
+ databricks: {
1700
+ id: 'databricks',
1701
+ name: 'Databricks',
1702
+ baseUrl: 'https://{workspace}.cloud.databricks.com/serving-endpoints/{endpoint}/invocations',
1703
+ apiKeyEnv: 'DATABRICKS_API_KEY',
1704
+ models: [
1705
+ 'databricks-dbrx-instruct',
1706
+ 'meta-llama-3-70b-instruct',
1707
+ ],
1708
+ costPerK: { input: 0.5, output: 0.5 },
1709
+ tier: 'mid',
1710
+ format: 'openai',
1711
+ type: 'api',
1712
+ priority: 25,
1713
+ maxTokens: 16384,
1714
+ },
1715
+
1716
+ // ========================================================================
1717
+ // MISTRAL via LA PLATEFORME (French AI platform)
1718
+ // ========================================================================
1719
+ laplateforme: {
1720
+ id: 'laplateforme',
1721
+ name: 'La Plateforme',
1722
+ baseUrl: 'https://api.laplateforme.io/v1/chat/completions',
1723
+ apiKeyEnv: 'LAPLATEFORME_API_KEY',
1724
+ models: [
1725
+ 'mistral-7b-instruct-v0.2',
1726
+ 'mixtral-8x7b-instruct-v0.1',
1727
+ 'mistral-large-2409',
1728
+ 'pixtral-12b-2409',
1729
+ ],
1730
+ costPerK: { input: 0.24, output: 0.24 },
1731
+ tier: 'mid',
1732
+ format: 'openai',
1733
+ type: 'api',
1734
+ priority: 18,
1735
+ maxTokens: 32768,
1736
+ },
1737
+
1738
+ // ========================================================================
1739
+ // UPSTAGE AI (Korean AI platform)
1740
+ // ========================================================================
1741
+ upstage: {
1742
+ id: 'upstage',
1743
+ name: 'Upstage',
1744
+ baseUrl: 'https://api.upstage.ai/v1/chat/completions',
1745
+ apiKeyEnv: 'UPSTAGE_API_KEY',
1746
+ models: [
1747
+ 'solar-pro',
1748
+ 'solar-mini',
1749
+ 'solar-document-parse',
1750
+ ],
1751
+ costPerK: { input: 0.3, output: 0.6 },
1752
+ tier: 'mid',
1753
+ format: 'openai',
1754
+ type: 'api',
1755
+ priority: 22,
1756
+ maxTokens: 8192,
1757
+ strategy: 'conservative',
1758
+ },
1759
+
1760
+ // ========================================================================
1761
+ // CLOUDFLARE WAITUNTIL (edge caching for semantic cache)
1762
+ // ========================================================================
1763
+ cloudflare_workers: {
1764
+ id: 'cloudflare_workers',
1765
+ name: 'Cloudflare Workers (Cache)',
1766
+ baseUrl: 'https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/script',
1767
+ apiKeyEnv: 'CLOUDFLARE_API_TOKEN',
1768
+ models: [],
1769
+ costPerK: { input: 0, output: 0 },
1770
+ tier: 'free',
1771
+ format: 'openai',
1772
+ type: 'api',
1773
+ priority: 50,
1774
+ maxTokens: 0,
1775
+ },
724
1776
  };
725
1777
 
726
1778
  // ============================================================