dspy.configure_cache
dspy.configure_cache(enable_disk_cache: Optional[bool] = True, enable_memory_cache: Optional[bool] = True, disk_cache_dir: Optional[str] = DISK_CACHE_DIR, disk_size_limit_bytes: Optional[int] = DISK_CACHE_LIMIT, memory_max_entries: Optional[int] = 1000000, enable_litellm_cache: bool = False)
Configure the cache for DSPy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
enable_disk_cache
|
Optional[bool]
|
Whether to enable on-disk cache. |
True
|
enable_memory_cache
|
Optional[bool]
|
Whether to enable in-memory cache. |
True
|
disk_cache_dir
|
Optional[str]
|
The directory to store the on-disk cache. |
DISK_CACHE_DIR
|
disk_size_limit_bytes
|
Optional[int]
|
The size limit of the on-disk cache. |
DISK_CACHE_LIMIT
|
memory_max_entries
|
Optional[int]
|
The maximum number of entries in the in-memory cache. |
1000000
|
enable_litellm_cache
|
bool
|
Whether to enable LiteLLM cache. |
False
|