From 470513695188ccd801eda0c90398eb99624cb78e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 27 Aug 2024 06:12:48 -0700 Subject: [PATCH] fix: Add caching by default for deepseek coder. --- aider/coders/base_coder.py | 2 +- aider/models.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 76589372b..25e7a7a95 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -173,7 +173,7 @@ class Coder: prefix = "Model" output = f"{prefix}: {main_model.name} with {self.edit_format} edit format" - if self.add_cache_headers: + if self.add_cache_headers or main_model.caches_by_default: output += ", prompt cache" if main_model.info.get("supports_assistant_prefill"): output += ", infinite output" diff --git a/aider/models.py b/aider/models.py index cc62403b0..dd369bccf 100644 --- a/aider/models.py +++ b/aider/models.py @@ -75,6 +75,7 @@ class ModelSettings: extra_headers: Optional[dict] = None max_tokens: Optional[int] = None cache_control: bool = False + caches_by_default: bool = False # https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo @@ -400,6 +401,7 @@ MODEL_SETTINGS = [ send_undo_reply=True, examples_as_sys_msg=True, reminder="sys", + caches_by_default=True, ), ModelSettings( "openrouter/deepseek/deepseek-coder",