mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +00:00
* fix(speech): use the provider api key get_llm_provider resolves speech() called get_llm_provider and then dropped its dynamic_api_key everywhere except the logging params, so a TTS deployment whose credential lives in a provider-specific env var fell through to OPENAI_API_KEY on the openai-compatible branch and to AZURE_OPENAI_API_KEY / AZURE_API_KEY on the azure branch, failing with a missing-credentials error naming variables the admin never configured. Fold dynamic_api_key into both branch key chains, right after an explicitly passed api_key, so a provider-scoped key is used while an explicit one stays authoritative. * test(main): assert an explicit api_key still outranks the provider-scoped one in speech() * test(main): hand recorded TTS headers across threads through a queue * fix(speech): try the provider-scoped key last so working global keys keep priority Putting get_llm_provider's key ahead of litellm.api_key, OPENAI_API_KEY and AZURE_API_KEY broke TTS setups that already worked through a global key, and let local-inference placeholders like fake-api-key outrank a real OPENAI_API_KEY. The provider-scoped key is now the last fallback in both speech key chains, so only callers that had no key at all change behavior * fix(speech): keep the provider key first but skip local-inference placeholders Trying the provider key last let OPENAI_API_KEY or AZURE_API_KEY go to a hosted_vllm, deepinfra or azure_ai endpoint whose own key was configured, which leaks the global credential and still fails the reported setup. The provider key goes first again, matching completion() and transcription(), and the fake-api-key / dummy-key placeholders get_llm_provider returns for local-inference providers are skipped there, so a real OPENAI_API_KEY still wins over them * fix(speech): keep a deployment's Entra ID credentials ahead of the provider-scoped key * fix(speech): keep Entra ID from env vars and token refresh ahead of the provider-scoped key * fix(speech): count a request's Entra ID token ahead of the provider-scoped key * fix(speech): keep the provider key next to an Azure AD token TTS never sends * test(azure): type the parameters of the Entra ID auth detection test |
||
|---|---|---|
| .. | ||
| batches | ||
| chat | ||
| completion | ||
| decisions | ||
| image_edit | ||
| image_generation | ||
| live | ||
| passthrough | ||
| realtime | ||
| response | ||
| search | ||
| text_to_speech | ||
| vector_stores | ||
| videos | ||
| __init__.py | ||
| test_audio_transcriptions.py | ||
| test_azure.py | ||
| test_azure_common_utils.py | ||
| test_azure_cost_calculation.py | ||
| test_azure_embedding.py | ||
| test_azure_exception_mapping.py | ||
| test_azure_fine_tuning_api.py | ||
| test_azure_ptu_capacity.py | ||
| test_azure_speech_audio_transcription.py | ||