From ae3325d0de9080c75c2cef6cc42d8ff7f76f09b2 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 13 Aug 2024 17:19:27 -0700 Subject: [PATCH] allow user overriden context length for ollama provider --- core/llm/llms/Ollama.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index fe5ab7f55..fcce902c8 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -50,7 +50,8 @@ class Ollama extends BaseLLM { let value = parts[2]; switch (key) { case "num_ctx": - this.contextLength = Number.parseInt(value); + this.contextLength = + options.contextLength ?? Number.parseInt(value); break; case "stop": if (!this.completionOptions.stop) {