Skip to navigation

Choose a model

View as Markdown

Set the model parameter to choose a Bulbul model. Both models use the same request format, parameters, limits and APIs. What differs is the set of speakers.

bulbul:v4-flashbulbul:v3
When to use itNew integrationsExisting integrations, or when you want a short speaker name
Speakers200+ persona IDs such as simran_en_customer37 names such as shubh
Default speakershubh_enhi_adsshubh
If model is omittedThis is the default model

Example

import os
from sarvamai import SarvamAI
from sarvamai.play import save
client = SarvamAI(api_subscription_key=os.environ["SARVAM_API_KEY"])
response = client.text_to_speech.convert(
text="Welcome to Sarvam AI!",
language_code="en-IN",
model="bulbul:v4-flash",
speaker="simran_en_customer",
)
save(response, "output.wav")

Switch between models

Change model and speaker together. Nothing else in the request needs to change.

FromToWhat to change
bulbul:v3bulbul:v4-flashSet model="bulbul:v4-flash" and replace the speaker name with a persona ID. See the v3 to v4 speaker mapping.
bulbul:v4-flashbulbul:v3Set model="bulbul:v3" and use a v3 speaker name such as shubh.

Speakers are not shared between models. A v3 name on bulbul:v4-flash, or a v4 persona ID on bulbul:v3, returns HTTP 400.

Common errors

RequestError
v3 speaker on v4 Flash (for example shubh)Speaker 'shubh' is not compatible with model bulbul:v4-flash. Available speakers for bulbul:v4-flash are: ...
v4 persona on v3 (for example simran_en_customer)Speaker 'simran_en_customer' is not compatible with model bulbul:v3. Available speakers for bulbul:v3 are: ...
Removed model bulbul:v2Returns HTTP 400.

The error lists every speaker the model accepts. To hear them first, see Voices.