Caching is a gateway (data-plane) feature. The control plane shares the same Redis so the Caching page’s health check reports correctly, but the actual response caching happens where the LLM calls run
How it is wired in ForceAI
The stack ships a Redis service and a small config that turns caching on:- A pinned
redisservice in the compose (cache only, no persistence) deploy/gateway/cache_config.yamlwithlitellm_settings.cache: truepointing at Redis, mounted into the gateway and backend viaCONFIG_FILE_PATH- Database-stored models still load on top of the config, so nothing about routing changes
Tune it
Editdeploy/gateway/cache_config.yaml and recreate the gateway (and backend) so the mounted config is re-read:
ttlsets how long a cached entry lives, in secondssupported_call_typeslimits what gets cached; dropembedding/aembeddingif you only want chat responses- Point
host/portat an external Redis instead of the bundled one for a shared or managed cache
See cache hits
Open the dashboard Experimental -> Caching page. The health tile shows a healthy Redis cache, and the analytics show the hit ratio, cached responses, and cached tokens over a date range. Send the same prompt twice from the Playground and watch the cached-rows count go upVerify by API
Two identical completions; the second is served from cache (same response id, no new provider call):id values match on a hit. The cached call also records cache_hit=true in the spend logs, which is what the Caching page’s analytics read
Check the cache backend directly:
{"status": "healthy", "cache_type": "redis"}