docs(caching.md): add redis namespaces to docs

This commit is contained in:
Krrish Dholakia 2024-03-14 13:38:33 -07:00
parent 7a0cd1e3c5
commit cb221cc88b

View file

@ -32,6 +32,24 @@ litellm_settings:
cache: True # set cache responses to True, litellm defaults to using a redis cache cache: True # set cache responses to True, litellm defaults to using a redis cache
``` ```
#### [OPTIONAL] Step 1.5: Add redis namespaces
If you want to create some folder for your keys, you can set a namespace, like this:
```yaml
litellm_settings:
cache: true
cache_params: # set cache params for redis
type: redis
namespace: "litellm_caching"
```
and keys will be stored like:
```
litellm_caching:<hash>
```
#### Step 2: Add Redis Credentials to .env #### Step 2: Add Redis Credentials to .env
Set either `REDIS_URL` or the `REDIS_HOST` in your os environment, to enable caching. Set either `REDIS_URL` or the `REDIS_HOST` in your os environment, to enable caching.