litellm/litellm/caching
2026-03-12 13:36:57 -03:00
..
__init__.py Add GCS bucket caching support (#13122) 2025-08-04 16:09:33 -07:00
_internal_lru_cache.py
azure_blob_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
base_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
caching_handler.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
caching.py fix(caching): check REDIS_CLUSTER_NODES env var in Cache and Router class selection (#22790) 2026-03-06 17:31:30 -08:00
disk_cache.py
dual_cache.py Reapply "feat: add model_cost aliases expansion support" 2026-03-12 13:36:57 -03:00
gcs_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
in_memory_cache.py [Performance] Reduce complexity of InMemoryCache.evict_cache from O(n*log(n)) to O(log(n)) (#15000) 2025-09-30 16:49:35 -07:00
llm_caching_handler.py fix: don't close HTTP/SDK clients on LLMClientCache eviction (#22925) 2026-03-05 12:00:38 -08:00
qdrant_semantic_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
Readme.md
redis_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
redis_cluster_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
redis_semantic_cache.py
s3_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00

Caching on LiteLLM

LiteLLM supports multiple caching mechanisms. This allows users to choose the most suitable caching solution for their use case.

The following caching mechanisms are supported:

  1. RedisCache
  2. RedisSemanticCache
  3. QdrantSemanticCache
  4. InMemoryCache
  5. DiskCache
  6. S3Cache
  7. AzureBlobCache
  8. DualCache (updates both Redis and an in-memory cache simultaneously)

Folder Structure

litellm/caching/
├── base_cache.py
├── caching.py
├── caching_handler.py
├── disk_cache.py
├── dual_cache.py
├── in_memory_cache.py
├── qdrant_semantic_cache.py
├── redis_cache.py
├── redis_semantic_cache.py
├── s3_cache.py

Documentation