DSPy: The framework for programming—not prompting—language models
Python
Expand default cache limit to 30GB (#1850)
Omar Khattab1b9b280f6b45
diff --git a/dspy/clients/__init__.py b/dspy/clients/__init__.pyindex 2fc0e2543..de2e76f3c 100644--- a/dspy/clients/__init__.py+++ b/dspy/clients/__init__.py@@ -8,8 +8,15 @@ from pathlib import Pathfrom litellm.caching import CacheDISK_CACHE_DIR = os.environ.get("DSPY_CACHEDIR") or os.path.join(Path.home(), ".dspy_cache")+DISK_CACHE_LIMIT = int(os.environ.get("DSPY_CACHE_LIMIT", 3e10)) # 30 GB default++# TODO: There's probably value in getting litellm to support FanoutCache and to separate the limit for+# the LM cache from the embeddings cache. Then we can lower the default 30GB limit.litellm.cache = Cache(disk_cache_dir=DISK_CACHE_DIR, type="disk")+litellm.cache.cache.disk_cache.reset('size_limit', DISK_CACHE_LIMIT)+litellm.telemetry = False+# Turn off by default to avoid LiteLLM logging during every LM call.litellm.suppress_debug_info = True