Skip to content

Commit 1aab875

Browse files
authored
Merge pull request #1637 from Octoslav/doc/ollama
doc: Add info about ollama context length
2 parents ad17cb4 + dde362b commit 1aab875

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/docs/usage-guide/changing_a_model.md

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ duplicate_examples=true # will duplicate the examples in the prompt, to help the
5454
api_base = "http://localhost:11434" # or whatever port you're running Ollama on
5555
```
5656

57+
By default, Ollama uses a context window size of 2048 tokens. In most cases this is not enough to cover pr-agent promt and pull-request diff. Context window size can be overridden with the `OLLAMA_CONTEXT_LENGTH` environment variable. For example, to set the default context length to 8K, use: `OLLAMA_CONTEXT_LENGTH=8192 ollama serve`. More information you can find on the [official ollama faq](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size).
58+
59+
Please note that the `custom_model_max_tokens` setting should be configured in accordance with the `OLLAMA_CONTEXT_LENGTH`. Failure to do so may result in unexpected model output.
60+
5761
!!! note "Local models vs commercial models"
5862
Qodo Merge is compatible with almost any AI model, but analyzing complex code repositories and pull requests requires a model specifically optimized for code analysis.
5963

0 commit comments

Comments
 (0)