From dec65132e74ed4625545da4678fab1ee5da1ffec Mon Sep 17 00:00:00 2001 From: Patryk Wegrzyn Date: Thu, 7 Nov 2024 23:51:12 +0000 Subject: [PATCH] Set numCtx = 32768 for Ollama models --- app/lib/.server/llm/model.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/lib/.server/llm/model.ts b/app/lib/.server/llm/model.ts index 6d48171..b3a208b 100644 --- a/app/lib/.server/llm/model.ts +++ b/app/lib/.server/llm/model.ts @@ -58,7 +58,10 @@ export function getGroqModel(apiKey: string, model: string) { } export function getOllamaModel(baseURL: string, model: string) { - let Ollama = ollama(model); + let Ollama = ollama(model, { + numCtx: 32768, + }); + Ollama.config.baseURL = `${baseURL}/api`; return Ollama; }