BerriAI / litellm

Call all LLM APIs using the OpenAI format. Use Bedrock, Azure, OpenAI, Cohere, Anthropic, Ollama, Sagemaker, HuggingFace, Replicate (100+ LLMs)
https://docs.litellm.ai/docs/
Other
10.12k stars 1.13k forks source link

[Bug]: `content-type` is wrong for tts #4332

Open Manouchehri opened 1 week ago

Manouchehri commented 1 week ago

What happened?

https://github.com/BerriAI/litellm/blob/361e47882b590be47d6b3afe31e0db1e12992212/litellm/proxy/proxy_server.py#L3813

This always results in audio/mpeg, which is wrong.

curl "$OPENAI_API_BASE/audio/speech" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy",
    "response_format": "flac"
  }' -v | ffprobe -i -
100   140    0     0  100   140      0     63  0:00:02  0:00:02 --:--:--    63Input #0, flac, from 'fd:':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Audio: flac, 24000 Hz, mono, s16

Relevant log output

< content-type: audio/mpeg

Twitter / LinkedIn details

https://twitter.com/DaveManouchehri