These recommendations apply to the Realtime
API and are passed during session
initialization. They are starting points — tune them to match your
specific needs.
Language Configuration
One of the most common configuration mistakes is misunderstanding howlanguage_config works. Choosing the right setup avoids unnecessary detection overhead and improves accuracy.
When to set an explicit language:
- You know the language of the audio ahead of time.
- The audio is monolingual (single language throughout).
- You want the fastest, most accurate results.
- You process audio in many different languages and don’t know which one beforehand.
- You want Gladia to pick the language automatically.
Code Switching
Code switching (language_config.code_switching: true) lets Gladia detect and transcribe multiple languages within the same audio, re-evaluating the language on each utterance.
When to enable it:
- Speakers switch languages mid-conversation (e.g. bilingual meetings, multilingual customer support).
- You need the detected
languagereturned per utterance.
- The audio is in a single language — code switching adds unnecessary processing and can introduce misdetections.
- You’ve set exactly one language in
languages— in that casecode_switchingis ignored anyway.
Custom Vocabulary
Custom vocabulary is a post-transcription replacement based on phoneme similarity. It’s essential for domain-specific terms that speech models frequently mis-transcribe. Best practices:- Always provide both the
custom_vocabularyflag and acustom_vocabulary_config. - Add pronunciations to provide all the close spelling variants. You can use Automatic Phonemic Transcriber (IPA) in order to check if all the different spellings are covered.
- Keep
intensitymoderate (0.4-0.6). High values increase false positives where unrelated words get replaced. - Set
languageon individual vocabulary entries when your audio is multilingual and a term is pronounced differently depending on the language.