diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index fe41d5b83..8804028cc 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -1252,7 +1252,12 @@ async def _read_request_body(request): import ast, json request_data = {} + if request is None: + return request_data body = await request.body() + + if body == b"" or body is None: + return request_data body_str = body.decode() try: request_data = ast.literal_eval(body_str)