@anvaka/vue-llm 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/pricing/rates.js +20 -3
- package/dist/providers/AnthropicProvider.js +17 -13
- package/dist/providers/BedrockMantleProvider.js +265 -0
- package/dist/providers/BedrockProvider.js +87 -59
- package/dist/providers/factory.js +84 -50
- package/dist/providers/index.js +12 -9
- package/dist/vue/components/LLMConfigModal.vue.js +357 -297
- package/dist/vue/useLLM.js +10 -8
- package/dist/vue-llm.css +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { OpenAIProvider as
|
|
2
|
-
import { AnthropicProvider as
|
|
3
|
-
import { BedrockProvider as
|
|
1
|
+
import { OpenAIProvider as o } from "./OpenAIProvider.js";
|
|
2
|
+
import { AnthropicProvider as n } from "./AnthropicProvider.js";
|
|
3
|
+
import { BedrockProvider as i } from "./BedrockProvider.js";
|
|
4
|
+
import { BedrockMantleProvider as p } from "./BedrockMantleProvider.js";
|
|
4
5
|
import { GrokProvider as m } from "./GrokProvider.js";
|
|
5
|
-
import { GeminiProvider as
|
|
6
|
-
import { OllamaProvider as
|
|
6
|
+
import { GeminiProvider as u } from "./GeminiProvider.js";
|
|
7
|
+
import { OllamaProvider as l } from "./OllamaProvider.js";
|
|
7
8
|
import { LlamaServerProvider as E } from "./LlamaServerProvider.js";
|
|
8
|
-
import { OpenRouterProvider as
|
|
9
|
-
import { DeepSeekProvider as
|
|
10
|
-
import { CustomProvider as
|
|
11
|
-
const
|
|
9
|
+
import { OpenRouterProvider as A } from "./OpenRouterProvider.js";
|
|
10
|
+
import { DeepSeekProvider as O } from "./DeepSeekProvider.js";
|
|
11
|
+
import { CustomProvider as c } from "./CustomProvider.js";
|
|
12
|
+
const r = {
|
|
12
13
|
OPENAI: "openai",
|
|
13
14
|
ANTHROPIC: "anthropic",
|
|
14
15
|
BEDROCK: "bedrock",
|
|
@@ -20,60 +21,93 @@ const e = {
|
|
|
20
21
|
DEEPSEEK: "deepseek",
|
|
21
22
|
CUSTOM: "custom"
|
|
22
23
|
}, S = {
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
[r.OPENAI]: { name: "OpenAI", baseUrl: "https://api.openai.com", requiresApiKey: !0 },
|
|
25
|
+
[r.ANTHROPIC]: { name: "Anthropic", baseUrl: "https://api.anthropic.com", requiresApiKey: !0 },
|
|
26
|
+
[r.BEDROCK]: {
|
|
27
|
+
name: "AWS",
|
|
28
|
+
// Two backends, chosen by a UI toggle. Mantle (default) serves the whole
|
|
29
|
+
// catalog behind one model list via BedrockMantleProvider's auto-routing
|
|
30
|
+
// (Claude -> Anthropic Messages, the rest -> OpenAI Chat Completions).
|
|
31
|
+
// Bedrock is the classic Claude-only bedrock-runtime transport. `baseUrl`
|
|
32
|
+
// is derived from (backend, region) via the templates below, and
|
|
33
|
+
// `createProvider` picks the class from `config.backend`. The region list
|
|
34
|
+
// is valid on both.
|
|
35
|
+
baseUrl: "https://bedrock-mantle.us-east-1.api.aws",
|
|
36
|
+
baseUrlTemplate: "https://bedrock-mantle.{region}.api.aws",
|
|
37
|
+
defaultBackend: "mantle",
|
|
38
|
+
backends: {
|
|
39
|
+
mantle: { label: "Mantle", baseUrlTemplate: "https://bedrock-mantle.{region}.api.aws" },
|
|
40
|
+
runtime: { label: "Bedrock", baseUrlTemplate: "https://bedrock-runtime.{region}.amazonaws.com" }
|
|
41
|
+
},
|
|
42
|
+
regions: [
|
|
43
|
+
"us-east-1",
|
|
44
|
+
"us-east-2",
|
|
45
|
+
"us-west-2",
|
|
46
|
+
"eu-central-1",
|
|
47
|
+
"eu-west-1",
|
|
48
|
+
"eu-west-2",
|
|
49
|
+
"eu-north-1",
|
|
50
|
+
"eu-south-1",
|
|
51
|
+
"ap-northeast-1",
|
|
52
|
+
"ap-south-1",
|
|
53
|
+
"ap-southeast-2",
|
|
54
|
+
"ap-southeast-3",
|
|
55
|
+
"sa-east-1"
|
|
56
|
+
],
|
|
57
|
+
defaultRegion: "us-east-1",
|
|
58
|
+
requiresApiKey: !0
|
|
59
|
+
},
|
|
60
|
+
[r.GROK]: { name: "Grok", baseUrl: "https://api.x.ai", requiresApiKey: !0 },
|
|
61
|
+
[r.GEMINI]: { name: "Google Gemini", baseUrl: "https://generativelanguage.googleapis.com", requiresApiKey: !0 },
|
|
62
|
+
[r.OLLAMA]: { name: "Ollama (Native)", baseUrl: "http://localhost:11434", requiresApiKey: !1 },
|
|
63
|
+
[r.LLAMA_SERVER]: { name: "Local Llama Server", baseUrl: "http://localhost:8080", requiresApiKey: !1 },
|
|
64
|
+
[r.OPENROUTER]: { name: "OpenRouter", baseUrl: "https://openrouter.ai/api", requiresApiKey: !0 },
|
|
65
|
+
[r.DEEPSEEK]: { name: "DeepSeek", baseUrl: "https://api.deepseek.com", requiresApiKey: !0 },
|
|
66
|
+
[r.CUSTOM]: { name: "Custom OpenAI Compatible", baseUrl: "", requiresApiKey: !1 }
|
|
33
67
|
};
|
|
34
|
-
function
|
|
68
|
+
function d(t, e) {
|
|
35
69
|
switch (t) {
|
|
36
|
-
case
|
|
37
|
-
return new
|
|
38
|
-
case
|
|
39
|
-
return new
|
|
40
|
-
case
|
|
41
|
-
return new
|
|
42
|
-
case
|
|
43
|
-
return new m(
|
|
44
|
-
case
|
|
45
|
-
return new
|
|
46
|
-
case
|
|
47
|
-
return new
|
|
48
|
-
case
|
|
49
|
-
return new E(
|
|
50
|
-
case
|
|
51
|
-
return new
|
|
52
|
-
case
|
|
53
|
-
return new
|
|
54
|
-
case
|
|
55
|
-
return new
|
|
70
|
+
case r.OPENAI:
|
|
71
|
+
return new o(e);
|
|
72
|
+
case r.ANTHROPIC:
|
|
73
|
+
return new n(e);
|
|
74
|
+
case r.BEDROCK:
|
|
75
|
+
return (e == null ? void 0 : e.backend) === "runtime" ? new i(e) : new p(e);
|
|
76
|
+
case r.GROK:
|
|
77
|
+
return new m(e);
|
|
78
|
+
case r.GEMINI:
|
|
79
|
+
return new u(e);
|
|
80
|
+
case r.OLLAMA:
|
|
81
|
+
return new l(e);
|
|
82
|
+
case r.LLAMA_SERVER:
|
|
83
|
+
return new E(e);
|
|
84
|
+
case r.OPENROUTER:
|
|
85
|
+
return new A(e);
|
|
86
|
+
case r.DEEPSEEK:
|
|
87
|
+
return new O(e);
|
|
88
|
+
case r.CUSTOM:
|
|
89
|
+
return new c(e);
|
|
56
90
|
default:
|
|
57
91
|
throw new Error(`Unknown provider type: ${t}`);
|
|
58
92
|
}
|
|
59
93
|
}
|
|
60
94
|
const a = /* @__PURE__ */ new Map();
|
|
61
|
-
function
|
|
62
|
-
if (typeof t != "string" || !
|
|
95
|
+
function M(t, e) {
|
|
96
|
+
if (typeof t != "string" || !e)
|
|
63
97
|
throw new Error("registerProvider requires a type string and a class reference");
|
|
64
|
-
a.set(t,
|
|
98
|
+
a.set(t, e);
|
|
65
99
|
}
|
|
66
|
-
function N(t,
|
|
100
|
+
function N(t, e) {
|
|
67
101
|
if (a.has(t)) {
|
|
68
|
-
const
|
|
69
|
-
return new
|
|
102
|
+
const s = a.get(t);
|
|
103
|
+
return new s(e);
|
|
70
104
|
}
|
|
71
|
-
return
|
|
105
|
+
return d(t, e);
|
|
72
106
|
}
|
|
73
107
|
export {
|
|
74
108
|
S as DEFAULT_CONFIGS,
|
|
75
|
-
|
|
76
|
-
|
|
109
|
+
r as PROVIDERS,
|
|
110
|
+
d as createProvider,
|
|
77
111
|
N as createProviderFlexible,
|
|
78
|
-
|
|
112
|
+
M as registerProvider
|
|
79
113
|
};
|
package/dist/providers/index.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { BaseProvider as o } from "./BaseProvider.js";
|
|
2
2
|
import { OpenAIProvider as t } from "./OpenAIProvider.js";
|
|
3
3
|
import { AnthropicProvider as p } from "./AnthropicProvider.js";
|
|
4
|
-
import { BEDROCK_CLAUDE_MODELS as v, BedrockProvider as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { BEDROCK_CLAUDE_MODELS as v, BedrockProvider as D } from "./BedrockProvider.js";
|
|
5
|
+
import { BEDROCK_MANTLE_CLAUDE_MODELS as x, BedrockMantleProvider as f } from "./BedrockMantleProvider.js";
|
|
6
|
+
import { DeepSeekProvider as O } from "./DeepSeekProvider.js";
|
|
7
|
+
import { DEFAULT_CONFIGS as L, PROVIDERS as _, createProvider as c, createProviderFlexible as B, registerProvider as C } from "./factory.js";
|
|
7
8
|
export {
|
|
8
9
|
p as AnthropicProvider,
|
|
9
10
|
v as BEDROCK_CLAUDE_MODELS,
|
|
11
|
+
x as BEDROCK_MANTLE_CLAUDE_MODELS,
|
|
10
12
|
o as BaseProvider,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
f as BedrockMantleProvider,
|
|
14
|
+
D as BedrockProvider,
|
|
15
|
+
L as DEFAULT_CONFIGS,
|
|
16
|
+
O as DeepSeekProvider,
|
|
14
17
|
t as OpenAIProvider,
|
|
15
|
-
|
|
18
|
+
_ as PROVIDERS,
|
|
16
19
|
c as createProvider,
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
B as createProviderFlexible,
|
|
21
|
+
C as registerProvider
|
|
19
22
|
};
|