|
@@ -117,7 +117,11 @@ export function createChatModel(providerConfig: ProviderConfig, modelConfig: Mod
|
|
topP,
|
|
topP,
|
|
temperature,
|
|
temperature,
|
|
maxTokens,
|
|
maxTokens,
|
|
- numCtx: 128000,
|
|
|
|
|
|
+ // ollama usually has a very small context window, so we need to set a large number for agent to work
|
|
|
|
+ // It was set to 128000 in the original code, but it will cause ollama reload the models frequently if you have multiple models working together
|
|
|
|
+ // not sure why, but setting it to 64000 seems to work fine
|
|
|
|
+ // TODO: configure the context window size in model config
|
|
|
|
+ numCtx: 64000,
|
|
};
|
|
};
|
|
return new ChatOllama(args);
|
|
return new ChatOllama(args);
|
|
}
|
|
}
|