From 4fd02daad552ab3e348daeb6260ebab2bcb2552b Mon Sep 17 00:00:00 2001 From: Pavel Smagin Date: Wed, 22 Jan 2025 12:54:20 +0100 Subject: [PATCH] Fix: Add Bearer auth header when fetching ollama models --- core/llm/llms/Ollama.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index b9734acb9..77747a274 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -509,6 +509,10 @@ class Ollama extends BaseLLM { this.getEndpoint("api/tags"), { method: "GET", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${this.apiKey}`, + }, }, ); const data = await response.json();