mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-08 13:44:59 +00:00
feat: Add Ollama model context size configuration in model settings
This commit is contained in:
parent
a14dee5b8d
commit
6725c9e3cd
1 changed files with 5 additions and 2 deletions
|
@ -257,6 +257,11 @@ class Model(ModelSettings):
|
||||||
if not exact_match:
|
if not exact_match:
|
||||||
self.apply_generic_model_settings(model)
|
self.apply_generic_model_settings(model)
|
||||||
|
|
||||||
|
if model.startswith("ollama/") or model.startswith("ollama_chat/"): # and num_ctx isn't already set ai!
|
||||||
|
self.extra_params = dict(num_ctx=8 * 1024)
|
||||||
|
dump(self.extra_params)
|
||||||
|
|
||||||
|
|
||||||
# Apply override settings last if they exist
|
# Apply override settings last if they exist
|
||||||
if self.extra_model_settings and self.extra_model_settings.extra_params:
|
if self.extra_model_settings and self.extra_model_settings.extra_params:
|
||||||
# Initialize extra_params if it doesn't exist
|
# Initialize extra_params if it doesn't exist
|
||||||
|
@ -357,8 +362,6 @@ class Model(ModelSettings):
|
||||||
self.edit_format = "diff"
|
self.edit_format = "diff"
|
||||||
self.editor_edit_format = "editor-diff"
|
self.editor_edit_format = "editor-diff"
|
||||||
self.use_repo_map = True
|
self.use_repo_map = True
|
||||||
if model.startswith("ollama/") or model.startswith("ollama_chat/"):
|
|
||||||
self.extra_params = dict(num_ctx=8 * 1024)
|
|
||||||
return # <--
|
return # <--
|
||||||
|
|
||||||
# use the defaults
|
# use the defaults
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue