feat(stt): add server-side language fallback and extraParams for OpenAI STT provider

Add two optional fields to the OpenAI STT provider config schema:

- `language`: server-side default language (ISO 639-1) sent to Whisper when
  the client doesn't provide one. Useful for non-English deployments where
  admins want to predefine the transcription language without requiring each
  user to configure it in the browser.

- `extraParams`: arbitrary key-value pairs forwarded to the STT endpoint.
  Enables self-hosted Whisper servers (e.g. Speaches, faster-whisper-server)
  to receive provider-specific parameters like `vad_filter` (Voice Activity
  Detection) which filters silence and prevents hallucinations on empty
  audio clips. These params are ignored by the official OpenAI API.

Example librechat.yaml configuration:

```yaml
speech:
  stt:
    openai:
      url: 'http://whisper-server/v1/audio/transcriptions'
      apiKey: 'none'
      model: 'whisper-large-v3-turbo'
      language: 'pl'
      extraParams:
        vad_filter: true
```
This commit is contained in:
Mieszko Makuch 2026-03-25 11:38:57 +01:00
parent 5a373825a5
commit f158f07ee0
2 changed files with 7 additions and 1 deletions

View file

@ -478,6 +478,8 @@ const sttOpenaiSchema = z.object({
url: z.string().optional(),
apiKey: z.string(),
model: z.string(),
language: z.string().optional(),
extraParams: z.record(z.unknown()).optional(),
});
const sttAzureOpenAISchema = z.object({