From 8ca81d09914fe76a2f024e90937edff1bcc66f9a Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 26 Jan 2025 18:50:12 -0800 Subject: [PATCH] fix: handle missing extra_params attribute in Ollama model --- aider/coders/base_coder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 5cca1faf4..ab8d4f6bf 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1247,7 +1247,8 @@ class Coder: # Special warning for Ollama models about context window size if self.main_model.name.startswith(("ollama/", "ollama_chat/")): - num_ctx = self.main_model.extra_params.get("num_ctx") + extra_params = getattr(self.main_model, "extra_params", None) or {} + num_ctx = extra_params.get("num_ctx") if num_ctx: self.io.tool_error( f"\nNote: Your Ollama model is configured with num_ctx={num_ctx}. See"