From 5755aa3eb8802c0bfd195037b46baf74275fef9d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 4 Feb 2025 16:34:07 -0800 Subject: [PATCH] feat: Improve model metadata handling and startup performance --- HISTORY.md | 1 + tests/basic/test_main.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 7d6ad90c9..55ebf671e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,7 @@ ### main branch +- Fast startup with more providers and when model metadata provided in local files. - Removes `` tags from R1 responses for commit messages (and other weak model uses). - Now dynamically sets `num_ctx` for Ollama, to ensure the context window can hold the chat. - Watch files now fully ignores top-level directories, to reduce the chance of hitting OS limits on number of watched files. Helpful to ignore giant subtrees like `node_modules`. diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 53f72830d..3374b1323 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -522,9 +522,15 @@ class TestMain(TestCase): os.unlink(external_file_path) def test_model_metadata_file(self): - from aider.models import model_info_manager + # Re-init so we don't have old data lying around from earlier test cases + from aider import models + + models.model_info_manager = models.ModelInfoManager() + + from aider.llm import litellm + + litellm._lazy_module = None - model_info_manager.local_model_metadata = {} with GitTemporaryDirectory(): metadata_file = Path(".aider.model.metadata.json")