Skip to content

Commit ae3325d

Browse files
committed
allow user overriden context length for ollama provider
1 parent 4c873ec commit ae3325d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/llm/llms/Ollama.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class Ollama extends BaseLLM {
5050
let value = parts[2];
5151
switch (key) {
5252
case "num_ctx":
53-
this.contextLength = Number.parseInt(value);
53+
this.contextLength =
54+
options.contextLength ?? Number.parseInt(value);
5455
break;
5556
case "stop":
5657
if (!this.completionOptions.stop) {

0 commit comments

Comments
 (0)