BerriAI / litellm

Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
14.41k stars 1.7k forks source link

[Bug]: RuntimeError: "Stream consumed" on /v1/audio/transcriptions endpoint #6161

Open lloukmane opened 1 month ago

lloukmane commented 1 month ago

What happened?

Hello,

I’m encountering an issue when invoking the Whisper model on the /v1/audio/transcriptions endpoint using LiteLLM version 1.48.5. The problem occurs when the model is part of an access group that the API key has valid permissions for. However, when the API key has access to all-team-models, no error occurs.

Could you assist in identifying the cause and a possible resolution?

Relevant log output

LiteLLM Proxy:ERROR: user_api_key_auth.py:1136 - litellm.proxy.proxy_server.user_api_key_auth(): Exception occured - Stream consumed
Requester IP Address:XXXXXX
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/litellm/proxy/auth/user_api_key_auth.py", line 742, in user_api_key_auth
    data = await request.json()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/requests.py", line 251, in json
    body = await self.body()
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/requests.py", line 244, in body
    async for chunk in self.stream():
  File "/usr/local/lib/python3.11/site-packages/starlette/requests.py", line 227, in stream
    raise RuntimeError("Stream consumed")
RuntimeError: Stream consumed

Twitter / LinkedIn details

No response

MattCarneiro commented 1 month ago

Same error for me