From bfe54eb013c6cae14e12bccf3ee0674e7fcc573a Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 20 Aug 2026 15:46:03 -0700 Subject: [PATCH] docs(redis): say why async paths cannot reuse redis_connect_func The AUTH exchange it runs is the blocking client API, so on an async connection send_command and read_response hand back coroutines nobody awaits and the connect fails outright. --- litellm/_redis.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/_redis.py b/litellm/_redis.py index b78ab285ac5..8c0ce1e7a3b 100644 --- a/litellm/_redis.py +++ b/litellm/_redis.py @@ -577,8 +577,10 @@ def _init_async_redis_sentinel(redis_kwargs) -> async_redis.Redis: def _async_credential_provider(redis_connect_func: object | None) -> CredentialProvider | None: - """Async redis-py never calls ``redis_connect_func``; it authenticates through a - ``CredentialProvider``, which it consults per connection so the token refreshes.""" + """``redis_connect_func`` runs the AUTH exchange with the blocking client API, so on an + async connection its ``send_command``/``read_response`` calls return coroutines nobody + awaits and every connect fails. Async paths authenticate through a ``CredentialProvider`` + instead, which redis-py consults per connection so the token stays fresh.""" gcp_service_account: Final = getattr(redis_connect_func, "_gcp_service_account", None) if gcp_service_account is not None: return GCPIAMCredentialProvider(gcp_service_account)