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) {