litellm/litellm/caching
Jugal D. Bhatt be60d12ff7
[LLM Translation - Redis] fix: redis caching for embedding response models (#12750)
* fix: redis caching for embedding responses

* add helper

* add mypy fixes

* lint fix

* review changes

* remove file

* fix ruff

* add if check

* add if check
2025-07-18 16:31:10 -07:00
..
__init__.py add azure blob cache support (#12587) 2025-07-15 11:47:38 -07:00
_internal_lru_cache.py
azure_blob_cache.py add azure blob cache support (#12587) 2025-07-15 11:47:38 -07:00
base_cache.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
caching_handler.py [LLM Translation - Redis] fix: redis caching for embedding response models (#12750) 2025-07-18 16:31:10 -07:00
caching.py [LLM Translation - Redis] fix: redis caching for embedding response models (#12750) 2025-07-18 16:31:10 -07:00
disk_cache.py [Bug Fix] No module named 'diskcache' (#11600) 2025-06-10 14:54:11 -07:00
dual_cache.py Simplify experimental multi-instance rate limiter - more accurate (#11424) 2025-06-07 11:10:55 -07:00
in_memory_cache.py Simplify experimental multi-instance rate limiter - more accurate (#11424) 2025-06-07 11:10:55 -07:00
llm_caching_handler.py Fix pytest event loop warning (#10512) 2025-05-02 19:43:18 -07:00
qdrant_semantic_cache.py Squashed commit of the following: (#9709) 2025-04-02 21:24:54 -07:00
Readme.md add azure blob cache support (#12587) 2025-07-15 11:47:38 -07:00
redis_cache.py Simplify experimental multi-instance rate limiter - more accurate (#11424) 2025-06-07 11:10:55 -07:00
redis_cluster_cache.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
redis_semantic_cache.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
s3_cache.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07: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