This commit is contained in:
Paul Gauthier 2025-01-28 09:27:40 -08:00
parent ae7d4592e1
commit a0ba140895

View file

@ -45,6 +45,16 @@ setx OLLAMA_API_KEY <api-key> # Windows, restart shell after setx
[Ollama uses a 2k context window by default](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size),
which is very small for working with aider.
Unlike most other LLM servers, Ollama does not throw an error if you submit
a request that exceeds the context window.
Instead, it just silently truncates the request by discarding the "oldest" messages
in the chat to make it fit within the context window.
So if your context window is too small, you won't get an explicit error.
The biggest symptom will be that aider says it can't see (some of) the files
you added to the chat.
That's because ollama is silently discarding them because they exceed the context window.
Aider sets Ollama's context window to 8k by default.
If you would like
a larger context window
@ -58,11 +68,3 @@ like this:
num_ctx: 8192
```
Unlike most other LLM servers, Ollama does not throw an error if you submit
a request that exceeds the context window.
Instead, it just silently truncates the request by discarding the "oldest" messages
in the chat to make it fit within the context window.
So if your context window is too small, you won't get an error.
Aider will probably just fail to work well and experience
a lot of
[file editing problems](https://aider.chat/docs/troubleshooting/edit-errors.html).