diff --git a/litellm/utils.py b/litellm/utils.py index 18a3ed824..42c9b4157 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1975,7 +1975,10 @@ def client(original_function): if ( (kwargs.get("caching", None) is None and litellm.cache is not None) or kwargs.get("caching", False) == True - or kwargs.get("cache", {}).get("no-cache", False) != True + or ( + kwargs.get("cache", None) is not None + and kwargs.get("cache", {}).get("no-cache", False) != True + ) ): # allow users to control returning cached responses from the completion function # checking cache print_verbose(f"INSIDE CHECKING CACHE")