Skip to main content

GCP Memorystore IAM Authentication

Connect LiteLLM's Redis cache to GCP Memorystore using IAM authentication, so the proxy authenticates as a service account and no Redis password exists in your config.

info

GCP IAM authentication for redis is only supported on Redis Clusters for now. For AWS ElastiCache and Valkey, see AWS ElastiCache IAM Authentication.

uv add google-cloud-iam

For Redis Cluster with GCP IAM:

litellm_settings:
cache: True
cache_params:
type: redis
redis_startup_nodes:
[{ "host": "10.128.0.2", "port": 6379 }, { "host": "10.128.0.2", "port": 11008 }]
gcp_service_account: "projects/-/serviceAccounts/your-sa@project.iam.gserviceaccount.com"
ssl: true
ssl_cert_reqs: null
ssl_check_hostname: false

Once the proxy is running, confirm the connection with /cache/ping. For everything else about the Redis cache, including cluster topology and TLS, see Redis and Valkey.