diff --git a/litellm/caching.py b/litellm/caching.py index f63df94647d..e1678a109f9 100644 --- a/litellm/caching.py +++ b/litellm/caching.py @@ -154,7 +154,7 @@ class S3Cache(BaseCache): print_verbose(f"LiteLLM SET Cache - S3. Key={key}. Value={value}") ttl = kwargs.get("ttl", None) # Convert value to JSON before storing in S3 - serialized_value = str(value) + serialized_value = json.dumps(value) if ttl is not None: cache_control = f"immutable, max-age={ttl}, s-maxage={ttl}" import datetime