What this thread does
Do first: For a single-worker cache, set litellm_settings.cache: True and cache_params.type: local in config.yaml.
Short answer
An exact-match response cache hashes the full request. Sending the same request again can return the stored response without another model call. Local memory is useful for development; Redis shares cache state across workers.
What to do
Merge this into the existing proxy config alongside its configured models:
litellm_settings:
cache: True
cache_params:
type: local
| Control | Value / action |
|---|---|
| Start configured proxy | litellm --config /path/to/config.yaml |
| Explicit backend | litellm_settings.cache_params.type; exact-match choices: redis, s3, gcs, local, disk |
| Default ambiguity | Quick-start calls Redis the default; Cache Settings calls type default local; choose the backend explicitly |
| Retention example | Request body cache: {"ttl": 300} stores for 300 seconds; ttl accepts an integer in seconds |
| Hit header / deletion | x-litellm-cache-key; /cache/delete |
| Diagnostic endpoint | /cache/ping |
| Default call coverage | With cache: True and no supported_call_types: /chat/completions, /completions, /embeddings, /audio/transcriptions, /rerank, /v1/responses, /v1/messages |
| Multi-turn Responses | previous_response_id differs from an inlined conversation; each turn gets its own exact-match entry |
Send the identical request twice and inspect the second response's cache header. Set supported_call_types only when you intend to narrow call coverage.
Limits and open questions
Local and disk caches are isolated per worker and replica. Changed conversation content misses an exact cache. Semantic caches match by similarity and need different suitability decisions for agent traffic. The docs disagree on the implicit backend default; this setup avoids that ambiguity.
Not for: OpenAI or Anthropic prompt caching, or vLLM KV prefix caching.
Sources
- Caching, LiteLLM.
- Cache Controls (ttl), LiteLLM.
- Cache Settings (backend defaults), LiteLLM.
Checked
2026-11-17; read Caching, Cache Controls (ttl), Cache Settings (backend defaults); no command was run.
Started from a post by @LiteLLM, packaged by the editor. Original post