Smallest AI
Updated
Use Smallest AI for text-to-speech (TTS) in a Conversational AI Platform agent.
Preview documentation
Smallest AI provides low-latency streaming text-to-speech (TTS) through its Lightning model family, with voices across a broad set of languages.
Sample configuration
The following example shows how to configure Smallest AI as the agent's TTS when you create or update an agent. For a complete example, see Create an agent and start a session.
Smallest AI supports BYOK only. It isn't available in managed mode. Store your Smallest AI API key in a secret set, and refer to it from the agent. For details, see Use your own provider keys.
from agora_agent import Agent, SmallestAITTS, secret_ref
# client is your configured Agora client
agent = (
Agent(client=client)
.with_stt(...) # configure your ASR vendor
.with_llm(...) # configure your LLM vendor
.with_tts(
SmallestAITTS(
api_key=secret_ref("support_prod", "smallestai"),
url="https://api.smallest.ai/waves/v1/tts/live",
model="lightning_v3.1_pro",
voice_id="hazel",
sample_rate=16000,
speed=1.0,
language="zh",
number_pronunciation_language="zh",
math_notation=True,
pronunciation_dicts=[],
session_id="session_001",
request_id="request_001",
)
)
)import { Agent, SmallestAITTS, secretRef } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your ASR vendor */)
.withLlm(/* configure your LLM vendor */)
.withTts(
new SmallestAITTS({
apiKey: secretRef('support_prod', 'smallestai'),
url: 'https://api.smallest.ai/waves/v1/tts/live',
model: 'lightning_v3.1_pro',
voiceId: 'hazel',
sampleRate: 16000,
speed: 1.0,
language: 'zh',
numberPronunciationLanguage: 'zh',
mathNotation: true,
pronunciationDicts: [],
sessionId: 'session_001',
requestId: 'request_001',
}),
);sampleRate, speed, mathNotation := 16000, 1.0, true
// client is your configured Agora client
agent := agentkit.NewAgent(client).
WithStt( /* configure your ASR vendor */ ).
WithLlm( /* configure your LLM vendor */ ).
WithTts(vendors.NewSmallestAITTS(vendors.SmallestAITTSOptions{
APIKey: agentkit.SecretRef("support_prod", "smallestai"),
URL: "https://api.smallest.ai/waves/v1/tts/live",
Model: "lightning_v3.1_pro",
VoiceID: "hazel",
SampleRate: &sampleRate,
Speed: &speed,
Language: "zh",
NumberPronunciationLanguage: "zh",
MathNotation: &mathNotation,
PronunciationDicts: []string{},
SessionID: "session_001",
RequestID: "request_001",
}))Set credential.mode to byok and credential.fields.api_key to a reference to your Smallest AI API key in a secret set. In the following example, the key is stored as smallestai in the support_prod set:
"tts": {
"credential": {
"mode": "byok",
"fields": {
"api_key": "$secrets.support_prod.smallestai"
}
},
"vendor": "smallestai",
"url": "https://api.smallest.ai/waves/v1/tts/live",
"params": {
"model": "lightning_v3.1_pro",
"voice_id": "hazel",
"sample_rate": 16000,
"speed": 1.0,
"language": "zh",
"number_pronunciation_language": "zh",
"math_notation": true,
"pronunciation_dicts": [],
"session_id": "session_001",
"request_id": "request_001"
}
}Key parameters
The tts block takes the following fields. In the SDKs, the Smallest AI TTS class sets them from its options.
| Parameter | Description |
|---|---|
vendorstring | Set to |
credentialobject | Set |
urlstring | The Smallest AI streaming TTS endpoint, for example |
paramsobject |
|
Caution
The parameters listed on this page are validated for use with the Conversational AI Platform. Required parameters must be provided as documented. Any additional parameters in params are passed through directly to Smallest AI without validation. For a full list of supported options, refer to the Smallest AI documentation.
This integration is fully supported for use with the Conversational AI Platform. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
