@dofe/infra-contracts 0.1.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.
@@ -0,0 +1,904 @@
1
+ "use strict";
2
+ /**
3
+ * Provider types, configs, and helpers.
4
+ * Extracted from @repo/contracts/schemas/provider.schema.ts — zero dependencies.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.PROVIDER_VENDORS = exports.PROVIDER_CONFIGS = void 0;
8
+ exports.getProviderDefaultApiHost = getProviderDefaultApiHost;
9
+ exports.getEffectiveApiHost = getEffectiveApiHost;
10
+ exports.isProviderVendor = isProviderVendor;
11
+ exports.isProviderApiType = isProviderApiType;
12
+ exports.getProviderConfig = getProviderConfig;
13
+ exports.getProvidersByCategory = getProvidersByCategory;
14
+ // ============================================================================
15
+ // All provider configurations
16
+ // ============================================================================
17
+ exports.PROVIDER_CONFIGS = {
18
+ openai: {
19
+ id: 'openai',
20
+ name: 'OpenAI',
21
+ apiType: 'openai-response',
22
+ category: 'international',
23
+ apiHost: 'https://api.openai.com/v1',
24
+ logo: 'openai.svg',
25
+ description: 'OpenAI provides GPT-4, GPT-3.5 and other advanced LLMs',
26
+ supportedModelTypes: ['llm', 'text-embedding', 'speech2text', 'tts', 'image', 'moderation'],
27
+ credentialFormSchemas: [
28
+ { variable: 'api_key', label: 'API Key', type: 'secret-input', required: true, placeholder: 'sk-...' },
29
+ { variable: 'organization', label: 'Organization ID', type: 'text-input', required: false, placeholder: 'org-...' },
30
+ ],
31
+ websites: {
32
+ official: 'https://openai.com/',
33
+ apiKey: 'https://platform.openai.com/api-keys',
34
+ docs: 'https://platform.openai.com/docs',
35
+ models: 'https://platform.openai.com/docs/models',
36
+ },
37
+ },
38
+ anthropic: {
39
+ id: 'anthropic',
40
+ name: 'Anthropic',
41
+ apiType: 'anthropic',
42
+ category: 'international',
43
+ apiHost: 'https://api.anthropic.com',
44
+ logo: 'anthropic.svg',
45
+ description: 'Anthropic provides the Claude series of models',
46
+ supportedModelTypes: ['llm'],
47
+ credentialFormSchemas: [
48
+ { variable: 'api_key', label: 'API Key', type: 'secret-input', required: true, placeholder: 'sk-ant-...' },
49
+ ],
50
+ websites: {
51
+ official: 'https://anthropic.com/',
52
+ apiKey: 'https://console.anthropic.com/settings/keys',
53
+ docs: 'https://docs.anthropic.com/en/docs',
54
+ models: 'https://docs.anthropic.com/en/docs/about-claude/models',
55
+ },
56
+ },
57
+ google: {
58
+ id: 'google',
59
+ name: 'Google Gemini',
60
+ apiType: 'gemini',
61
+ category: 'international',
62
+ apiHost: 'https://generativelanguage.googleapis.com/v1beta',
63
+ logo: 'google.svg',
64
+ description: 'Google Gemini multimodal AI models',
65
+ supportedModelTypes: ['llm', 'text-embedding', 'image'],
66
+ credentialFormSchemas: [
67
+ { variable: 'api_key', label: 'API Key', type: 'secret-input', required: true, placeholder: 'AIza...' },
68
+ ],
69
+ websites: {
70
+ official: 'https://gemini.google.com/',
71
+ apiKey: 'https://aistudio.google.com/app/apikey',
72
+ docs: 'https://ai.google.dev/gemini-api/docs',
73
+ models: 'https://ai.google.dev/gemini-api/docs/models/gemini',
74
+ },
75
+ },
76
+ 'azure-openai': {
77
+ id: 'azure-openai',
78
+ name: 'Azure OpenAI',
79
+ apiType: 'azure-openai',
80
+ category: 'international',
81
+ apiHost: '',
82
+ logo: 'azure.svg',
83
+ requiresExtraConfig: true,
84
+ websites: {
85
+ official: 'https://azure.microsoft.com/en-us/products/ai-services/openai-service',
86
+ apiKey: 'https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI',
87
+ docs: 'https://learn.microsoft.com/en-us/azure/ai-services/openai/',
88
+ models: 'https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models',
89
+ },
90
+ },
91
+ 'aws-bedrock': {
92
+ id: 'aws-bedrock',
93
+ name: 'AWS Bedrock',
94
+ apiType: 'aws-bedrock',
95
+ category: 'international',
96
+ apiHost: '',
97
+ logo: 'aws.svg',
98
+ requiresExtraConfig: true,
99
+ websites: {
100
+ official: 'https://aws.amazon.com/bedrock/',
101
+ apiKey: 'https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html',
102
+ docs: 'https://docs.aws.amazon.com/bedrock/',
103
+ models: 'https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html',
104
+ },
105
+ },
106
+ vertexai: {
107
+ id: 'vertexai',
108
+ name: 'Google Vertex AI',
109
+ apiType: 'vertexai',
110
+ category: 'international',
111
+ apiHost: '',
112
+ logo: 'google-cloud.svg',
113
+ requiresExtraConfig: true,
114
+ websites: {
115
+ official: 'https://cloud.google.com/vertex-ai',
116
+ apiKey: 'https://console.cloud.google.com/apis/credentials',
117
+ docs: 'https://cloud.google.com/vertex-ai/generative-ai/docs',
118
+ models: 'https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models',
119
+ },
120
+ },
121
+ mistral: {
122
+ id: 'mistral',
123
+ name: 'Mistral AI',
124
+ apiType: 'openai',
125
+ category: 'international',
126
+ apiHost: 'https://api.mistral.ai/v1',
127
+ logo: 'mistral.svg',
128
+ websites: {
129
+ official: 'https://mistral.ai',
130
+ apiKey: 'https://console.mistral.ai/api-keys/',
131
+ docs: 'https://docs.mistral.ai',
132
+ models: 'https://docs.mistral.ai/getting-started/models/models_overview',
133
+ },
134
+ },
135
+ groq: {
136
+ id: 'groq',
137
+ name: 'Groq',
138
+ apiType: 'openai',
139
+ category: 'international',
140
+ apiHost: 'https://api.groq.com/openai/v1',
141
+ logo: 'groq.svg',
142
+ websites: {
143
+ official: 'https://groq.com/',
144
+ apiKey: 'https://console.groq.com/keys',
145
+ docs: 'https://console.groq.com/docs/quickstart',
146
+ models: 'https://console.groq.com/docs/models',
147
+ },
148
+ },
149
+ together: {
150
+ id: 'together',
151
+ name: 'Together AI',
152
+ apiType: 'openai',
153
+ category: 'international',
154
+ apiHost: 'https://api.together.xyz/v1',
155
+ websites: {
156
+ official: 'https://www.together.ai/',
157
+ apiKey: 'https://api.together.ai/settings/api-keys',
158
+ docs: 'https://docs.together.ai/docs/introduction',
159
+ models: 'https://docs.together.ai/docs/serverless-models',
160
+ },
161
+ },
162
+ fireworks: {
163
+ id: 'fireworks',
164
+ name: 'Fireworks AI',
165
+ apiType: 'openai',
166
+ category: 'international',
167
+ apiHost: 'https://api.fireworks.ai/inference/v1',
168
+ websites: {
169
+ official: 'https://fireworks.ai/',
170
+ apiKey: 'https://fireworks.ai/account/api-keys',
171
+ docs: 'https://docs.fireworks.ai/getting-started/introduction',
172
+ models: 'https://fireworks.ai/dashboard/models',
173
+ },
174
+ },
175
+ perplexity: {
176
+ id: 'perplexity',
177
+ name: 'Perplexity',
178
+ apiType: 'openai',
179
+ category: 'international',
180
+ apiHost: 'https://api.perplexity.ai',
181
+ websites: {
182
+ official: 'https://perplexity.ai/',
183
+ apiKey: 'https://www.perplexity.ai/settings/api',
184
+ docs: 'https://docs.perplexity.ai/home',
185
+ models: 'https://docs.perplexity.ai/guides/model-cards',
186
+ },
187
+ },
188
+ grok: {
189
+ id: 'grok',
190
+ name: 'Grok (xAI)',
191
+ apiType: 'openai',
192
+ category: 'international',
193
+ apiHost: 'https://api.x.ai/v1',
194
+ websites: {
195
+ official: 'https://x.ai/',
196
+ docs: 'https://docs.x.ai/',
197
+ models: 'https://docs.x.ai/docs/models',
198
+ },
199
+ },
200
+ nvidia: {
201
+ id: 'nvidia',
202
+ name: 'NVIDIA NIM',
203
+ apiType: 'openai',
204
+ category: 'international',
205
+ apiHost: 'https://integrate.api.nvidia.com/v1',
206
+ websites: {
207
+ official: 'https://build.nvidia.com/explore/discover',
208
+ apiKey: 'https://build.nvidia.com/meta/llama-3_1-405b-instruct',
209
+ docs: 'https://docs.api.nvidia.com/nim/reference/llm-apis',
210
+ models: 'https://build.nvidia.com/nim',
211
+ },
212
+ },
213
+ hyperbolic: {
214
+ id: 'hyperbolic',
215
+ name: 'Hyperbolic',
216
+ apiType: 'openai',
217
+ category: 'international',
218
+ apiHost: 'https://api.hyperbolic.xyz/v1',
219
+ websites: {
220
+ official: 'https://app.hyperbolic.xyz',
221
+ apiKey: 'https://app.hyperbolic.xyz/settings',
222
+ docs: 'https://docs.hyperbolic.xyz',
223
+ models: 'https://app.hyperbolic.xyz/models',
224
+ },
225
+ },
226
+ cerebras: {
227
+ id: 'cerebras',
228
+ name: 'Cerebras',
229
+ apiType: 'openai',
230
+ category: 'international',
231
+ apiHost: 'https://api.cerebras.ai/v1',
232
+ websites: {
233
+ official: 'https://www.cerebras.ai',
234
+ apiKey: 'https://cloud.cerebras.ai',
235
+ docs: 'https://inference-docs.cerebras.ai/introduction',
236
+ models: 'https://inference-docs.cerebras.ai/models/overview',
237
+ },
238
+ },
239
+ huggingface: {
240
+ id: 'huggingface',
241
+ name: 'Hugging Face',
242
+ apiType: 'openai-response',
243
+ category: 'international',
244
+ apiHost: 'https://router.huggingface.co/v1',
245
+ websites: {
246
+ official: 'https://huggingface.co/',
247
+ apiKey: 'https://huggingface.co/settings/tokens',
248
+ docs: 'https://huggingface.co/docs',
249
+ models: 'https://huggingface.co/models',
250
+ },
251
+ },
252
+ github: {
253
+ id: 'github',
254
+ name: 'GitHub Models',
255
+ apiType: 'openai',
256
+ category: 'international',
257
+ apiHost: 'https://models.github.ai/inference',
258
+ websites: {
259
+ official: 'https://github.com/marketplace/models',
260
+ apiKey: 'https://github.com/settings/tokens',
261
+ docs: 'https://docs.github.com/en/github-models',
262
+ models: 'https://github.com/marketplace/models',
263
+ },
264
+ },
265
+ copilot: {
266
+ id: 'copilot',
267
+ name: 'GitHub Copilot',
268
+ apiType: 'openai',
269
+ category: 'international',
270
+ apiHost: 'https://api.githubcopilot.com',
271
+ websites: { official: 'https://github.com/features/copilot' },
272
+ },
273
+ cohere: {
274
+ id: 'cohere',
275
+ name: 'Cohere',
276
+ apiType: 'openai',
277
+ category: 'international',
278
+ apiHost: 'https://api.cohere.ai/v1',
279
+ websites: {
280
+ official: 'https://cohere.com/',
281
+ apiKey: 'https://dashboard.cohere.com/api-keys',
282
+ docs: 'https://docs.cohere.com/',
283
+ models: 'https://docs.cohere.com/docs/models',
284
+ },
285
+ },
286
+ ai21: {
287
+ id: 'ai21',
288
+ name: 'AI21 Labs',
289
+ apiType: 'openai',
290
+ category: 'international',
291
+ apiHost: 'https://api.ai21.com/studio/v1',
292
+ websites: {
293
+ official: 'https://www.ai21.com/',
294
+ apiKey: 'https://studio.ai21.com/account/api-key',
295
+ docs: 'https://docs.ai21.com/',
296
+ models: 'https://docs.ai21.com/docs/models-overview',
297
+ },
298
+ },
299
+ replicate: {
300
+ id: 'replicate',
301
+ name: 'Replicate',
302
+ apiType: 'openai',
303
+ category: 'international',
304
+ apiHost: 'https://api.replicate.com/v1',
305
+ websites: {
306
+ official: 'https://replicate.com/',
307
+ apiKey: 'https://replicate.com/account/api-tokens',
308
+ docs: 'https://replicate.com/docs',
309
+ models: 'https://replicate.com/explore',
310
+ },
311
+ },
312
+ // Domestic (China) platforms
313
+ deepseek: {
314
+ id: 'deepseek',
315
+ name: 'DeepSeek',
316
+ apiType: 'openai',
317
+ category: 'domestic',
318
+ apiHost: 'https://api.deepseek.com/v1',
319
+ logo: 'deepseek.svg',
320
+ websites: {
321
+ official: 'https://deepseek.com/',
322
+ apiKey: 'https://platform.deepseek.com/api_keys',
323
+ docs: 'https://platform.deepseek.com/api-docs/',
324
+ models: 'https://platform.deepseek.com/api-docs/',
325
+ },
326
+ },
327
+ zhipu: {
328
+ id: 'zhipu',
329
+ name: 'ZhiPu AI',
330
+ apiType: 'openai',
331
+ category: 'domestic',
332
+ apiHost: 'https://open.bigmodel.cn/api/paas/v4',
333
+ logo: 'zhipu.svg',
334
+ websites: {
335
+ official: 'https://open.bigmodel.cn/',
336
+ apiKey: 'https://open.bigmodel.cn/usercenter/apikeys',
337
+ docs: 'https://docs.bigmodel.cn/',
338
+ models: 'https://open.bigmodel.cn/modelcenter/square',
339
+ },
340
+ },
341
+ moonshot: {
342
+ id: 'moonshot',
343
+ name: 'Moonshot (Kimi)',
344
+ apiType: 'openai',
345
+ category: 'domestic',
346
+ apiHost: 'https://api.moonshot.cn/v1',
347
+ logo: 'moonshot.svg',
348
+ websites: {
349
+ official: 'https://www.moonshot.cn/',
350
+ apiKey: 'https://platform.moonshot.cn/console/api-keys',
351
+ docs: 'https://platform.moonshot.cn/docs/',
352
+ models: 'https://platform.moonshot.cn/docs/intro',
353
+ },
354
+ },
355
+ baichuan: {
356
+ id: 'baichuan',
357
+ name: 'Baichuan AI',
358
+ apiType: 'openai',
359
+ category: 'domestic',
360
+ apiHost: 'https://api.baichuan-ai.com/v1',
361
+ logo: 'baichuan.svg',
362
+ websites: {
363
+ official: 'https://www.baichuan-ai.com/',
364
+ apiKey: 'https://platform.baichuan-ai.com/console/apikey',
365
+ docs: 'https://platform.baichuan-ai.com/docs',
366
+ models: 'https://platform.baichuan-ai.com/prices',
367
+ },
368
+ },
369
+ dashscope: {
370
+ id: 'dashscope',
371
+ name: 'Alibaba Bailian (Tongyi)',
372
+ apiType: 'openai',
373
+ category: 'domestic',
374
+ apiHost: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
375
+ logo: 'aliyun.svg',
376
+ websites: {
377
+ official: 'https://www.aliyun.com/product/bailian',
378
+ apiKey: 'https://bailian.console.aliyun.com/?tab=model#/api-key',
379
+ docs: 'https://help.aliyun.com/zh/model-studio/getting-started/',
380
+ models: 'https://bailian.console.aliyun.com/?tab=model#/model-market',
381
+ },
382
+ },
383
+ stepfun: {
384
+ id: 'stepfun',
385
+ name: 'StepFun',
386
+ apiType: 'openai',
387
+ category: 'domestic',
388
+ apiHost: 'https://api.stepfun.com/v1',
389
+ websites: {
390
+ official: 'https://platform.stepfun.com/',
391
+ apiKey: 'https://platform.stepfun.com/interface-key',
392
+ docs: 'https://platform.stepfun.com/docs/overview/concept',
393
+ models: 'https://platform.stepfun.com/docs/llm/text',
394
+ },
395
+ },
396
+ doubao: {
397
+ id: 'doubao',
398
+ name: 'ByteDance Doubao',
399
+ apiType: 'openai',
400
+ category: 'domestic',
401
+ apiHost: 'https://ark.cn-beijing.volces.com/api/v3',
402
+ logo: 'doubao.svg',
403
+ websites: {
404
+ official: 'https://console.volcengine.com/ark/',
405
+ apiKey: 'https://www.volcengine.com/experience/ark',
406
+ docs: 'https://www.volcengine.com/docs/82379/1182403',
407
+ models: 'https://console.volcengine.com/ark/region:ark+cn-beijing/endpoint',
408
+ },
409
+ },
410
+ minimax: {
411
+ id: 'minimax',
412
+ name: 'MiniMax',
413
+ apiType: 'openai',
414
+ category: 'domestic',
415
+ apiHost: 'https://api.minimaxi.com/v1',
416
+ description: 'MiniMax provides abab series LLMs',
417
+ credentialFormSchemas: [
418
+ { variable: 'api_key', label: 'API Key', type: 'secret-input', required: true, placeholder: 'eyJh...' },
419
+ { variable: 'group_id', label: 'Group ID', type: 'text-input', required: false, placeholder: 'Required for legacy API (api.minimax.chat)' },
420
+ ],
421
+ websites: {
422
+ official: 'https://platform.minimaxi.com/',
423
+ apiKey: 'https://platform.minimaxi.com/user-center/basic-information/interface-key',
424
+ docs: 'https://platform.minimaxi.com/docs/api-reference/text-openai-api',
425
+ models: 'https://platform.minimaxi.com/document/Models',
426
+ },
427
+ },
428
+ yi: {
429
+ id: 'yi',
430
+ name: '01.AI (Yi)',
431
+ apiType: 'openai',
432
+ category: 'domestic',
433
+ apiHost: 'https://api.lingyiwanwu.com/v1',
434
+ websites: {
435
+ official: 'https://platform.lingyiwanwu.com/',
436
+ apiKey: 'https://platform.lingyiwanwu.com/apikeys',
437
+ docs: 'https://platform.lingyiwanwu.com/docs',
438
+ models: 'https://platform.lingyiwanwu.com/docs',
439
+ },
440
+ },
441
+ hunyuan: {
442
+ id: 'hunyuan',
443
+ name: 'Tencent Hunyuan',
444
+ apiType: 'openai',
445
+ category: 'domestic',
446
+ apiHost: 'https://api.hunyuan.cloud.tencent.com/v1',
447
+ logo: 'tencent.svg',
448
+ websites: {
449
+ official: 'https://cloud.tencent.com/product/hunyuan',
450
+ apiKey: 'https://console.cloud.tencent.com/hunyuan/api-key',
451
+ docs: 'https://cloud.tencent.com/document/product/1729/111007',
452
+ models: 'https://cloud.tencent.com/document/product/1729/104753',
453
+ },
454
+ },
455
+ 'tencent-cloud-ti': {
456
+ id: 'tencent-cloud-ti',
457
+ name: 'Tencent Cloud TI',
458
+ apiType: 'openai',
459
+ category: 'domestic',
460
+ apiHost: 'https://api.lkeap.cloud.tencent.com/v1',
461
+ websites: {
462
+ official: 'https://cloud.tencent.com/product/ti',
463
+ apiKey: 'https://console.cloud.tencent.com/lkeap/api',
464
+ docs: 'https://cloud.tencent.com/document/product/1772',
465
+ models: 'https://console.cloud.tencent.com/tione/v2/aimarket',
466
+ },
467
+ },
468
+ 'baidu-cloud': {
469
+ id: 'baidu-cloud',
470
+ name: 'Baidu Cloud Qianfan',
471
+ apiType: 'openai',
472
+ category: 'domestic',
473
+ apiHost: 'https://qianfan.baidubce.com/v2',
474
+ websites: {
475
+ official: 'https://cloud.baidu.com/',
476
+ apiKey: 'https://console.bce.baidu.com/iam/#/iam/apikey/list',
477
+ docs: 'https://cloud.baidu.com/doc/index.html',
478
+ models: 'https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Fm2vrveyu',
479
+ },
480
+ },
481
+ infini: {
482
+ id: 'infini',
483
+ name: 'Infini AI',
484
+ apiType: 'openai',
485
+ category: 'domestic',
486
+ apiHost: 'https://cloud.infini-ai.com/maas/v1',
487
+ websites: {
488
+ official: 'https://cloud.infini-ai.com/',
489
+ apiKey: 'https://cloud.infini-ai.com/iam/secret/key',
490
+ docs: 'https://docs.infini-ai.com/gen-studio/api/maas.html',
491
+ models: 'https://cloud.infini-ai.com/genstudio/model',
492
+ },
493
+ },
494
+ modelscope: {
495
+ id: 'modelscope',
496
+ name: 'ModelScope',
497
+ apiType: 'openai',
498
+ category: 'domestic',
499
+ apiHost: 'https://api-inference.modelscope.cn/v1',
500
+ websites: {
501
+ official: 'https://modelscope.cn',
502
+ apiKey: 'https://modelscope.cn/my/myaccesstoken',
503
+ docs: 'https://modelscope.cn/docs/model-service/API-Inference/intro',
504
+ models: 'https://modelscope.cn/models',
505
+ },
506
+ },
507
+ xirang: {
508
+ id: 'xirang',
509
+ name: 'CTYun Xirang',
510
+ apiType: 'openai',
511
+ category: 'domestic',
512
+ apiHost: 'https://wishub-x1.ctyun.cn/v1',
513
+ websites: {
514
+ official: 'https://www.ctyun.cn',
515
+ apiKey: 'https://huiju.ctyun.cn/service/serviceGroup',
516
+ docs: 'https://www.ctyun.cn/products/ctxirang',
517
+ models: 'https://huiju.ctyun.cn/modelSquare/',
518
+ },
519
+ },
520
+ mimo: {
521
+ id: 'mimo',
522
+ name: 'Xiaomi MiMo',
523
+ apiType: 'openai',
524
+ category: 'domestic',
525
+ apiHost: 'https://api.xiaomimimo.com/v1',
526
+ websites: {
527
+ official: 'https://platform.xiaomimimo.com/',
528
+ apiKey: 'https://platform.xiaomimimo.com/#/console/usage',
529
+ docs: 'https://platform.xiaomimimo.com/#/docs/welcome',
530
+ models: 'https://platform.xiaomimimo.com/',
531
+ },
532
+ },
533
+ // Aggregator / Proxy platforms
534
+ openrouter: {
535
+ id: 'openrouter',
536
+ name: 'OpenRouter',
537
+ apiType: 'openai',
538
+ category: 'aggregator',
539
+ apiHost: 'https://openrouter.ai/api/v1',
540
+ logo: 'openrouter.svg',
541
+ websites: {
542
+ official: 'https://openrouter.ai/',
543
+ apiKey: 'https://openrouter.ai/settings/keys',
544
+ docs: 'https://openrouter.ai/docs/quick-start',
545
+ models: 'https://openrouter.ai/models',
546
+ },
547
+ },
548
+ silicon: {
549
+ id: 'silicon',
550
+ name: 'SiliconFlow',
551
+ apiType: 'openai',
552
+ category: 'aggregator',
553
+ apiHost: 'https://api.siliconflow.cn/v1',
554
+ logo: 'siliconflow.svg',
555
+ websites: {
556
+ official: 'https://www.siliconflow.cn',
557
+ apiKey: 'https://cloud.siliconflow.cn/i/d1nTBKXU',
558
+ docs: 'https://docs.siliconflow.cn/',
559
+ models: 'https://cloud.siliconflow.cn/models',
560
+ },
561
+ },
562
+ aihubmix: {
563
+ id: 'aihubmix',
564
+ name: 'AiHubMix',
565
+ apiType: 'openai',
566
+ category: 'aggregator',
567
+ apiHost: 'https://aihubmix.com/v1',
568
+ websites: {
569
+ official: 'https://aihubmix.com',
570
+ apiKey: 'https://aihubmix.com',
571
+ docs: 'https://doc.aihubmix.com/',
572
+ models: 'https://aihubmix.com/models',
573
+ },
574
+ },
575
+ '302ai': {
576
+ id: '302ai',
577
+ name: '302.AI',
578
+ apiType: 'openai',
579
+ category: 'aggregator',
580
+ apiHost: 'https://api.302.ai/v1',
581
+ websites: {
582
+ official: 'https://302.ai',
583
+ apiKey: 'https://dash.302.ai/apis/list',
584
+ docs: 'https://302ai.apifox.cn/api-147522039',
585
+ models: 'https://302.ai/pricing/',
586
+ },
587
+ },
588
+ tokenflux: {
589
+ id: 'tokenflux',
590
+ name: 'TokenFlux',
591
+ apiType: 'openai',
592
+ category: 'aggregator',
593
+ apiHost: 'https://api.tokenflux.ai/openai/v1',
594
+ websites: {
595
+ official: 'https://tokenflux.ai',
596
+ apiKey: 'https://tokenflux.ai/dashboard/api-keys',
597
+ docs: 'https://tokenflux.ai/docs',
598
+ models: 'https://tokenflux.ai/models',
599
+ },
600
+ },
601
+ poe: {
602
+ id: 'poe',
603
+ name: 'Poe',
604
+ apiType: 'openai',
605
+ category: 'aggregator',
606
+ apiHost: 'https://api.poe.com/v1',
607
+ websites: {
608
+ official: 'https://poe.com/',
609
+ apiKey: 'https://poe.com/api_key',
610
+ docs: 'https://creator.poe.com/docs/external-applications/openai-compatible-api',
611
+ models: 'https://poe.com/',
612
+ },
613
+ },
614
+ venice: {
615
+ id: 'venice',
616
+ name: 'Venice AI',
617
+ apiType: 'openai',
618
+ category: 'aggregator',
619
+ apiHost: 'https://api.venice.ai/api/v1',
620
+ websites: {
621
+ official: 'https://venice.ai/',
622
+ docs: 'https://docs.venice.ai/',
623
+ },
624
+ },
625
+ ocoolai: {
626
+ id: 'ocoolai',
627
+ name: 'ocoolAI',
628
+ apiType: 'openai',
629
+ category: 'aggregator',
630
+ apiHost: 'https://api.ocoolai.com/v1',
631
+ websites: {
632
+ official: 'https://one.ocoolai.com/',
633
+ apiKey: 'https://one.ocoolai.com/token',
634
+ docs: 'https://docs.ocoolai.com/',
635
+ models: 'https://api.ocoolai.com/info/models/',
636
+ },
637
+ },
638
+ dmxapi: {
639
+ id: 'dmxapi',
640
+ name: 'DMXAPI',
641
+ apiType: 'openai',
642
+ category: 'aggregator',
643
+ apiHost: 'https://www.dmxapi.cn/v1',
644
+ websites: {
645
+ official: 'https://www.dmxapi.cn',
646
+ apiKey: 'https://www.dmxapi.cn',
647
+ docs: 'https://doc.dmxapi.cn/',
648
+ models: 'https://www.dmxapi.cn/pricing',
649
+ },
650
+ },
651
+ burncloud: {
652
+ id: 'burncloud',
653
+ name: 'BurnCloud',
654
+ apiType: 'openai',
655
+ category: 'aggregator',
656
+ apiHost: 'https://ai.burncloud.com/v1',
657
+ websites: {
658
+ official: 'https://ai.burncloud.com/',
659
+ apiKey: 'https://ai.burncloud.com/token',
660
+ docs: 'https://ai.burncloud.com/docs',
661
+ models: 'https://ai.burncloud.com/pricing',
662
+ },
663
+ },
664
+ cephalon: {
665
+ id: 'cephalon',
666
+ name: 'Cephalon',
667
+ apiType: 'openai',
668
+ category: 'aggregator',
669
+ apiHost: 'https://cephalon.cloud/user-center/v1/model',
670
+ websites: {
671
+ official: 'https://cephalon.cloud',
672
+ apiKey: 'https://cephalon.cloud/api',
673
+ docs: 'https://cephalon.cloud/apitoken/1864244127731589124',
674
+ models: 'https://cephalon.cloud/model',
675
+ },
676
+ },
677
+ lanyun: {
678
+ id: 'lanyun',
679
+ name: 'LANYUN',
680
+ apiType: 'openai',
681
+ category: 'aggregator',
682
+ apiHost: 'https://maas-api.lanyun.net/v1',
683
+ websites: {
684
+ official: 'https://maas.lanyun.net',
685
+ apiKey: 'https://maas.lanyun.net/#/system/apiKey',
686
+ docs: 'https://archive.lanyun.net/#/maas/',
687
+ models: 'https://maas.lanyun.net/#/model/modelSquare',
688
+ },
689
+ },
690
+ ph8: {
691
+ id: 'ph8',
692
+ name: 'PH8',
693
+ apiType: 'openai',
694
+ category: 'aggregator',
695
+ apiHost: 'https://ph8.co/v1',
696
+ websites: {
697
+ official: 'https://ph8.co',
698
+ apiKey: 'https://ph8.co/apiKey',
699
+ docs: 'https://m1r239or5aw.feishu.cn/wiki/SegzwS4x1i2P4OksFY2cMvujn9f',
700
+ models: 'https://ph8.co/v1/models',
701
+ },
702
+ },
703
+ qiniu: {
704
+ id: 'qiniu',
705
+ name: 'Qiniu Cloud',
706
+ apiType: 'openai',
707
+ category: 'aggregator',
708
+ apiHost: 'https://api.qnaigc.com/v1',
709
+ websites: {
710
+ official: 'https://qiniu.com',
711
+ apiKey: 'https://portal.qiniu.com/ai-inference/api-key',
712
+ docs: 'https://developer.qiniu.com/aitokenapi',
713
+ models: 'https://developer.qiniu.com/aitokenapi/12883/model-list',
714
+ },
715
+ },
716
+ ppio: {
717
+ id: 'ppio',
718
+ name: 'PPIO',
719
+ apiType: 'openai',
720
+ category: 'aggregator',
721
+ apiHost: 'https://api.ppinfra.com/v3/openai',
722
+ websites: {
723
+ official: 'https://ppio.com',
724
+ apiKey: 'https://ppio.com/settings/key-management',
725
+ docs: 'https://docs.cherry-ai.com/pre-basic/providers/ppio',
726
+ models: 'https://ppio.com/model-api/product/llm-api',
727
+ },
728
+ },
729
+ alayanew: {
730
+ id: 'alayanew',
731
+ name: 'AlayaNew',
732
+ apiType: 'openai',
733
+ category: 'aggregator',
734
+ apiHost: 'https://deepseek.alayanew.com/v1',
735
+ websites: {
736
+ official: 'https://www.alayanew.com',
737
+ apiKey: 'https://www.alayanew.com/backend/register',
738
+ docs: 'https://docs.alayanew.com/docs/modelService/interview',
739
+ models: 'https://www.alayanew.com/product/deepseek',
740
+ },
741
+ },
742
+ aionly: {
743
+ id: 'aionly',
744
+ name: 'AIOnly',
745
+ apiType: 'openai',
746
+ category: 'aggregator',
747
+ apiHost: 'https://api.aiionly.com/v1',
748
+ websites: {
749
+ official: 'https://www.aiionly.com',
750
+ apiKey: 'https://www.aiionly.com/keyApi',
751
+ docs: 'https://www.aiionly.com/document',
752
+ models: 'https://www.aiionly.com',
753
+ },
754
+ },
755
+ longcat: {
756
+ id: 'longcat',
757
+ name: 'LongCat',
758
+ apiType: 'openai',
759
+ category: 'aggregator',
760
+ apiHost: 'https://api.longcat.chat/openai/v1',
761
+ websites: {
762
+ official: 'https://longcat.chat',
763
+ apiKey: 'https://longcat.chat/platform/api_keys',
764
+ docs: 'https://longcat.chat/platform/docs/zh/',
765
+ models: 'https://longcat.chat/platform/docs/zh/APIDocs.html',
766
+ },
767
+ },
768
+ sophnet: {
769
+ id: 'sophnet',
770
+ name: 'SophNet',
771
+ apiType: 'openai',
772
+ category: 'aggregator',
773
+ apiHost: 'https://www.sophnet.com/api/open-apis/v1',
774
+ websites: {
775
+ official: 'https://sophnet.com',
776
+ apiKey: 'https://sophnet.com/#/project/key',
777
+ docs: 'https://sophnet.com/docs/component/introduce.html',
778
+ models: 'https://sophnet.com/#/model/list',
779
+ },
780
+ },
781
+ gateway: {
782
+ id: 'gateway',
783
+ name: 'Vercel AI Gateway',
784
+ apiType: 'gateway',
785
+ category: 'aggregator',
786
+ apiHost: 'https://ai-gateway.vercel.sh/v1/ai',
787
+ websites: {
788
+ official: 'https://vercel.com/ai-gateway',
789
+ apiKey: 'https://vercel.com/',
790
+ docs: 'https://vercel.com/docs/ai-gateway',
791
+ models: 'https://vercel.com/ai-gateway/models',
792
+ },
793
+ },
794
+ // Local / self-hosted
795
+ ollama: {
796
+ id: 'ollama',
797
+ name: 'Ollama',
798
+ apiType: 'ollama',
799
+ category: 'local',
800
+ apiHost: 'http://localhost:11434/v1',
801
+ logo: 'ollama.svg',
802
+ isLocal: true,
803
+ websites: {
804
+ official: 'https://ollama.com/',
805
+ docs: 'https://github.com/ollama/ollama/tree/main/docs',
806
+ models: 'https://ollama.com/library',
807
+ },
808
+ },
809
+ lmstudio: {
810
+ id: 'lmstudio',
811
+ name: 'LM Studio',
812
+ apiType: 'openai',
813
+ category: 'local',
814
+ apiHost: 'http://localhost:1234/v1',
815
+ isLocal: true,
816
+ websites: {
817
+ official: 'https://lmstudio.ai/',
818
+ docs: 'https://lmstudio.ai/docs',
819
+ models: 'https://lmstudio.ai/models',
820
+ },
821
+ },
822
+ gpustack: {
823
+ id: 'gpustack',
824
+ name: 'GPUStack',
825
+ apiType: 'openai',
826
+ category: 'local',
827
+ apiHost: '',
828
+ isLocal: true,
829
+ requiresExtraConfig: true,
830
+ websites: {
831
+ official: 'https://gpustack.ai/',
832
+ docs: 'https://docs.gpustack.ai/latest/',
833
+ models: 'https://docs.gpustack.ai/latest/overview/#supported-models',
834
+ },
835
+ },
836
+ ovms: {
837
+ id: 'ovms',
838
+ name: 'OpenVINO Model Server',
839
+ apiType: 'openai',
840
+ category: 'local',
841
+ apiHost: 'http://localhost:8000/v3',
842
+ isLocal: true,
843
+ websites: {
844
+ official: 'https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/overview.html',
845
+ docs: 'https://docs.openvino.ai/2025/model-server/ovms_what_is_openvino_model_server.html',
846
+ models: 'https://www.modelscope.cn/organization/OpenVINO',
847
+ },
848
+ },
849
+ 'new-api': {
850
+ id: 'new-api',
851
+ name: 'New API',
852
+ apiType: 'new-api',
853
+ category: 'local',
854
+ apiHost: 'http://localhost:3000/v1',
855
+ isLocal: true,
856
+ websites: {
857
+ official: 'https://docs.newapi.pro/',
858
+ docs: 'https://docs.newapi.pro',
859
+ },
860
+ },
861
+ // Custom
862
+ custom: {
863
+ id: 'custom',
864
+ name: 'Custom',
865
+ apiType: 'openai',
866
+ category: 'custom',
867
+ apiHost: '',
868
+ requiresExtraConfig: true,
869
+ },
870
+ };
871
+ // ============================================================================
872
+ // Provider Vendor constant (all valid vendor IDs)
873
+ // ============================================================================
874
+ exports.PROVIDER_VENDORS = Object.keys(exports.PROVIDER_CONFIGS);
875
+ // ============================================================================
876
+ // Helper functions
877
+ // ============================================================================
878
+ function getProviderDefaultApiHost(vendor) {
879
+ return exports.PROVIDER_CONFIGS[vendor]?.apiHost || '';
880
+ }
881
+ function getEffectiveApiHost(vendor, customApiHost) {
882
+ if (customApiHost && customApiHost.trim()) {
883
+ return customApiHost.trim();
884
+ }
885
+ return getProviderDefaultApiHost(vendor);
886
+ }
887
+ function isProviderVendor(value) {
888
+ return typeof value === 'string' && value in exports.PROVIDER_CONFIGS;
889
+ }
890
+ function isProviderApiType(value) {
891
+ const apiTypes = [
892
+ 'openai', 'openai-response', 'anthropic', 'gemini',
893
+ 'azure-openai', 'aws-bedrock', 'vertexai', 'ollama',
894
+ 'new-api', 'gateway',
895
+ ];
896
+ return typeof value === 'string' && apiTypes.includes(value);
897
+ }
898
+ function getProviderConfig(vendor) {
899
+ return exports.PROVIDER_CONFIGS[vendor];
900
+ }
901
+ function getProvidersByCategory(category) {
902
+ return Object.values(exports.PROVIDER_CONFIGS).filter((p) => p.category === category);
903
+ }
904
+ //# sourceMappingURL=providers.js.map