From 751955ceace9f81a0cbb5ce9d01e56acf4662a6f Mon Sep 17 00:00:00 2001 From: Mauricio Date: Tue, 11 Feb 2025 19:31:13 -0300 Subject: [PATCH] Update ollama.js use OLLAMA_HOST or a default host. --- ollama.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ollama.js b/ollama.js index 8ef2070..281647b 100644 --- a/ollama.js +++ b/ollama.js @@ -3,7 +3,8 @@ const ollama = { * send prompt to ai. */ sendMessage: async (input, { apiKey, model = 'mistral' }) => { - const url = "http://127.0.0.1:11434/api/chat"; + const host = process.env.OLLAMA_HOST || "http://127.0.0.1:11434" + const url = `${host}/api/chat`; const messages = [{ role: "user", content: input }]; const data = { model, stream: false, messages };