@xsai-ext/providers 0.4.0-beta.10 → 0.4.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/anthropic-B6NN_uBS.d.ts +117 -0
- package/dist/create.d.ts +192 -151
- package/dist/create.js +4 -3
- package/dist/index.d.ts +313 -237
- package/dist/index.js +52 -41
- package/dist/{together-ai-Dohv6WsZ.js → together-ai-BNlmR9ei.js} +101 -62
- package/package.json +3 -3
- package/dist/openrouter-BJX-qVAE.d.ts +0 -104
package/dist/index.js
CHANGED
|
@@ -1,65 +1,76 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as createAlibaba, a as createAlibabaCn, b as createBailing, d as createBaseten, e as createCerebras, f as createChutes, g as createCortecs, h as createDeepinfra, i as createDeepSeek, j as createFastrouter, k as createFireworks, l as createGithubCopilot, m as createGithubModels, n as createGoogleGenerativeAI, o as createGroq, p as createHelicone, q as createHuggingface, r as createIflowcn, s as createInception, t as createInference, u as createIoNet, v as createKimiForCoding, w as createLlama, x as createLmstudio, y as createLucidquery, z as createMinimax, A as createMinimaxCn, B as createMistral, C as createModelscope, D as createMoonshotai, E as createMoonshotaiCn, F as createMorph, G as createNebius, H as createNvidia, I as createOllamaCloud, J as createOpenAI, K as createOpencode, L as createOvhcloud, M as createPerplexity, N as createPoe, O as createRequesty, P as createScaleway, Q as createSiliconFlow, R as createSiliconflowCn, S as createSubmodel, T as createSynthetic, U as createUpstage, V as createVenice, W as createVultr, X as createWandb, Y as createXai, Z as createXiaomi, _ as createZai, $ as createZaiCodingPlan, a0 as createZenmux, a1 as createZhipuai, a2 as createZhipuaiCodingPlan, a3 as createNovita, a4 as createStepfun, a5 as createTencentHunyuan, a6 as createOllama, a7 as createLitellm, a8 as createAnthropic, a9 as createFeatherless, aa as createOpenRouter, ab as createTogetherAI } from './together-ai-BNlmR9ei.js';
|
|
3
3
|
import '@xsai-ext/shared-providers';
|
|
4
4
|
import '@xsai/shared';
|
|
5
5
|
|
|
6
|
-
const moonshotaiCn = createMoonshotaiCn(process.env.MOONSHOT_API_KEY ?? "");
|
|
7
|
-
const lucidquery = createLucidquery(process.env.LUCIDQUERY_API_KEY ?? "");
|
|
8
|
-
const moonshotai = createMoonshotai(process.env.MOONSHOT_API_KEY ?? "");
|
|
9
|
-
const zaiCodingPlan = createZaiCodingPlan(process.env.ZHIPU_API_KEY ?? "");
|
|
10
6
|
const alibaba = createAlibaba(process.env.DASHSCOPE_API_KEY ?? "");
|
|
11
|
-
const xai = createXai(process.env.XAI_API_KEY ?? "");
|
|
12
|
-
const vultr = createVultr(process.env.VULTR_API_KEY ?? "");
|
|
13
|
-
const nvidia = createNvidia(process.env.NVIDIA_API_KEY ?? "");
|
|
14
|
-
const upstage = createUpstage(process.env.UPSTAGE_API_KEY ?? "");
|
|
15
|
-
const groq = createGroq(process.env.GROQ_API_KEY ?? "");
|
|
16
|
-
const githubCopilot = createGithubCopilot(process.env.GITHUB_TOKEN ?? "");
|
|
17
|
-
const mistral = createMistral(process.env.MISTRAL_API_KEY ?? "");
|
|
18
|
-
const nebius = createNebius(process.env.NEBIUS_API_KEY ?? "");
|
|
19
|
-
const deepseek = createDeepSeek(process.env.DEEPSEEK_API_KEY ?? "");
|
|
20
7
|
const alibabaCn = createAlibabaCn(process.env.DASHSCOPE_API_KEY ?? "");
|
|
21
|
-
const
|
|
8
|
+
const bailing = createBailing(process.env.BAILING_API_TOKEN ?? "");
|
|
9
|
+
const baseten = createBaseten(process.env.BASETEN_API_KEY ?? "");
|
|
10
|
+
const cerebras = createCerebras(process.env.CEREBRAS_API_KEY ?? "");
|
|
22
11
|
const chutes = createChutes(process.env.CHUTES_API_KEY ?? "");
|
|
23
12
|
const cortecs = createCortecs(process.env.CORTECS_API_KEY ?? "");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const huggingface = createHuggingface(process.env.HF_TOKEN ?? "");
|
|
27
|
-
const opencode = createOpencode(process.env.OPENCODE_API_KEY ?? "");
|
|
13
|
+
const deepinfra = createDeepinfra(process.env.DEEPINFRA_API_KEY ?? "");
|
|
14
|
+
const deepseek = createDeepSeek(process.env.DEEPSEEK_API_KEY ?? "");
|
|
28
15
|
const fastrouter = createFastrouter(process.env.FASTROUTER_API_KEY ?? "");
|
|
29
|
-
const
|
|
16
|
+
const fireworks = createFireworks(process.env.FIREWORKS_API_KEY ?? "");
|
|
17
|
+
const githubCopilot = createGithubCopilot(process.env.GITHUB_TOKEN ?? "");
|
|
18
|
+
const githubModels = createGithubModels(process.env.GITHUB_TOKEN ?? "");
|
|
30
19
|
const google = createGoogleGenerativeAI(process.env.GOOGLE_GENERATIVE_AI_API_KEY ?? process.env.GEMINI_API_KEY ?? "");
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const zhipuaiCodingPlan = createZhipuaiCodingPlan(process.env.ZHIPU_API_KEY ?? "");
|
|
35
|
-
const perplexity = createPerplexity(process.env.PERPLEXITY_API_KEY ?? "");
|
|
36
|
-
const zenmux = createZenmux(process.env.ZENMUX_API_KEY ?? "");
|
|
37
|
-
const ovhcloud = createOvhcloud(process.env.OVHCLOUD_API_KEY ?? "");
|
|
20
|
+
const groq = createGroq(process.env.GROQ_API_KEY ?? "");
|
|
21
|
+
const helicone = createHelicone(process.env.HELICONE_API_KEY ?? "");
|
|
22
|
+
const huggingface = createHuggingface(process.env.HF_TOKEN ?? "");
|
|
38
23
|
const iflowcn = createIflowcn(process.env.IFLOW_API_KEY ?? "");
|
|
39
|
-
const
|
|
40
|
-
const deepinfra = createDeepinfra(process.env.DEEPINFRA_API_KEY ?? "");
|
|
41
|
-
const zhipuai = createZhipuai(process.env.ZHIPU_API_KEY ?? "");
|
|
42
|
-
const submodel = createSubmodel(process.env.SUBMODEL_INSTAGEN_ACCESS_KEY ?? "");
|
|
43
|
-
const zai = createZai(process.env.ZHIPU_API_KEY ?? "");
|
|
24
|
+
const inception = createInception(process.env.INCEPTION_API_KEY ?? "");
|
|
44
25
|
const inference = createInference(process.env.INFERENCE_API_KEY ?? "");
|
|
45
|
-
const
|
|
46
|
-
const
|
|
26
|
+
const ioNet = createIoNet(process.env.IOINTELLIGENCE_API_KEY ?? "");
|
|
27
|
+
const kimiForCoding = createKimiForCoding(process.env.KIMI_API_KEY ?? "");
|
|
28
|
+
const llama = createLlama(process.env.LLAMA_API_KEY ?? "");
|
|
47
29
|
const lmstudio = createLmstudio(process.env.LMSTUDIO_API_KEY ?? "");
|
|
48
|
-
const
|
|
30
|
+
const lucidquery = createLucidquery(process.env.LUCIDQUERY_API_KEY ?? "");
|
|
31
|
+
const minimax = createMinimax(process.env.MINIMAX_API_KEY ?? "");
|
|
32
|
+
const minimaxCn = createMinimaxCn(process.env.MINIMAX_API_KEY ?? "");
|
|
33
|
+
const mistral = createMistral(process.env.MISTRAL_API_KEY ?? "");
|
|
49
34
|
const modelscope = createModelscope(process.env.MODELSCOPE_API_KEY ?? "");
|
|
50
|
-
const
|
|
51
|
-
const
|
|
35
|
+
const moonshotai = createMoonshotai(process.env.MOONSHOT_API_KEY ?? "");
|
|
36
|
+
const moonshotaiCn = createMoonshotaiCn(process.env.MOONSHOT_API_KEY ?? "");
|
|
37
|
+
const morph = createMorph(process.env.MORPH_API_KEY ?? "");
|
|
38
|
+
const nebius = createNebius(process.env.NEBIUS_API_KEY ?? "");
|
|
39
|
+
const nvidia = createNvidia(process.env.NVIDIA_API_KEY ?? "");
|
|
40
|
+
const ollamaCloud = createOllamaCloud(process.env.OLLAMA_API_KEY ?? "");
|
|
41
|
+
const openai = createOpenAI(process.env.OPENAI_API_KEY ?? "");
|
|
42
|
+
const opencode = createOpencode(process.env.OPENCODE_API_KEY ?? "");
|
|
43
|
+
const ovhcloud = createOvhcloud(process.env.OVHCLOUD_API_KEY ?? "");
|
|
44
|
+
const perplexity = createPerplexity(process.env.PERPLEXITY_API_KEY ?? "");
|
|
52
45
|
const poe = createPoe(process.env.POE_API_KEY ?? "");
|
|
53
|
-
const
|
|
54
|
-
const
|
|
46
|
+
const requesty = createRequesty(process.env.REQUESTY_API_KEY ?? "");
|
|
47
|
+
const scaleway = createScaleway(process.env.SCALEWAY_API_KEY ?? "");
|
|
48
|
+
const siliconflow = createSiliconFlow(process.env.SILICONFLOW_API_KEY ?? "");
|
|
49
|
+
const siliconflowCn = createSiliconflowCn(process.env.SILICONFLOW_API_KEY ?? "");
|
|
50
|
+
const submodel = createSubmodel(process.env.SUBMODEL_INSTAGEN_ACCESS_KEY ?? "");
|
|
51
|
+
const synthetic = createSynthetic(process.env.SYNTHETIC_API_KEY ?? "");
|
|
52
|
+
const upstage = createUpstage(process.env.UPSTAGE_API_KEY ?? "");
|
|
53
|
+
const venice = createVenice(process.env.VENICE_API_KEY ?? "");
|
|
54
|
+
const vultr = createVultr(process.env.VULTR_API_KEY ?? "");
|
|
55
|
+
const wandb = createWandb(process.env.WANDB_API_KEY ?? "");
|
|
56
|
+
const xai = createXai(process.env.XAI_API_KEY ?? "");
|
|
57
|
+
const xiaomi = createXiaomi(process.env.XIAOMI_API_KEY ?? "");
|
|
58
|
+
const zai = createZai(process.env.ZHIPU_API_KEY ?? "");
|
|
59
|
+
const zaiCodingPlan = createZaiCodingPlan(process.env.ZHIPU_API_KEY ?? "");
|
|
60
|
+
const zenmux = createZenmux(process.env.ZENMUX_API_KEY ?? "");
|
|
61
|
+
const zhipuai = createZhipuai(process.env.ZHIPU_API_KEY ?? "");
|
|
62
|
+
const zhipuaiCodingPlan = createZhipuaiCodingPlan(process.env.ZHIPU_API_KEY ?? "");
|
|
55
63
|
const novita = createNovita(process.env.NOVITA_API_KEY ?? "");
|
|
56
|
-
const siliconFlow = createSiliconFlow(process.env.SILICON_FLOW_API_KEY ?? "");
|
|
57
64
|
const stepfun = createStepfun(process.env.STEPFUN_API_KEY ?? "");
|
|
58
65
|
const tencentHunyuan = createTencentHunyuan(process.env.TENCENT_HUNYUAN_API_KEY ?? "");
|
|
66
|
+
const ollama = createOllama(process.env.OLLAMA_API_KEY ?? "");
|
|
67
|
+
const litellm = createLitellm(process.env.LITELLM_API_KEY ?? "");
|
|
59
68
|
|
|
60
69
|
const anthropic = createAnthropic(process.env.ANTHROPIC_API_KEY ?? "");
|
|
61
70
|
const featherless = createFeatherless(process.env.FEATHERLESS_API_KEY ?? "");
|
|
62
71
|
const openrouter = createOpenRouter(process.env.OPENROUTER_API_KEY ?? "");
|
|
63
72
|
const togetherai = createTogetherAI(process.env.TOGETHER_API_KEY ?? "");
|
|
73
|
+
const siliconFlow = siliconflow;
|
|
74
|
+
const minimaxi = minimaxCn;
|
|
64
75
|
|
|
65
|
-
export { alibaba, alibabaCn, anthropic, baseten, cerebras, chutes, cortecs, deepinfra, deepseek, fastrouter, featherless, fireworks, githubCopilot, githubModels, google, groq, huggingface, iflowcn, inception, inference, llama, lmstudio, lucidquery, minimax, minimaxi, mistral, modelscope, moonshotai, moonshotaiCn, morph, nebius, novita, nvidia, openai, opencode, openrouter, ovhcloud, perplexity, poe, requesty, scaleway, siliconFlow, stepfun, submodel, synthetic, tencentHunyuan, togetherai, upstage, venice, vultr, wandb, xai, zai, zaiCodingPlan, zenmux, zhipuai, zhipuaiCodingPlan };
|
|
76
|
+
export { alibaba, alibabaCn, anthropic, bailing, baseten, cerebras, chutes, cortecs, deepinfra, deepseek, fastrouter, featherless, fireworks, githubCopilot, githubModels, google, groq, helicone, huggingface, iflowcn, inception, inference, ioNet, kimiForCoding, litellm, llama, lmstudio, lucidquery, minimax, minimaxCn, minimaxi, mistral, modelscope, moonshotai, moonshotaiCn, morph, nebius, novita, nvidia, ollama, ollamaCloud, openai, opencode, openrouter, ovhcloud, perplexity, poe, requesty, scaleway, siliconFlow, siliconflow, siliconflowCn, stepfun, submodel, synthetic, tencentHunyuan, togetherai, upstage, venice, vultr, wandb, xai, xiaomi, zai, zaiCodingPlan, zenmux, zhipuai, zhipuaiCodingPlan };
|
|
@@ -1,97 +1,107 @@
|
|
|
1
|
-
import { merge, createChatProvider, createModelProvider, createEmbedProvider, createImageProvider, createSpeechProvider, createTranscriptionProvider } from '@xsai-ext/shared-providers';
|
|
1
|
+
import { merge, createChatProvider, createModelProvider, createEmbedProvider, createImageProvider, createSpeechProvider, createTranscriptionProvider, createChatProviderWithExtraOptions } from '@xsai-ext/shared-providers';
|
|
2
2
|
import { objCamelToSnake } from '@xsai/shared';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const createAlibaba = (apiKey, baseURL = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1") => merge(
|
|
5
5
|
createChatProvider({ apiKey, baseURL }),
|
|
6
6
|
createModelProvider({ apiKey, baseURL })
|
|
7
7
|
);
|
|
8
|
-
const
|
|
8
|
+
const createAlibabaCn = (apiKey, baseURL = "https://dashscope.aliyuncs.com/compatible-mode/v1") => merge(
|
|
9
9
|
createChatProvider({ apiKey, baseURL }),
|
|
10
10
|
createModelProvider({ apiKey, baseURL })
|
|
11
11
|
);
|
|
12
|
-
const
|
|
12
|
+
const createBailing = (apiKey, baseURL = "https://api.tbox.cn/api/llm/v1/chat/completions") => merge(
|
|
13
13
|
createChatProvider({ apiKey, baseURL }),
|
|
14
14
|
createModelProvider({ apiKey, baseURL })
|
|
15
15
|
);
|
|
16
|
-
const
|
|
16
|
+
const createBaseten = (apiKey, baseURL = "https://inference.baseten.co/v1") => merge(
|
|
17
17
|
createChatProvider({ apiKey, baseURL }),
|
|
18
18
|
createModelProvider({ apiKey, baseURL })
|
|
19
19
|
);
|
|
20
|
-
const
|
|
20
|
+
const createCerebras = (apiKey, baseURL = "https://api.cerebras.ai/v1/") => merge(
|
|
21
21
|
createChatProvider({ apiKey, baseURL }),
|
|
22
|
-
createModelProvider({ apiKey, baseURL })
|
|
22
|
+
createModelProvider({ apiKey, baseURL }),
|
|
23
|
+
createEmbedProvider({ apiKey, baseURL })
|
|
23
24
|
);
|
|
24
|
-
const
|
|
25
|
+
const createChutes = (apiKey, baseURL = "https://llm.chutes.ai/v1") => merge(
|
|
25
26
|
createChatProvider({ apiKey, baseURL }),
|
|
26
27
|
createModelProvider({ apiKey, baseURL })
|
|
27
28
|
);
|
|
28
|
-
const
|
|
29
|
+
const createCortecs = (apiKey, baseURL = "https://api.cortecs.ai/v1") => merge(
|
|
29
30
|
createChatProvider({ apiKey, baseURL }),
|
|
30
31
|
createModelProvider({ apiKey, baseURL })
|
|
31
32
|
);
|
|
32
|
-
const
|
|
33
|
+
const createDeepinfra = (apiKey, baseURL = "https://api.deepinfra.com/v1/openai/") => merge(
|
|
34
|
+
createChatProvider({ apiKey, baseURL }),
|
|
35
|
+
createModelProvider({ apiKey, baseURL }),
|
|
36
|
+
createEmbedProvider({ apiKey, baseURL })
|
|
37
|
+
);
|
|
38
|
+
const createDeepSeek = (apiKey, baseURL = "https://api.deepseek.com") => merge(
|
|
33
39
|
createChatProvider({ apiKey, baseURL }),
|
|
34
40
|
createModelProvider({ apiKey, baseURL })
|
|
35
41
|
);
|
|
36
|
-
const
|
|
42
|
+
const createFastrouter = (apiKey, baseURL = "https://go.fastrouter.ai/api/v1") => merge(
|
|
37
43
|
createChatProvider({ apiKey, baseURL }),
|
|
38
44
|
createModelProvider({ apiKey, baseURL })
|
|
39
45
|
);
|
|
40
|
-
const
|
|
46
|
+
const createFireworks = (apiKey, baseURL = "https://api.fireworks.ai/inference/v1/") => merge(
|
|
41
47
|
createChatProvider({ apiKey, baseURL }),
|
|
42
|
-
createModelProvider({ apiKey, baseURL })
|
|
43
|
-
createEmbedProvider({ apiKey, baseURL })
|
|
48
|
+
createModelProvider({ apiKey, baseURL })
|
|
44
49
|
);
|
|
45
50
|
const createGithubCopilot = (apiKey, baseURL = "https://api.githubcopilot.com") => merge(
|
|
46
51
|
createChatProvider({ apiKey, baseURL }),
|
|
47
52
|
createModelProvider({ apiKey, baseURL })
|
|
48
53
|
);
|
|
49
|
-
const
|
|
54
|
+
const createGithubModels = (apiKey, baseURL = "https://models.github.ai/inference") => merge(
|
|
55
|
+
createChatProvider({ apiKey, baseURL }),
|
|
56
|
+
createModelProvider({ apiKey, baseURL })
|
|
57
|
+
);
|
|
58
|
+
const createGoogleGenerativeAI = (apiKey, baseURL = "https://generativelanguage.googleapis.com/v1beta/openai/") => merge(
|
|
50
59
|
createChatProvider({ apiKey, baseURL }),
|
|
51
60
|
createModelProvider({ apiKey, baseURL }),
|
|
52
61
|
createEmbedProvider({ apiKey, baseURL })
|
|
53
62
|
);
|
|
54
|
-
const
|
|
63
|
+
const createGroq = (apiKey, baseURL = "https://api.groq.com/openai/v1/") => merge(
|
|
55
64
|
createChatProvider({ apiKey, baseURL }),
|
|
56
|
-
createModelProvider({ apiKey, baseURL })
|
|
65
|
+
createModelProvider({ apiKey, baseURL }),
|
|
66
|
+
createEmbedProvider({ apiKey, baseURL })
|
|
57
67
|
);
|
|
58
|
-
const
|
|
68
|
+
const createHelicone = (apiKey, baseURL = "https://ai-gateway.helicone.ai/v1") => merge(
|
|
59
69
|
createChatProvider({ apiKey, baseURL }),
|
|
60
70
|
createModelProvider({ apiKey, baseURL })
|
|
61
71
|
);
|
|
62
|
-
const
|
|
72
|
+
const createHuggingface = (apiKey, baseURL = "https://router.huggingface.co/v1") => merge(
|
|
63
73
|
createChatProvider({ apiKey, baseURL }),
|
|
64
74
|
createModelProvider({ apiKey, baseURL })
|
|
65
75
|
);
|
|
66
|
-
const
|
|
76
|
+
const createIflowcn = (apiKey, baseURL = "https://apis.iflow.cn/v1") => merge(
|
|
67
77
|
createChatProvider({ apiKey, baseURL }),
|
|
68
78
|
createModelProvider({ apiKey, baseURL })
|
|
69
79
|
);
|
|
70
|
-
const
|
|
80
|
+
const createInception = (apiKey, baseURL = "https://api.inceptionlabs.ai/v1/") => merge(
|
|
71
81
|
createChatProvider({ apiKey, baseURL }),
|
|
72
82
|
createModelProvider({ apiKey, baseURL })
|
|
73
83
|
);
|
|
74
|
-
const
|
|
84
|
+
const createInference = (apiKey, baseURL = "https://inference.net/v1") => merge(
|
|
75
85
|
createChatProvider({ apiKey, baseURL }),
|
|
76
86
|
createModelProvider({ apiKey, baseURL })
|
|
77
87
|
);
|
|
78
|
-
const
|
|
88
|
+
const createIoNet = (apiKey, baseURL = "https://api.intelligence.io.solutions/api/v1") => merge(
|
|
79
89
|
createChatProvider({ apiKey, baseURL }),
|
|
80
90
|
createModelProvider({ apiKey, baseURL })
|
|
81
91
|
);
|
|
82
|
-
const
|
|
92
|
+
const createKimiForCoding = (apiKey, baseURL = "https://api.kimi.com/coding/v1") => merge(
|
|
83
93
|
createChatProvider({ apiKey, baseURL }),
|
|
84
94
|
createModelProvider({ apiKey, baseURL })
|
|
85
95
|
);
|
|
86
|
-
const
|
|
96
|
+
const createLlama = (apiKey, baseURL = "https://api.llama.com/compat/v1/") => merge(
|
|
87
97
|
createChatProvider({ apiKey, baseURL }),
|
|
88
98
|
createModelProvider({ apiKey, baseURL })
|
|
89
99
|
);
|
|
90
|
-
const
|
|
100
|
+
const createLmstudio = (apiKey, baseURL = "http://127.0.0.1:1234/v1") => merge(
|
|
91
101
|
createChatProvider({ apiKey, baseURL }),
|
|
92
102
|
createModelProvider({ apiKey, baseURL })
|
|
93
103
|
);
|
|
94
|
-
const
|
|
104
|
+
const createLucidquery = (apiKey, baseURL = "https://lucidquery.com/api/v1") => merge(
|
|
95
105
|
createChatProvider({ apiKey, baseURL }),
|
|
96
106
|
createModelProvider({ apiKey, baseURL })
|
|
97
107
|
);
|
|
@@ -99,16 +109,40 @@ const createMinimax = (apiKey, baseURL = "https://api.minimax.io/v1/") => merge(
|
|
|
99
109
|
createChatProvider({ apiKey, baseURL }),
|
|
100
110
|
createModelProvider({ apiKey, baseURL })
|
|
101
111
|
);
|
|
102
|
-
const
|
|
112
|
+
const createMinimaxCn = (apiKey, baseURL = "https://api.minimaxi.com/v1/") => merge(
|
|
113
|
+
createChatProvider({ apiKey, baseURL }),
|
|
114
|
+
createModelProvider({ apiKey, baseURL })
|
|
115
|
+
);
|
|
116
|
+
const createMistral = (apiKey, baseURL = "https://api.mistral.ai/v1/") => merge(
|
|
103
117
|
createChatProvider({ apiKey, baseURL }),
|
|
104
118
|
createModelProvider({ apiKey, baseURL }),
|
|
105
119
|
createEmbedProvider({ apiKey, baseURL })
|
|
106
120
|
);
|
|
107
|
-
const
|
|
121
|
+
const createModelscope = (apiKey, baseURL = "https://api-inference.modelscope.cn/v1") => merge(
|
|
108
122
|
createChatProvider({ apiKey, baseURL }),
|
|
109
123
|
createModelProvider({ apiKey, baseURL })
|
|
110
124
|
);
|
|
111
|
-
const
|
|
125
|
+
const createMoonshotai = (apiKey, baseURL = "https://api.moonshot.ai/v1") => merge(
|
|
126
|
+
createChatProvider({ apiKey, baseURL }),
|
|
127
|
+
createModelProvider({ apiKey, baseURL })
|
|
128
|
+
);
|
|
129
|
+
const createMoonshotaiCn = (apiKey, baseURL = "https://api.moonshot.cn/v1") => merge(
|
|
130
|
+
createChatProvider({ apiKey, baseURL }),
|
|
131
|
+
createModelProvider({ apiKey, baseURL })
|
|
132
|
+
);
|
|
133
|
+
const createMorph = (apiKey, baseURL = "https://api.morphllm.com/v1") => merge(
|
|
134
|
+
createChatProvider({ apiKey, baseURL }),
|
|
135
|
+
createModelProvider({ apiKey, baseURL })
|
|
136
|
+
);
|
|
137
|
+
const createNebius = (apiKey, baseURL = "https://api.tokenfactory.nebius.com/v1") => merge(
|
|
138
|
+
createChatProvider({ apiKey, baseURL }),
|
|
139
|
+
createModelProvider({ apiKey, baseURL })
|
|
140
|
+
);
|
|
141
|
+
const createNvidia = (apiKey, baseURL = "https://integrate.api.nvidia.com/v1") => merge(
|
|
142
|
+
createChatProvider({ apiKey, baseURL }),
|
|
143
|
+
createModelProvider({ apiKey, baseURL })
|
|
144
|
+
);
|
|
145
|
+
const createOllamaCloud = (apiKey, baseURL = "https://ollama.com/v1") => merge(
|
|
112
146
|
createChatProvider({ apiKey, baseURL }),
|
|
113
147
|
createModelProvider({ apiKey, baseURL })
|
|
114
148
|
);
|
|
@@ -120,36 +154,38 @@ const createOpenAI = (apiKey, baseURL = "https://api.openai.com/v1/") => merge(
|
|
|
120
154
|
createSpeechProvider({ apiKey, baseURL }),
|
|
121
155
|
createTranscriptionProvider({ apiKey, baseURL })
|
|
122
156
|
);
|
|
123
|
-
const
|
|
157
|
+
const createOpencode = (apiKey, baseURL = "https://opencode.ai/zen/v1") => merge(
|
|
124
158
|
createChatProvider({ apiKey, baseURL }),
|
|
125
159
|
createModelProvider({ apiKey, baseURL })
|
|
126
160
|
);
|
|
127
|
-
const
|
|
161
|
+
const createOvhcloud = (apiKey, baseURL = "https://oai.endpoints.kepler.ai.cloud.ovh.net/v1") => merge(
|
|
128
162
|
createChatProvider({ apiKey, baseURL }),
|
|
129
163
|
createModelProvider({ apiKey, baseURL })
|
|
130
164
|
);
|
|
131
|
-
const
|
|
165
|
+
const createPerplexity = (apiKey, baseURL = "https://api.perplexity.ai/") => merge(
|
|
132
166
|
createChatProvider({ apiKey, baseURL }),
|
|
133
167
|
createModelProvider({ apiKey, baseURL })
|
|
134
168
|
);
|
|
135
|
-
const
|
|
169
|
+
const createPoe = (apiKey, baseURL = "https://api.poe.com/v1") => merge(
|
|
136
170
|
createChatProvider({ apiKey, baseURL }),
|
|
137
171
|
createModelProvider({ apiKey, baseURL })
|
|
138
172
|
);
|
|
139
|
-
const
|
|
173
|
+
const createRequesty = (apiKey, baseURL = "https://router.requesty.ai/v1") => merge(
|
|
140
174
|
createChatProvider({ apiKey, baseURL }),
|
|
141
175
|
createModelProvider({ apiKey, baseURL })
|
|
142
176
|
);
|
|
143
|
-
const
|
|
177
|
+
const createScaleway = (apiKey, baseURL = "https://api.scaleway.ai/v1") => merge(
|
|
144
178
|
createChatProvider({ apiKey, baseURL }),
|
|
145
179
|
createModelProvider({ apiKey, baseURL })
|
|
146
180
|
);
|
|
147
|
-
const
|
|
181
|
+
const createSiliconFlow = (apiKey, baseURL = "https://api.siliconflow.com/v1") => merge(
|
|
148
182
|
createChatProvider({ apiKey, baseURL }),
|
|
149
183
|
createModelProvider({ apiKey, baseURL }),
|
|
150
|
-
createEmbedProvider({ apiKey, baseURL })
|
|
184
|
+
createEmbedProvider({ apiKey, baseURL }),
|
|
185
|
+
createSpeechProvider({ apiKey, baseURL }),
|
|
186
|
+
createTranscriptionProvider({ apiKey, baseURL })
|
|
151
187
|
);
|
|
152
|
-
const
|
|
188
|
+
const createSiliconflowCn = (apiKey, baseURL = "https://api.siliconflow.cn/v1") => merge(
|
|
153
189
|
createChatProvider({ apiKey, baseURL }),
|
|
154
190
|
createModelProvider({ apiKey, baseURL })
|
|
155
191
|
);
|
|
@@ -157,52 +193,51 @@ const createSubmodel = (apiKey, baseURL = "https://llm.submodel.ai/v1") => merge
|
|
|
157
193
|
createChatProvider({ apiKey, baseURL }),
|
|
158
194
|
createModelProvider({ apiKey, baseURL })
|
|
159
195
|
);
|
|
160
|
-
const
|
|
196
|
+
const createSynthetic = (apiKey, baseURL = "https://api.synthetic.new/v1") => merge(
|
|
161
197
|
createChatProvider({ apiKey, baseURL }),
|
|
162
198
|
createModelProvider({ apiKey, baseURL })
|
|
163
199
|
);
|
|
164
|
-
const
|
|
200
|
+
const createUpstage = (apiKey, baseURL = "https://api.upstage.ai") => merge(
|
|
165
201
|
createChatProvider({ apiKey, baseURL }),
|
|
166
202
|
createModelProvider({ apiKey, baseURL })
|
|
167
203
|
);
|
|
168
|
-
const
|
|
204
|
+
const createVenice = (apiKey, baseURL = "https://api.venice.ai/api/v1") => merge(
|
|
169
205
|
createChatProvider({ apiKey, baseURL }),
|
|
170
206
|
createModelProvider({ apiKey, baseURL })
|
|
171
207
|
);
|
|
172
|
-
const
|
|
208
|
+
const createVultr = (apiKey, baseURL = "https://api.vultrinference.com/v1") => merge(
|
|
173
209
|
createChatProvider({ apiKey, baseURL }),
|
|
174
210
|
createModelProvider({ apiKey, baseURL })
|
|
175
211
|
);
|
|
176
|
-
const
|
|
212
|
+
const createWandb = (apiKey, baseURL = "https://api.inference.wandb.ai/v1") => merge(
|
|
177
213
|
createChatProvider({ apiKey, baseURL }),
|
|
178
214
|
createModelProvider({ apiKey, baseURL })
|
|
179
215
|
);
|
|
180
|
-
const
|
|
216
|
+
const createXai = (apiKey, baseURL = "https://api.x.ai/v1/") => merge(
|
|
181
217
|
createChatProvider({ apiKey, baseURL }),
|
|
182
218
|
createModelProvider({ apiKey, baseURL })
|
|
183
219
|
);
|
|
184
|
-
const
|
|
220
|
+
const createXiaomi = (apiKey, baseURL = "https://api.xiaomimimo.com/v1") => merge(
|
|
185
221
|
createChatProvider({ apiKey, baseURL }),
|
|
186
222
|
createModelProvider({ apiKey, baseURL })
|
|
187
223
|
);
|
|
188
|
-
const
|
|
224
|
+
const createZai = (apiKey, baseURL = "https://api.z.ai/api/paas/v4") => merge(
|
|
189
225
|
createChatProvider({ apiKey, baseURL }),
|
|
190
226
|
createModelProvider({ apiKey, baseURL })
|
|
191
227
|
);
|
|
192
|
-
const
|
|
228
|
+
const createZaiCodingPlan = (apiKey, baseURL = "https://api.z.ai/api/coding/paas/v4") => merge(
|
|
193
229
|
createChatProvider({ apiKey, baseURL }),
|
|
194
230
|
createModelProvider({ apiKey, baseURL })
|
|
195
231
|
);
|
|
196
|
-
const
|
|
232
|
+
const createZenmux = (apiKey, baseURL = "https://zenmux.ai/api/v1") => merge(
|
|
197
233
|
createChatProvider({ apiKey, baseURL }),
|
|
198
234
|
createModelProvider({ apiKey, baseURL })
|
|
199
235
|
);
|
|
200
|
-
const
|
|
236
|
+
const createZhipuai = (apiKey, baseURL = "https://open.bigmodel.cn/api/paas/v4") => merge(
|
|
201
237
|
createChatProvider({ apiKey, baseURL }),
|
|
202
|
-
createModelProvider({ apiKey, baseURL })
|
|
203
|
-
createEmbedProvider({ apiKey, baseURL })
|
|
238
|
+
createModelProvider({ apiKey, baseURL })
|
|
204
239
|
);
|
|
205
|
-
const
|
|
240
|
+
const createZhipuaiCodingPlan = (apiKey, baseURL = "https://open.bigmodel.cn/api/coding/paas/v4") => merge(
|
|
206
241
|
createChatProvider({ apiKey, baseURL }),
|
|
207
242
|
createModelProvider({ apiKey, baseURL })
|
|
208
243
|
);
|
|
@@ -210,29 +245,33 @@ const createNovita = (apiKey, baseURL = "https://api.novita.ai/v3/openai/") => m
|
|
|
210
245
|
createChatProvider({ apiKey, baseURL }),
|
|
211
246
|
createModelProvider({ apiKey, baseURL })
|
|
212
247
|
);
|
|
213
|
-
const
|
|
248
|
+
const createStepfun = (apiKey, baseURL = "https://api.stepfun.com/v1/") => merge(
|
|
214
249
|
createChatProvider({ apiKey, baseURL }),
|
|
215
250
|
createModelProvider({ apiKey, baseURL }),
|
|
216
251
|
createEmbedProvider({ apiKey, baseURL }),
|
|
217
252
|
createSpeechProvider({ apiKey, baseURL }),
|
|
218
253
|
createTranscriptionProvider({ apiKey, baseURL })
|
|
219
254
|
);
|
|
220
|
-
const
|
|
255
|
+
const createTencentHunyuan = (apiKey, baseURL = "https://api.hunyuan.cloud.tencent.com/v1/") => merge(
|
|
221
256
|
createChatProvider({ apiKey, baseURL }),
|
|
222
257
|
createModelProvider({ apiKey, baseURL }),
|
|
223
|
-
createEmbedProvider({ apiKey, baseURL })
|
|
224
|
-
createSpeechProvider({ apiKey, baseURL }),
|
|
225
|
-
createTranscriptionProvider({ apiKey, baseURL })
|
|
258
|
+
createEmbedProvider({ apiKey, baseURL })
|
|
226
259
|
);
|
|
227
|
-
const
|
|
260
|
+
const createOllama = (apiKey, baseURL = "http://localhost:11434/v1/") => merge(
|
|
228
261
|
createChatProvider({ apiKey, baseURL }),
|
|
229
262
|
createModelProvider({ apiKey, baseURL }),
|
|
230
263
|
createEmbedProvider({ apiKey, baseURL })
|
|
231
264
|
);
|
|
265
|
+
const createLitellm = (apiKey, baseURL = "http://localhost:4000/v1/") => merge(
|
|
266
|
+
createChatProvider({ apiKey, baseURL }),
|
|
267
|
+
createModelProvider({ apiKey, baseURL }),
|
|
268
|
+
createEmbedProvider({ apiKey, baseURL }),
|
|
269
|
+
createSpeechProvider({ apiKey, baseURL }),
|
|
270
|
+
createTranscriptionProvider({ apiKey, baseURL })
|
|
271
|
+
);
|
|
232
272
|
|
|
233
273
|
const createAnthropic = (apiKey, baseURL = "https://api.anthropic.com/v1/") => merge(
|
|
234
|
-
|
|
235
|
-
createChatProvider({ apiKey, baseURL }),
|
|
274
|
+
createChatProviderWithExtraOptions({ apiKey, baseURL }),
|
|
236
275
|
createModelProvider({ apiKey, baseURL })
|
|
237
276
|
);
|
|
238
277
|
|
|
@@ -282,4 +321,4 @@ const createTogetherAI = (apiKey, baseURL = "https://api.together.xyz/v1/") => m
|
|
|
282
321
|
})
|
|
283
322
|
);
|
|
284
323
|
|
|
285
|
-
export {
|
|
324
|
+
export { createZaiCodingPlan as $, createMinimaxCn as A, createMistral as B, createModelscope as C, createMoonshotai as D, createMoonshotaiCn as E, createMorph as F, createNebius as G, createNvidia as H, createOllamaCloud as I, createOpenAI as J, createOpencode as K, createOvhcloud as L, createPerplexity as M, createPoe as N, createRequesty as O, createScaleway as P, createSiliconFlow as Q, createSiliconflowCn as R, createSubmodel as S, createSynthetic as T, createUpstage as U, createVenice as V, createVultr as W, createWandb as X, createXai as Y, createXiaomi as Z, createZai as _, createAlibabaCn as a, createZenmux as a0, createZhipuai as a1, createZhipuaiCodingPlan as a2, createNovita as a3, createStepfun as a4, createTencentHunyuan as a5, createOllama as a6, createLitellm as a7, createAnthropic as a8, createFeatherless as a9, createOpenRouter as aa, createTogetherAI as ab, createBailing as b, createAlibaba as c, createBaseten as d, createCerebras as e, createChutes as f, createCortecs as g, createDeepinfra as h, createDeepSeek as i, createFastrouter as j, createFireworks as k, createGithubCopilot as l, createGithubModels as m, createGoogleGenerativeAI as n, createGroq as o, createHelicone as p, createHuggingface as q, createIflowcn as r, createInception as s, createInference as t, createIoNet as u, createKimiForCoding as v, createLlama as w, createLmstudio as x, createLucidquery as y, createMinimax as z };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsai-ext/providers",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.0-beta.
|
|
4
|
+
"version": "0.4.0-beta.12",
|
|
5
5
|
"description": "extra-small AI SDK.",
|
|
6
6
|
"author": "Moeru AI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@xsai-ext/shared-providers": "~0.4.0-beta.
|
|
37
|
-
"@xsai/shared": "~0.4.0-beta.
|
|
36
|
+
"@xsai-ext/shared-providers": "~0.4.0-beta.12",
|
|
37
|
+
"@xsai/shared": "~0.4.0-beta.12"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"scule": "^1.3.0"
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import * as _xsai_ext_shared_providers from '@xsai-ext/shared-providers';
|
|
2
|
-
import { ChatProviderWithExtraOptions } from '@xsai-ext/shared-providers';
|
|
3
|
-
|
|
4
|
-
type OpenrouterModels = 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-dev-72b:free' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-0905:exacto' | 'moonshotai/kimi-k2:free' | 'thudm/glm-z1-32b:free' | 'nousresearch/hermes-4-70b' | 'nousresearch/hermes-4-405b' | 'nousresearch/deephermes-3-llama-3-8b-preview' | 'nvidia/nemotron-nano-9b-v2' | 'x-ai/grok-4' | 'x-ai/grok-code-fast-1' | 'x-ai/grok-3' | 'x-ai/grok-4-fast' | 'x-ai/grok-3-beta' | 'x-ai/grok-3-mini-beta' | 'x-ai/grok-3-mini' | 'x-ai/grok-4.1-fast' | 'kwaipilot/kat-coder-pro:free' | 'cognitivecomputations/dolphin3.0-mistral-24b' | 'cognitivecomputations/dolphin3.0-r1-mistral-24b' | 'deepseek/deepseek-chat-v3.1' | 'deepseek/deepseek-r1:free' | 'deepseek/deepseek-v3-base:free' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-r1-0528-qwen3-8b:free' | 'deepseek/deepseek-chat-v3-0324' | 'deepseek/deepseek-r1-0528:free' | 'deepseek/deepseek-r1-distill-llama-70b' | 'deepseek/deepseek-r1-distill-qwen-14b' | 'deepseek/deepseek-v3.1-terminus:exacto' | 'featherless/qwerky-72b' | 'tngtech/deepseek-r1t2-chimera:free' | 'minimax/minimax-m1' | 'minimax/minimax-m2' | 'minimax/minimax-01' | 'google/gemini-2.0-flash-001' | 'google/gemma-2-9b-it:free' | 'google/gemini-3-pro-preview' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-pro-preview-05-06' | 'google/gemma-3n-e4b-it' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro-preview-06-05' | 'google/gemini-2.5-flash-preview-09-2025' | 'google/gemini-2.5-pro' | 'google/gemma-3-12b-it' | 'google/gemma-3n-e4b-it:free' | 'google/gemini-2.5-flash-lite-preview-09-2025' | 'google/gemini-2.0-flash-exp:free' | 'google/gemma-3-27b-it' | 'microsoft/mai-ds-r1:free' | 'openai/gpt-5.1-codex' | 'openai/gpt-4.1-mini' | 'openai/gpt-5-chat' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1' | 'openai/gpt-5-nano' | 'openai/gpt-5-codex' | 'openai/gpt-4.1' | 'openai/gpt-oss-120b:exacto' | 'openai/o4-mini' | 'openai/gpt-5.1-chat' | 'openai/gpt-5-mini' | 'openai/gpt-5-image' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-120b' | 'openai/gpt-4o-mini' | 'openai/gpt-5' | 'openai/gpt-5-pro' | 'openrouter/sherlock-think-alpha' | 'openrouter/sherlock-dash-alpha' | 'z-ai/glm-4.5' | 'z-ai/glm-4.5-air' | 'z-ai/glm-4.5v' | 'z-ai/glm-4.6' | 'z-ai/glm-4.6:exacto' | 'z-ai/glm-4.5-air:free' | 'qwen/qwen3-coder' | 'qwen/qwen3-32b:free' | 'qwen/qwen3-next-80b-a3b-instruct' | 'qwen/qwen-2.5-coder-32b-instruct' | 'qwen/qwen3-235b-a22b:free' | 'qwen/qwq-32b:free' | 'qwen/qwen3-30b-a3b-thinking-2507' | 'qwen/qwen3-30b-a3b:free' | 'qwen/qwen2.5-vl-72b-instruct' | 'qwen/qwen3-14b:free' | 'qwen/qwen3-30b-a3b-instruct-2507' | 'qwen/qwen3-235b-a22b-thinking-2507' | 'qwen/qwen2.5-vl-32b-instruct:free' | 'qwen/qwen2.5-vl-72b-instruct:free' | 'qwen/qwen3-235b-a22b-07-25:free' | 'qwen/qwen3-coder:free' | 'qwen/qwen3-235b-a22b-07-25' | 'qwen/qwen3-8b:free' | 'qwen/qwen3-max' | 'qwen/qwen3-next-80b-a3b-thinking' | 'qwen/qwen3-coder:exacto' | 'mistralai/devstral-medium-2507' | 'mistralai/codestral-2508' | 'mistralai/mistral-7b-instruct:free' | 'mistralai/devstral-small-2505' | 'mistralai/mistral-small-3.2-24b-instruct' | 'mistralai/devstral-small-2505:free' | 'mistralai/mistral-small-3.2-24b-instruct:free' | 'mistralai/mistral-medium-3' | 'mistralai/mistral-small-3.1-24b-instruct' | 'mistralai/devstral-small-2507' | 'mistralai/mistral-medium-3.1' | 'mistralai/mistral-nemo:free' | 'rekaai/reka-flash-3' | 'meta-llama/llama-3.2-11b-vision-instruct' | 'meta-llama/llama-3.3-70b-instruct:free' | 'meta-llama/llama-4-scout:free' | 'anthropic/claude-opus-4' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'sarvamai/sarvam-m:free';
|
|
5
|
-
type TogetheraiModels = 'moonshotai/Kimi-K2-Instruct' | 'openai/gpt-oss-120b' | 'meta-llama/Llama-3.3-70B-Instruct-Turbo' | 'Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8' | 'deepseek-ai/DeepSeek-R1' | 'deepseek-ai/DeepSeek-V3';
|
|
6
|
-
type AzureModels = 'gpt-4.1-nano' | 'gpt-4' | 'claude-opus-4-1' | 'gpt-4-32k' | 'gpt-5.1-codex' | 'claude-haiku-4-5' | 'gpt-4.1-mini' | 'gpt-5-chat' | 'claude-sonnet-4-5' | 'gpt-3.5-turbo-0125' | 'gpt-4-turbo' | 'gpt-3.5-turbo-0613' | 'o1-preview' | 'gpt-5.1-codex-mini' | 'o3-mini' | 'gpt-5.1' | 'gpt-5-nano' | 'gpt-5-codex' | 'gpt-4o' | 'gpt-3.5-turbo-0301' | 'gpt-4.1' | 'o4-mini' | 'o1' | 'gpt-5.1-chat' | 'gpt-5-mini' | 'o1-mini' | 'gpt-3.5-turbo-instruct' | 'o3' | 'codex-mini' | 'gpt-4-turbo-vision' | 'gpt-4o-mini' | 'gpt-5' | 'gpt-3.5-turbo-1106';
|
|
7
|
-
type CloudflareWorkersAiModels = 'mistral-7b-instruct-v0.1-awq' | 'aura-1' | 'mistral-7b-instruct-v0.2' | 'tinyllama-1.1b-chat-v1.0' | 'qwen1.5-0.5b-chat' | 'llama-3.2-11b-vision-instruct' | 'llama-2-13b-chat-awq' | 'llama-3.1-8b-instruct-fp8' | 'whisper' | 'stable-diffusion-xl-base-1.0' | 'llama-2-7b-chat-fp16' | 'resnet-50' | 'stable-diffusion-v1-5-inpainting' | 'sqlcoder-7b-2' | 'llama-3-8b-instruct' | 'llama-2-7b-chat-hf-lora' | 'llama-3.1-8b-instruct' | 'openchat-3.5-0106' | 'openhermes-2.5-mistral-7b-awq' | 'lucid-origin' | 'bart-large-cnn' | 'flux-1-schnell' | 'deepseek-r1-distill-qwen-32b' | 'gemma-2b-it-lora' | 'una-cybertron-7b-v2-bf16' | 'm2m100-1.2b' | 'llama-3.2-3b-instruct' | 'qwen2.5-coder-32b-instruct' | 'stable-diffusion-v1-5-img2img' | 'gemma-7b-it-lora' | 'qwen1.5-14b-chat-awq' | 'qwen1.5-1.8b-chat' | 'mistral-small-3.1-24b-instruct' | 'gemma-7b-it' | 'llamaguard-7b-awq' | 'hermes-2-pro-mistral-7b' | 'falcon-7b-instruct' | 'llama-3.3-70b-instruct-fp8-fast' | 'llama-3-8b-instruct-awq' | 'phoenix-1.0' | 'phi-2' | 'dreamshaper-8-lcm' | 'discolm-german-7b-v1-awq' | 'llama-2-7b-chat-int8' | 'llama-3.2-1b-instruct' | 'whisper-large-v3-turbo' | 'llama-4-scout-17b-16e-instruct' | 'starling-lm-7b-beta' | 'deepseek-coder-6.7b-base-awq' | 'gemma-3-12b-it' | 'llama-guard-3-8b' | 'neural-chat-7b-v3-1-awq' | 'whisper-tiny-en' | 'stable-diffusion-xl-lightning' | 'mistral-7b-instruct-v0.1' | 'llava-1.5-7b-hf' | 'gpt-oss-20b' | 'deepseek-math-7b-instruct' | 'gpt-oss-120b' | 'melotts' | 'qwen1.5-7b-chat-awq' | 'llama-3.1-8b-instruct-fast' | 'nova-3' | 'llama-3.1-70b-instruct' | 'qwq-32b' | 'zephyr-7b-beta-awq' | 'deepseek-coder-6.7b-instruct-awq' | 'llama-3.1-8b-instruct-awq' | 'mistral-7b-instruct-v0.2-lora' | 'uform-gen2-qwen-500m';
|
|
8
|
-
type AnthropicModels = 'claude-opus-4-0' | 'claude-3-5-sonnet-20241022' | 'claude-opus-4-1' | 'claude-haiku-4-5' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-3-opus-20240229' | 'claude-sonnet-4-5' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-20250514' | 'claude-opus-4-20250514' | 'claude-3-5-haiku-20241022' | 'claude-3-haiku-20240307' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-sonnet-4-0' | 'claude-opus-4-1-20250805' | 'claude-3-sonnet-20240229' | 'claude-haiku-4-5-20251001';
|
|
9
|
-
|
|
10
|
-
interface OpenRouterOptions {
|
|
11
|
-
extraHeaders?: (Headers | Record<string, string>) & {
|
|
12
|
-
'HTTP-Referer'?: string;
|
|
13
|
-
'X-Title'?: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Model routing
|
|
17
|
-
*
|
|
18
|
-
* @see {@link https://openrouter.ai/docs/features/model-routing}
|
|
19
|
-
* @example
|
|
20
|
-
* ```
|
|
21
|
-
* {
|
|
22
|
-
* model: [ 'openai/gpt-1o' ],
|
|
23
|
-
* models: [ 'openai/gpt-4o', 'google/gemini-2.0-flash-001' ],
|
|
24
|
-
* messages: [
|
|
25
|
-
* { role: 'user', content: 'Hello, world!' },
|
|
26
|
-
* ]
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
models?: string[];
|
|
31
|
-
/**
|
|
32
|
-
* Provider routing
|
|
33
|
-
*
|
|
34
|
-
* @see {@link https://openrouter.ai/docs/features/provider-routing}
|
|
35
|
-
*/
|
|
36
|
-
provider?: {
|
|
37
|
-
/**
|
|
38
|
-
* Whether to allow backup providers when the primary is unavailable.
|
|
39
|
-
*
|
|
40
|
-
* @see {@link https://openrouter.ai/docs/features/provider-routing#disabling-fallbacks}
|
|
41
|
-
* @default true
|
|
42
|
-
* @example false
|
|
43
|
-
*/
|
|
44
|
-
allowFallbacks?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Control whether to use providers that may store data.
|
|
47
|
-
*
|
|
48
|
-
* @see {@link https://openrouter.ai/docs/features/provider-routing#requiring-providers-to-comply-with-data-policies}
|
|
49
|
-
* @default 'allow'
|
|
50
|
-
*/
|
|
51
|
-
dataCollection?: 'allow' | 'deny';
|
|
52
|
-
/**
|
|
53
|
-
* List of provider names to skip for this request.
|
|
54
|
-
*
|
|
55
|
-
* @see {@link https://openrouter.ai/docs/features/provider-routing#ignoring-providers}
|
|
56
|
-
*/
|
|
57
|
-
ignore?: string[];
|
|
58
|
-
/**
|
|
59
|
-
* List of provider names to try in order (e.g. ["Anthropic", "OpenAI"]).
|
|
60
|
-
*
|
|
61
|
-
* @see {@link https://openrouter.ai/docs/features/provider-routing#ordering-specific-providers}
|
|
62
|
-
* @example [ 'Anthropic', 'OpenAI' ]
|
|
63
|
-
*/
|
|
64
|
-
order?: string[];
|
|
65
|
-
/**
|
|
66
|
-
* List of quantization levels to filter by (e.g. ["int4", "int8"]).
|
|
67
|
-
*
|
|
68
|
-
* @see {@link https://openrouter.ai/docs/features/provider-routing#quantization}
|
|
69
|
-
* @example [ 'int4', 'int8' ]
|
|
70
|
-
*/
|
|
71
|
-
quantizations?: string[];
|
|
72
|
-
/**
|
|
73
|
-
* Only use providers that support all parameters in your request.
|
|
74
|
-
*
|
|
75
|
-
* @see {@link https://openrouter.ai/docs/features/provider-routing#requiring-providers-to-support-all-parameters-beta}
|
|
76
|
-
*/
|
|
77
|
-
requireParameters?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Sort providers by price or throughput. (e.g. "price" or "throughput").
|
|
80
|
-
*
|
|
81
|
-
* @see {@link https://openrouter.ai/docs/features/provider-routing#provider-sorting}
|
|
82
|
-
* @example 'price'
|
|
83
|
-
*/
|
|
84
|
-
sort?: string;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* To help with prompts that exceed the maximum context size of a model.
|
|
88
|
-
*
|
|
89
|
-
* All OpenRouter endpoints with 8k or less context length will default to using middle-out.
|
|
90
|
-
* To disable this, set `transforms: []` in the request body.
|
|
91
|
-
*
|
|
92
|
-
* @see {@link https://openrouter.ai/docs/features/message-transforms}
|
|
93
|
-
* @default 'middle-out'
|
|
94
|
-
*/
|
|
95
|
-
transforms?: string[];
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Create a OpenRouter Provider
|
|
99
|
-
* @see {@link https://openrouter.ai/models}
|
|
100
|
-
*/
|
|
101
|
-
declare const createOpenRouter: (apiKey: string, baseURL?: string) => _xsai_ext_shared_providers.ModelProvider & ChatProviderWithExtraOptions<OpenrouterModels, OpenRouterOptions>;
|
|
102
|
-
|
|
103
|
-
export { createOpenRouter as c };
|
|
104
|
-
export type { AnthropicModels as A, CloudflareWorkersAiModels as C, OpenrouterModels as O, TogetheraiModels as T, OpenRouterOptions as a, AzureModels as b };
|