Fix STT auto-detection: don't route to LiteLLM unless LITELLM_STT_MODEL is set

Having LITELLM_API_BASE for AI text was auto-routing audio transcription
through LiteLLM even when the proxy has no Whisper model configured,
causing silent hangs. Now LiteLLM STT only activates when LITELLM_STT_MODEL
is explicitly set. Falls back correctly to AWS Transcribe when configured.
This commit is contained in:
Daniel Onyejesi 2026-03-29 21:42:24 -04:00
parent ce7d0e749d
commit 96dc40fd0b

View file

@ -22,8 +22,9 @@ function getTranscribeProvider() {
if (env === 'local') return 'local';
if (env === 'aws') return 'aws';
if (env === 'openai') return 'openai';
// Auto-detect
if (process.env.LITELLM_API_BASE && litellmClient) return 'litellm';
// Auto-detect: only use LiteLLM for STT if LITELLM_STT_MODEL is explicitly set
// Having LITELLM_API_BASE for AI text does NOT automatically route audio through LiteLLM
if (process.env.LITELLM_STT_MODEL && process.env.LITELLM_API_BASE && litellmClient) return 'litellm';
if (isAWSTranscribeConfigured()) return 'aws';
return 'openai';
}