node-red-contrib-ollama 0.2.0 → 0.2.2
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/nodes/ollama-abort.html +22 -6
- package/nodes/ollama-abort.js +7 -1
- package/nodes/ollama-chat.html +214 -275
- package/nodes/ollama-chat.js +13 -9
- package/nodes/ollama-config-server.html +24 -0
- package/nodes/ollama-config-server.js +10 -0
- package/nodes/ollama-copy.html +29 -16
- package/nodes/ollama-copy.js +9 -1
- package/nodes/ollama-create.html +41 -32
- package/nodes/ollama-create.js +5 -1
- package/nodes/ollama-delete.html +26 -11
- package/nodes/ollama-delete.js +8 -1
- package/nodes/ollama-embed.html +167 -216
- package/nodes/ollama-embed.js +5 -1
- package/nodes/ollama-generate.html +79 -84
- package/nodes/ollama-generate.js +5 -1
- package/nodes/ollama-list.html +23 -6
- package/nodes/ollama-list.js +7 -1
- package/nodes/ollama-ps.html +23 -6
- package/nodes/ollama-ps.js +7 -1
- package/nodes/ollama-pull.html +37 -26
- package/nodes/ollama-pull.js +10 -1
- package/nodes/ollama-push.html +37 -26
- package/nodes/ollama-push.js +10 -1
- package/nodes/ollama-show.html +36 -27
- package/nodes/ollama-show.js +5 -1
- package/package.json +4 -3
package/nodes/ollama-abort.html
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
category: 'AI',
|
|
4
4
|
color: 'rgb(186 230 253)',
|
|
5
5
|
defaults: {
|
|
6
|
-
name: { value: '' },
|
|
6
|
+
name: { value: 'Ollama Abort' },
|
|
7
|
+
server: { value: '', type: 'ollama-config-server', required: false }
|
|
7
8
|
},
|
|
8
9
|
inputs: 1,
|
|
9
10
|
outputs: 1,
|
|
@@ -19,6 +20,11 @@
|
|
|
19
20
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
20
21
|
<input type="text" id="node-input-name" placeholder="Name" />
|
|
21
22
|
</div>
|
|
23
|
+
|
|
24
|
+
<div class="form-row">
|
|
25
|
+
<label for="node-input-server"><i class="fa fa-server"></i> Server</label>
|
|
26
|
+
<input type="text" id="node-input-server" />
|
|
27
|
+
</div>
|
|
22
28
|
</script>
|
|
23
29
|
|
|
24
30
|
<script type="text/html" data-help-name="ollama-abort">
|
|
@@ -27,11 +33,21 @@
|
|
|
27
33
|
<h3>Inputs</h3>
|
|
28
34
|
|
|
29
35
|
<dl class="message-properties">
|
|
30
|
-
<dt>
|
|
31
|
-
payload
|
|
32
|
-
|
|
33
|
-
<span class="property-type">string</span>
|
|
36
|
+
<dt class="optional">
|
|
37
|
+
payload <span class="property-type">object</span>
|
|
34
38
|
</dt>
|
|
35
|
-
<dd>
|
|
39
|
+
<dd>
|
|
40
|
+
The payload object.
|
|
41
|
+
|
|
42
|
+
<dl class="message-properties">
|
|
43
|
+
<dt class="optional">
|
|
44
|
+
payload.host <span class="property-type">string</span>
|
|
45
|
+
</dt>
|
|
46
|
+
<dd>
|
|
47
|
+
The host of the Ollama instance.<br />
|
|
48
|
+
<em>Alternative to the <code>Server</code> field.</em>
|
|
49
|
+
</dd>
|
|
50
|
+
</dl>
|
|
51
|
+
</dd>
|
|
36
52
|
</dl>
|
|
37
53
|
</script>
|
package/nodes/ollama-abort.js
CHANGED
|
@@ -6,7 +6,13 @@ module.exports = function( RED ) {
|
|
|
6
6
|
const node = this
|
|
7
7
|
|
|
8
8
|
node.on( 'input', async function( msg ) {
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
host: payloadHost
|
|
11
|
+
} = msg.payload
|
|
12
|
+
|
|
13
|
+
const server = RED.nodes.getNode( config.server )
|
|
14
|
+
|
|
15
|
+
const host = ( server ) ? server.host + ':' + server.port : payloadHost
|
|
10
16
|
|
|
11
17
|
const ollama = new Ollama( { host } )
|
|
12
18
|
|
package/nodes/ollama-chat.html
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
category: 'AI',
|
|
4
4
|
color: 'rgb(186 230 253)',
|
|
5
5
|
defaults: {
|
|
6
|
-
name: { value: '' }
|
|
6
|
+
name: { value: 'Ollama Chat' },
|
|
7
|
+
server: { value: '', type: 'ollama-config-server', required: false }
|
|
7
8
|
},
|
|
8
9
|
inputs: 1,
|
|
9
10
|
outputs: 1,
|
|
@@ -17,7 +18,12 @@
|
|
|
17
18
|
<script type="text/html" data-template-name="ollama-chat">
|
|
18
19
|
<div class="form-row">
|
|
19
20
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
20
|
-
<input type="text" id="node-input-name" placeholder="Name" />
|
|
21
|
+
<input type="text" id="node-input-name" placeholder="Node Name" />
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="form-row">
|
|
25
|
+
<label for="node-input-server"><i class="fa fa-server"></i> Server</label>
|
|
26
|
+
<input type="text" id="node-input-server" />
|
|
21
27
|
</div>
|
|
22
28
|
</script>
|
|
23
29
|
|
|
@@ -27,299 +33,232 @@
|
|
|
27
33
|
<h3>Inputs</h3>
|
|
28
34
|
|
|
29
35
|
<dl class="message-properties">
|
|
30
|
-
<dt>
|
|
31
|
-
payload.host
|
|
32
|
-
|
|
33
|
-
<span class="property-type">string</span>
|
|
34
|
-
</dt>
|
|
35
|
-
<dd>The host of the Ollama instance.</dd>
|
|
36
|
-
|
|
37
|
-
<dt>
|
|
38
|
-
payload.model
|
|
39
|
-
|
|
40
|
-
<span class="property-type">string</span>
|
|
41
|
-
</dt>
|
|
42
|
-
<dd>The model to use for generating the next message.</dd>
|
|
43
|
-
|
|
44
|
-
<dt>
|
|
45
|
-
payload.messages
|
|
46
|
-
|
|
47
|
-
<span class="property-type">array</span>
|
|
48
|
-
</dt>
|
|
49
|
-
<dd>
|
|
50
|
-
The chat history to use for generating the next message.<br />
|
|
51
|
-
|
|
52
|
-
<h4>Message</h4>
|
|
53
|
-
<dl class="message-properties">
|
|
54
|
-
<dt>
|
|
55
|
-
role
|
|
56
|
-
|
|
57
|
-
<span class="property-type">string</span>
|
|
58
|
-
</dt>
|
|
59
|
-
<dd>The role of the message sender ('user', 'system', or 'assistant').</dd>
|
|
60
|
-
|
|
61
|
-
<dt>
|
|
62
|
-
content
|
|
63
|
-
|
|
64
|
-
<span class="property-type">string</span>
|
|
65
|
-
</dt>
|
|
66
|
-
<dd>The content of the message.</dd>
|
|
67
|
-
|
|
68
|
-
<dt>
|
|
69
|
-
images
|
|
70
|
-
|
|
71
|
-
<span class="property-type">array</span>
|
|
72
|
-
</dt>
|
|
73
|
-
<dd>The images attached to the message, either as Uint8Array or base64 encoded strings.</dd>
|
|
74
|
-
|
|
75
|
-
<dt>
|
|
76
|
-
tool_calls
|
|
77
|
-
|
|
78
|
-
<span class="property-type">array</span>
|
|
79
|
-
</dt>
|
|
80
|
-
<dd>A list of tools the model wants to use.</dd>
|
|
81
|
-
</dl>
|
|
82
|
-
</dd>
|
|
83
|
-
|
|
84
|
-
<dt class="optional">
|
|
85
|
-
payload.format
|
|
86
|
-
|
|
87
|
-
<span class="property-type">string</span>
|
|
88
|
-
</dt>
|
|
89
|
-
<dd>The format of the response (only <code>json</code> for now).</dd>
|
|
90
|
-
|
|
91
36
|
<dt class="optional">
|
|
92
|
-
payload
|
|
93
|
-
|
|
94
|
-
<span class="property-type">boolean</span>
|
|
95
|
-
</dt>
|
|
96
|
-
<dd>When true an AsyncGenerator is returned.</dd>
|
|
97
|
-
|
|
98
|
-
<dt class="optional">
|
|
99
|
-
payload.keep_alive
|
|
100
|
-
|
|
101
|
-
<span class="property-type">array</span>
|
|
102
|
-
</dt>
|
|
103
|
-
<dd>How long to keep the model loaded.</dd>
|
|
104
|
-
|
|
105
|
-
<dt class="optional">
|
|
106
|
-
payload.tools
|
|
107
|
-
|
|
108
|
-
<span class="property-type">array</span>
|
|
37
|
+
payload <span class="property-type">object</span>
|
|
109
38
|
</dt>
|
|
110
|
-
<dd>
|
|
111
|
-
Tools for the model to use if supported.<br />
|
|
112
|
-
Requires <code>stream</code> to be set to <code>false</code>.
|
|
113
|
-
|
|
114
|
-
<p>
|
|
115
|
-
For more information, see the Ollama API documentation:<br />
|
|
116
|
-
<a href="https://github.com/ollama/ollama/blob/main/docs/api.md#chat-request-with-tools" target="_blank">Chat request with tools</a>
|
|
117
|
-
</p>
|
|
118
|
-
</dd>
|
|
119
39
|
|
|
120
|
-
<dt class="optional">
|
|
121
|
-
payload.options
|
|
122
|
-
|
|
123
|
-
<span class="property-type">object</span>
|
|
124
|
-
</dt>
|
|
125
40
|
<dd>
|
|
126
|
-
|
|
41
|
+
The payload object.
|
|
127
42
|
|
|
128
|
-
<h4>Options</h4>
|
|
129
43
|
<dl class="message-properties">
|
|
130
|
-
<dt>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<span class="property-type">boolean</span>
|
|
44
|
+
<dt class="optional">
|
|
45
|
+
payload.host <span class="property-type">string</span>
|
|
134
46
|
</dt>
|
|
135
|
-
<dd>
|
|
47
|
+
<dd>
|
|
48
|
+
The host of the Ollama instance.<br />
|
|
49
|
+
<em>Alternative to the <code>Server</code> field.</em>
|
|
50
|
+
</dd>
|
|
136
51
|
|
|
137
52
|
<dt>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<span class="property-type">number</span>
|
|
53
|
+
payload.model <span class="property-type">string</span>
|
|
141
54
|
</dt>
|
|
142
|
-
<dd>The
|
|
55
|
+
<dd>The model to use for generating the next message.</dd>
|
|
143
56
|
|
|
144
57
|
<dt>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<span class="property-type">number</span>
|
|
58
|
+
payload.messages <span class="property-type">array</span>
|
|
148
59
|
</dt>
|
|
149
|
-
<dd>
|
|
60
|
+
<dd>
|
|
61
|
+
The chat history to use for generating the next message.<br />
|
|
150
62
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
<dt>
|
|
159
|
-
low_vram
|
|
63
|
+
<h4>Message</h4>
|
|
64
|
+
<dl class="message-properties">
|
|
65
|
+
<dt>
|
|
66
|
+
role <span class="property-type">string</span>
|
|
67
|
+
</dt>
|
|
68
|
+
<dd>The role of the message sender ('user', 'system', or 'assistant').</dd>
|
|
160
69
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
70
|
+
<dt>
|
|
71
|
+
content <span class="property-type">string</span>
|
|
72
|
+
</dt>
|
|
73
|
+
<dd>The content of the message.</dd>
|
|
164
74
|
|
|
165
|
-
|
|
166
|
-
|
|
75
|
+
<dt>
|
|
76
|
+
images <span class="property-type">array</span>
|
|
77
|
+
</dt>
|
|
78
|
+
<dd>The images attached to the message, either as Uint8Array or base64 encoded strings.</dd>
|
|
167
79
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
80
|
+
<dt>
|
|
81
|
+
tool_calls <span class="property-type">array</span>
|
|
82
|
+
</dt>
|
|
83
|
+
<dd>A list of tools the model wants to use.</dd>
|
|
84
|
+
</dl>
|
|
85
|
+
</dd>
|
|
174
86
|
|
|
175
|
-
|
|
87
|
+
<dt class="optional">
|
|
88
|
+
payload.format <span class="property-type">string</span>
|
|
176
89
|
</dt>
|
|
177
|
-
<dd>
|
|
178
|
-
|
|
179
|
-
<dt>
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
<span class="property-type">boolean</span>
|
|
183
|
-
</dt>
|
|
184
|
-
<dd>Return only the vocabulary.</dd>
|
|
185
|
-
|
|
186
|
-
<dt>
|
|
187
|
-
use_nmap
|
|
188
|
-
|
|
189
|
-
<span class="property-type">boolean</span>
|
|
190
|
-
</dt>
|
|
191
|
-
<dd>Use NMAP.</dd>
|
|
192
|
-
|
|
193
|
-
<dt>
|
|
194
|
-
use_mlock
|
|
195
|
-
|
|
196
|
-
<span class="property-type">boolean</span>
|
|
197
|
-
</dt>
|
|
198
|
-
<dd>Use mlock.</dd>
|
|
199
|
-
|
|
200
|
-
<dt>
|
|
201
|
-
embedding_only
|
|
202
|
-
|
|
203
|
-
<span class="property-type">boolean</span>
|
|
204
|
-
</dt>
|
|
205
|
-
<dd>Return only the embeddings.</dd>
|
|
206
|
-
|
|
207
|
-
<dt>
|
|
208
|
-
num_thread
|
|
209
|
-
|
|
210
|
-
<span class="property-type">number</span>
|
|
211
|
-
</dt>
|
|
212
|
-
<dd>The number of threads to use.</dd>
|
|
213
|
-
|
|
214
|
-
<dt>
|
|
215
|
-
num_keep
|
|
216
|
-
|
|
217
|
-
<span class="property-type">number</span>
|
|
218
|
-
</dt>
|
|
219
|
-
<dd>The number of models to keep.</dd>
|
|
220
|
-
|
|
221
|
-
<dt>
|
|
222
|
-
seed
|
|
223
|
-
|
|
224
|
-
<span class="property-type">number</span>
|
|
225
|
-
</dt>
|
|
226
|
-
<dd>The seed to use.</dd>
|
|
227
|
-
|
|
228
|
-
<dt>
|
|
229
|
-
num_predict
|
|
230
|
-
|
|
231
|
-
<span class="property-type">number</span>
|
|
232
|
-
</dt>
|
|
233
|
-
<dd>The number of predictions to use.</dd>
|
|
234
|
-
|
|
235
|
-
<dt>
|
|
236
|
-
top_k
|
|
237
|
-
|
|
238
|
-
<span class="property-type">number</span>
|
|
239
|
-
</dt>
|
|
240
|
-
<dd>The top k to use.</dd>
|
|
241
|
-
|
|
242
|
-
<dt>
|
|
243
|
-
top_p
|
|
244
|
-
|
|
245
|
-
<span class="property-type">number</span>
|
|
246
|
-
</dt>
|
|
247
|
-
<dd>The top p to use.</dd>
|
|
248
|
-
|
|
249
|
-
<dt>
|
|
250
|
-
typical_p
|
|
251
|
-
|
|
252
|
-
<span class="property-type">number</span>
|
|
253
|
-
</dt>
|
|
254
|
-
<dd>The typical p to use.</dd>
|
|
255
|
-
|
|
256
|
-
<dt>
|
|
257
|
-
repeat_last_n
|
|
258
|
-
|
|
259
|
-
<span class="property-type">number</span>
|
|
260
|
-
</dt>
|
|
261
|
-
<dd>The repeat last n to use.</dd>
|
|
262
|
-
|
|
263
|
-
<dt>
|
|
264
|
-
temperature
|
|
265
|
-
|
|
266
|
-
<span class="property-type">number</span>
|
|
267
|
-
</dt>
|
|
268
|
-
<dd>The temperature to use.</dd>
|
|
269
|
-
|
|
270
|
-
<dt>
|
|
271
|
-
repeat_pentalty
|
|
272
|
-
|
|
273
|
-
<span class="property-type">number</span>
|
|
274
|
-
</dt>
|
|
275
|
-
<dd>The repeat pentalty to use.</dd>
|
|
276
|
-
|
|
277
|
-
<dt>
|
|
278
|
-
presence_penalty
|
|
279
|
-
|
|
280
|
-
<span class="property-type">number</span>
|
|
281
|
-
</dt>
|
|
282
|
-
<dd>The presence penalty to use.</dd>
|
|
283
|
-
|
|
284
|
-
<dt>
|
|
285
|
-
frequency_penalty
|
|
286
|
-
|
|
287
|
-
<span class="property-type">number</span>
|
|
288
|
-
</dt>
|
|
289
|
-
<dd>The frequency penalty to use.</dd>
|
|
290
|
-
|
|
291
|
-
<dt>
|
|
292
|
-
mirostat
|
|
293
|
-
|
|
294
|
-
<span class="property-type">boolean</span>
|
|
295
|
-
</dt>
|
|
296
|
-
<dd>Use mirostat.</dd>
|
|
297
|
-
|
|
298
|
-
<dt>
|
|
299
|
-
mirostat_tau
|
|
300
|
-
|
|
301
|
-
<span class="property-type">number</span>
|
|
302
|
-
</dt>
|
|
303
|
-
|
|
304
|
-
<dt>
|
|
305
|
-
mirostat_eta
|
|
306
|
-
|
|
307
|
-
<span class="property-type">number</span>
|
|
308
|
-
</dt>
|
|
309
|
-
|
|
310
|
-
<dt>
|
|
311
|
-
penalize_newline
|
|
312
|
-
|
|
313
|
-
<span class="property-type">boolean</span>
|
|
314
|
-
</dt>
|
|
315
|
-
<dd>Penalize newline.</dd>
|
|
316
|
-
|
|
317
|
-
<dt>
|
|
318
|
-
stop
|
|
319
|
-
|
|
320
|
-
<span class="property-type">array</span>
|
|
90
|
+
<dd>The format of the response (only <code>json</code> for now).</dd>
|
|
91
|
+
|
|
92
|
+
<dt class="optional">
|
|
93
|
+
payload.stream <span class="property-type">boolean</span>
|
|
321
94
|
</dt>
|
|
322
|
-
<dd>
|
|
95
|
+
<dd>When true an AsyncGenerator is returned.</dd>
|
|
96
|
+
|
|
97
|
+
<dt class="optional">
|
|
98
|
+
payload.keep_alive <span class="property-type">array</span>
|
|
99
|
+
</dt>
|
|
100
|
+
<dd>How long to keep the model loaded.</dd>
|
|
101
|
+
|
|
102
|
+
<dt class="optional">
|
|
103
|
+
payload.tools <span class="property-type">array</span>
|
|
104
|
+
</dt>
|
|
105
|
+
<dd>
|
|
106
|
+
Tools for the model to use if supported.<br />
|
|
107
|
+
Requires <code>stream</code> to be set to <code>false</code>.
|
|
108
|
+
|
|
109
|
+
<p>
|
|
110
|
+
For more information, see the Ollama API documentation:<br />
|
|
111
|
+
<a href="https://github.com/ollama/ollama/blob/main/docs/api.md#chat-request-with-tools" target="_blank">Chat request with tools</a>
|
|
112
|
+
</p>
|
|
113
|
+
</dd>
|
|
114
|
+
|
|
115
|
+
<dt class="optional">
|
|
116
|
+
payload.options <span class="property-type">object</span>
|
|
117
|
+
</dt>
|
|
118
|
+
<dd>
|
|
119
|
+
Options to configure the runtime.<br />
|
|
120
|
+
|
|
121
|
+
<h4>Options</h4>
|
|
122
|
+
<dl class="message-properties">
|
|
123
|
+
<dt>
|
|
124
|
+
numa <span class="property-type">boolean</span>
|
|
125
|
+
</dt>
|
|
126
|
+
<dd>Use NUMA for the runtime.</dd>
|
|
127
|
+
|
|
128
|
+
<dt>
|
|
129
|
+
num_ctx <span class="property-type">number</span>
|
|
130
|
+
</dt>
|
|
131
|
+
<dd>The number of contexts to use.</dd>
|
|
132
|
+
|
|
133
|
+
<dt>
|
|
134
|
+
num_batch <span class="property-type">number</span>
|
|
135
|
+
</dt>
|
|
136
|
+
<dd>The number of batches to use.</dd>
|
|
137
|
+
|
|
138
|
+
<dt>
|
|
139
|
+
main_gpu <span class="property-type">number</span>
|
|
140
|
+
</dt>
|
|
141
|
+
<dd>The main GPU to use.</dd>
|
|
142
|
+
|
|
143
|
+
<dt>
|
|
144
|
+
low_vram <span class="property-type">boolean</span>
|
|
145
|
+
</dt>
|
|
146
|
+
<dd>Use low VRAM.</dd>
|
|
147
|
+
|
|
148
|
+
<dt>
|
|
149
|
+
f16_kv <span class="property-type">boolean</span>
|
|
150
|
+
</dt>
|
|
151
|
+
<dd>Use f16 key-value.</dd>
|
|
152
|
+
|
|
153
|
+
<dt>
|
|
154
|
+
logits_all <span class="property-type">boolean</span>
|
|
155
|
+
</dt>
|
|
156
|
+
<dd>Return all logits.</dd>
|
|
157
|
+
|
|
158
|
+
<dt>
|
|
159
|
+
vocab_only <span class="property-type">boolean</span>
|
|
160
|
+
</dt>
|
|
161
|
+
<dd>Return only the vocabulary.</dd>
|
|
162
|
+
|
|
163
|
+
<dt>
|
|
164
|
+
use_nmap <span class="property-type">boolean</span>
|
|
165
|
+
</dt>
|
|
166
|
+
<dd>Use NMAP.</dd>
|
|
167
|
+
|
|
168
|
+
<dt>
|
|
169
|
+
use_mlock <span class="property-type">boolean</span>
|
|
170
|
+
</dt>
|
|
171
|
+
<dd>Use mlock.</dd>
|
|
172
|
+
|
|
173
|
+
<dt>
|
|
174
|
+
embedding_only <span class="property-type">boolean</span>
|
|
175
|
+
</dt>
|
|
176
|
+
<dd>Return only the embeddings.</dd>
|
|
177
|
+
|
|
178
|
+
<dt>
|
|
179
|
+
num_thread <span class="property-type">number</span>
|
|
180
|
+
</dt>
|
|
181
|
+
<dd>The number of threads to use.</dd>
|
|
182
|
+
|
|
183
|
+
<dt>
|
|
184
|
+
num_keep <span class="property-type">number</span>
|
|
185
|
+
</dt>
|
|
186
|
+
<dd>The number of models to keep.</dd>
|
|
187
|
+
|
|
188
|
+
<dt>
|
|
189
|
+
seed <span class="property-type">number</span>
|
|
190
|
+
</dt>
|
|
191
|
+
<dd>The seed to use.</dd>
|
|
192
|
+
|
|
193
|
+
<dt>
|
|
194
|
+
num_predict <span class="property-type">number</span>
|
|
195
|
+
</dt>
|
|
196
|
+
<dd>The number of predictions to use.</dd>
|
|
197
|
+
|
|
198
|
+
<dt>
|
|
199
|
+
top_k <span class="property-type">number</span>
|
|
200
|
+
</dt>
|
|
201
|
+
<dd>The top k to use.</dd>
|
|
202
|
+
|
|
203
|
+
<dt>
|
|
204
|
+
top_p <span class="property-type">number</span>
|
|
205
|
+
</dt>
|
|
206
|
+
<dd>The top p to use.</dd>
|
|
207
|
+
|
|
208
|
+
<dt>
|
|
209
|
+
typical_p <span class="property-type">number</span>
|
|
210
|
+
</dt>
|
|
211
|
+
<dd>The typical p to use.</dd>
|
|
212
|
+
|
|
213
|
+
<dt>
|
|
214
|
+
repeat_last_n <span class="property-type">number</span>
|
|
215
|
+
</dt>
|
|
216
|
+
<dd>The repeat last n to use.</dd>
|
|
217
|
+
|
|
218
|
+
<dt>
|
|
219
|
+
temperature <span class="property-type">number</span>
|
|
220
|
+
</dt>
|
|
221
|
+
<dd>The temperature to use.</dd>
|
|
222
|
+
|
|
223
|
+
<dt>
|
|
224
|
+
repeat_pentalty <span class="property-type">number</span>
|
|
225
|
+
</dt>
|
|
226
|
+
<dd>The repeat pentalty to use.</dd>
|
|
227
|
+
|
|
228
|
+
<dt>
|
|
229
|
+
presence_penalty <span class="property-type">number</span>
|
|
230
|
+
</dt>
|
|
231
|
+
<dd>The presence penalty to use.</dd>
|
|
232
|
+
|
|
233
|
+
<dt>
|
|
234
|
+
frequency_penalty <span class="property-type">number</span>
|
|
235
|
+
</dt>
|
|
236
|
+
<dd>The frequency penalty to use.</dd>
|
|
237
|
+
|
|
238
|
+
<dt>
|
|
239
|
+
mirostat <span class="property-type">boolean</span>
|
|
240
|
+
</dt>
|
|
241
|
+
<dd>Use mirostat.</dd>
|
|
242
|
+
|
|
243
|
+
<dt>
|
|
244
|
+
mirostat_tau <span class="property-type">number</span>
|
|
245
|
+
</dt>
|
|
246
|
+
|
|
247
|
+
<dt>
|
|
248
|
+
mirostat_eta <span class="property-type">number</span>
|
|
249
|
+
</dt>
|
|
250
|
+
|
|
251
|
+
<dt>
|
|
252
|
+
penalize_newline <span class="property-type">boolean</span>
|
|
253
|
+
</dt>
|
|
254
|
+
<dd>Penalize newline.</dd>
|
|
255
|
+
|
|
256
|
+
<dt>
|
|
257
|
+
stop <span class="property-type">array</span>
|
|
258
|
+
</dt>
|
|
259
|
+
<dd>The stop to use.</dd>
|
|
260
|
+
</dl>
|
|
261
|
+
</dd>
|
|
323
262
|
</dl>
|
|
324
263
|
</dd>
|
|
325
264
|
</dl>
|
package/nodes/ollama-chat.js
CHANGED
|
@@ -7,7 +7,7 @@ module.exports = function( RED ) {
|
|
|
7
7
|
|
|
8
8
|
node.on( 'input', async function( msg ) {
|
|
9
9
|
const {
|
|
10
|
-
host,
|
|
10
|
+
host: payloadHost,
|
|
11
11
|
model,
|
|
12
12
|
messages,
|
|
13
13
|
format,
|
|
@@ -17,17 +17,21 @@ module.exports = function( RED ) {
|
|
|
17
17
|
options
|
|
18
18
|
} = msg.payload
|
|
19
19
|
|
|
20
|
+
const server = RED.nodes.getNode( config.server )
|
|
21
|
+
|
|
22
|
+
const host = ( server ) ? server.host + ':' + server.port : payloadHost
|
|
23
|
+
|
|
20
24
|
const ollama = new Ollama( { host } )
|
|
21
25
|
|
|
22
26
|
const response = await ollama.chat( {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
model,
|
|
28
|
+
messages,
|
|
29
|
+
format,
|
|
30
|
+
stream,
|
|
31
|
+
keep_alive,
|
|
32
|
+
tools,
|
|
33
|
+
options
|
|
34
|
+
} )
|
|
31
35
|
.catch( error => {
|
|
32
36
|
node.error( error )
|
|
33
37
|
} )
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType( 'ollama-config-server', {
|
|
3
|
+
category: 'config',
|
|
4
|
+
defaults: {
|
|
5
|
+
host: { value: 'localhost', required: true },
|
|
6
|
+
port: { value: 11434, required: true, validate: RED.validators.number() }
|
|
7
|
+
},
|
|
8
|
+
label: function() {
|
|
9
|
+
return this.host + ':' + this.port;
|
|
10
|
+
}
|
|
11
|
+
} )
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script type="text/html" data-template-name="ollama-config-server">
|
|
15
|
+
<div class="form-row">
|
|
16
|
+
<label for="node-config-input-host"><i class="fa fa-server"></i> Host</label>
|
|
17
|
+
<input type="text" id="node-config-input-host" placeholder="localhost" />
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="form-row">
|
|
21
|
+
<label for="node-config-input-port"><i class="fa fa-port"></i> Port</label>
|
|
22
|
+
<input type="text" id="node-config-input-port" placeholder="11434" />
|
|
23
|
+
</div>
|
|
24
|
+
</script>
|