garriga 1.0.6 → 1.0.8
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/index.js +19 -18
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -209,29 +209,30 @@ class localLLM {
|
|
|
209
209
|
userToken,
|
|
210
210
|
source = process.env.LOCALMODEL || "mistral7b-genei:latest",
|
|
211
211
|
) {
|
|
212
|
+
console.log(
|
|
213
|
+
`garriga, llamando al LLm local, modelo ${source} ya que process.env.LOCALMODEL es ${process.env.LOCALMODEL}`,
|
|
214
|
+
);
|
|
215
|
+
|
|
212
216
|
if (userToken === "modeloLocalOllama") {
|
|
213
217
|
try {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
stream: false,
|
|
220
|
-
format: "json",
|
|
218
|
+
const ollamaPayload = {
|
|
219
|
+
prompt,
|
|
220
|
+
model: source,
|
|
221
|
+
stream: false,
|
|
222
|
+
format: "json",
|
|
221
223
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
},
|
|
224
|
+
keep_alive: -1,
|
|
225
|
+
options: {
|
|
226
|
+
num_ctx: 65536,
|
|
227
|
+
temperature: 0.1,
|
|
228
|
+
num_predict: 2500,
|
|
228
229
|
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
};
|
|
231
|
+
const response = await axios.post(this.apiUrlOllama, ollamaPayload, {
|
|
232
|
+
headers: {
|
|
233
|
+
"Content-Type": "application/json",
|
|
233
234
|
},
|
|
234
|
-
);
|
|
235
|
+
});
|
|
235
236
|
|
|
236
237
|
return response?.data.response;
|
|
237
238
|
} catch (error) {
|