@saltcorn/large-language-model 0.7.5 → 0.7.7
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/constants.js +7 -6
- package/generate.js +6 -2
- package/index.js +7 -0
- package/package.json +1 -1
package/constants.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
const OPENAI_MODELS = [
|
|
2
2
|
"gpt-3.5-turbo",
|
|
3
3
|
"gpt-3.5-turbo-16k",
|
|
4
|
-
"gpt-3.5-turbo-1106",
|
|
5
|
-
"gpt-3.5-turbo-0125",
|
|
6
|
-
"gpt-3.5-turbo-0613",
|
|
7
|
-
"gpt-3.5-turbo-16k-0613",
|
|
8
4
|
"gpt-4o-mini",
|
|
9
5
|
"gpt-4",
|
|
10
6
|
"gpt-4-32k",
|
|
11
7
|
"gpt-4-turbo-preview",
|
|
12
|
-
"gpt-4-1106-preview",
|
|
13
|
-
"gpt-4-0125-preview",
|
|
14
8
|
"gpt-4-turbo",
|
|
15
9
|
"gpt-4o",
|
|
10
|
+
"gpt-4.1",
|
|
11
|
+
"gpt-4.1-mini",
|
|
12
|
+
"gpt-4.1-nano",
|
|
13
|
+
"o1",
|
|
14
|
+
"o3",
|
|
15
|
+
"o3-mini",
|
|
16
|
+
"o4-mini",
|
|
16
17
|
];
|
|
17
18
|
|
|
18
19
|
// https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored
|
package/generate.js
CHANGED
|
@@ -56,7 +56,9 @@ const getEmbedding = async (config, opts) => {
|
|
|
56
56
|
if (!ollamaMod) throw new Error("Not implemented for this backend");
|
|
57
57
|
|
|
58
58
|
const { Ollama } = ollamaMod;
|
|
59
|
-
const ollama = new Ollama(
|
|
59
|
+
const ollama = new Ollama(
|
|
60
|
+
config.ollama_host ? { host: config.ollama_host } : undefined
|
|
61
|
+
);
|
|
60
62
|
const olres = await ollama.embeddings({
|
|
61
63
|
model: opts?.model || config.embed_model || config.model,
|
|
62
64
|
prompt: opts.prompt,
|
|
@@ -106,7 +108,9 @@ const getCompletion = async (config, opts) => {
|
|
|
106
108
|
|
|
107
109
|
const { Ollama } = ollamaMod;
|
|
108
110
|
|
|
109
|
-
const ollama = new Ollama(
|
|
111
|
+
const ollama = new Ollama(
|
|
112
|
+
config.ollama_host ? { host: config.ollama_host } : undefined
|
|
113
|
+
);
|
|
110
114
|
const olres = await ollama.generate({
|
|
111
115
|
model: opts?.model || config.model,
|
|
112
116
|
...opts,
|
package/index.js
CHANGED
|
@@ -65,6 +65,13 @@ ${domReady(`
|
|
|
65
65
|
onChange: "backendChange(this)",
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
|
+
{
|
|
69
|
+
name: "ollama_host",
|
|
70
|
+
label: "Host",
|
|
71
|
+
sublabel: "Optional, for remote ollama server",
|
|
72
|
+
type: "String",
|
|
73
|
+
showIf: { backend: "Local Ollama" },
|
|
74
|
+
},
|
|
68
75
|
{
|
|
69
76
|
name: "client_id",
|
|
70
77
|
label: "Client ID",
|