BerriAI/litellm · error · ValueError
Invalid response format. Received response does not match th
Error message
Invalid response format. Received response does not match the expected format. Got: {raw_response_json} What it means
ValueError from the Whisper transcription response transformer: the body parsed as JSON but contains none of the fields expected of a TranscriptionResponse (e.g. 'text'), so it cannot be mapped. Typically a provider returned an unexpected JSON schema (error object or vendor-specific shape) for a transcription request.
Source
Thrown at litellm/llms/openai/transcriptions/whisper_transformation.py:138
headers=headers,
)
def transform_audio_transcription_response(
self,
raw_response: Response,
) -> TranscriptionResponse:
try:
raw_response_json: Final = raw_response.json()
except json.JSONDecodeError:
content_type: Final = raw_response.headers.get("content-type", "").lower()
if "application/json" in content_type:
raise
return TranscriptionResponse(text=raw_response.text)
if any(key in raw_response_json for key in TranscriptionResponse.model_fields):
return TranscriptionResponse(**raw_response_json)
else:
raise ValueError(
"Invalid response format. Received response does not match the expected format. Got: ",
raw_response_json,
)
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check the received response shown in the message; ensure you are calling a transcription endpoint with a Whisper-compatible model and valid audio file.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/llms/openai/transcriptions/whisper_transformation.py:138 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/e280b5d2b797b5a7.
Report an issue: GitHub.