From a5c283d7c83c08004b9eb14a33101a2b9d46837d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 26 Aug 2024 16:33:25 -0700 Subject: [PATCH] feat: Add prompt cache warming via `--cache-warming-pings` --- HISTORY.md | 1 + aider/args.py | 2 +- aider/website/HISTORY.md | 1 + aider/website/assets/sample.aider.conf.yml | 2 +- aider/website/assets/sample.env | 2 +- aider/website/docs/config/aider_conf.md | 2 +- aider/website/docs/config/dotenv.md | 2 +- aider/website/docs/config/options.md | 2 +- tests/basic/test_main.py | 4 ++-- 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 23ffd3be6..a8a38c728 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,7 @@ ### main branch +- Prompt cache warming, via `--cache-warming-pings`. - You can now bulk accept/reject a series of add url and run shell confirmations. - Improved matching of filenames from S/R blocks with files in chat. - Stronger prompting for Sonnet to make edits in code chat mode. diff --git a/aider/args.py b/aider/args.py index 1341fda02..53b2dffb4 100644 --- a/aider/args.py +++ b/aider/args.py @@ -217,7 +217,7 @@ def get_parser(default_config_files, git_root): "--cache-warming-pings", type=int, default=0, - help="Number of pings to warm up the cache (default: 0)", + help="Number of times to ping every 5min to keep prompt cache warm (default: 0)", ) group.add_argument( "--map-multiplier-no-files", diff --git a/aider/website/HISTORY.md b/aider/website/HISTORY.md index 5904edd2a..59cb9b6f1 100644 --- a/aider/website/HISTORY.md +++ b/aider/website/HISTORY.md @@ -18,6 +18,7 @@ cog.out(text) ### main branch +- Prompt cache warming, via `--cache-warming-pings`. - You can now bulk accept/reject a series of add url and run shell confirmations. - Improved matching of filenames from S/R blocks with files in chat. - Stronger prompting for Sonnet to make edits in code chat mode. diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index e64eec2af..3a3310473 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -98,7 +98,7 @@ ## Enable caching of prompts (default: False) #cache-prompts: false -## Number of pings to warm up the cache (default: 0) +## Number of times to ping every 5min to keep prompt cache warm (default: 0) #cache-warming-pings: false ## Multiplier for map tokens when no files are specified (default: 2) diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index a0a9a9842..52edfd4b5 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -102,7 +102,7 @@ ## Enable caching of prompts (default: False) #AIDER_CACHE_PROMPTS=false -## Number of pings to warm up the cache (default: 0) +## Number of times to ping every 5min to keep prompt cache warm (default: 0) #AIDER_CACHE_WARMING_PINGS=false ## Multiplier for map tokens when no files are specified (default: 2) diff --git a/aider/website/docs/config/aider_conf.md b/aider/website/docs/config/aider_conf.md index 07267ca02..1cc666f2c 100644 --- a/aider/website/docs/config/aider_conf.md +++ b/aider/website/docs/config/aider_conf.md @@ -137,7 +137,7 @@ cog.outl("```") ## Enable caching of prompts (default: False) #cache-prompts: false -## Number of pings to warm up the cache (default: 0) +## Number of times to ping every 5min to keep prompt cache warm (default: 0) #cache-warming-pings: false ## Multiplier for map tokens when no files are specified (default: 2) diff --git a/aider/website/docs/config/dotenv.md b/aider/website/docs/config/dotenv.md index f8fcf29f2..b154a77bd 100644 --- a/aider/website/docs/config/dotenv.md +++ b/aider/website/docs/config/dotenv.md @@ -144,7 +144,7 @@ cog.outl("```") ## Enable caching of prompts (default: False) #AIDER_CACHE_PROMPTS=false -## Number of pings to warm up the cache (default: 0) +## Number of times to ping every 5min to keep prompt cache warm (default: 0) #AIDER_CACHE_WARMING_PINGS=false ## Multiplier for map tokens when no files are specified (default: 2) diff --git a/aider/website/docs/config/options.md b/aider/website/docs/config/options.md index 001e97f4b..60b76ad5a 100644 --- a/aider/website/docs/config/options.md +++ b/aider/website/docs/config/options.md @@ -206,7 +206,7 @@ Aliases: - `--no-cache-prompts` ### `--cache-warming-pings VALUE` -Number of pings to warm up the cache (default: 0) +Number of times to ping every 5min to keep prompt cache warm (default: 0) Default: 0 Environment variable: `AIDER_CACHE_WARMING_PINGS` diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 2c160055f..09ce68a82 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -524,7 +524,7 @@ class TestMain(TestCase): MockRepoMap.return_value = mock_repo_map main( - ["--sonnet", "--cache", "--exit", "--yes"], + ["--sonnet", "--cache-prompts", "--exit", "--yes"], input=DummyInput(), output=DummyOutput(), ) @@ -549,7 +549,7 @@ class TestMain(TestCase): def test_4o_and_cache_options(self): with GitTemporaryDirectory(): coder = main( - ["--4o", "--cache", "--exit", "--yes"], + ["--4o", "--cache-prompts", "--exit", "--yes"], input=DummyInput(), output=DummyOutput(), return_coder=True,