Smallest AI
Updated
Integrate Smallest AI TTS with the Conversational AI Engine.
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 examples show how to configure Smallest AI TTS when starting a conversational AI agent.
from agora_agent import Agent
from agora_agent.agentkit.vendors import SmallestAITTS
# client is your configured Agora client
agent = (
Agent(client)
.with_stt(...) # configure your STT vendor
.with_llm(...) # configure your LLM vendor
.with_tts(SmallestAITTS(
url='https://api.smallest.ai/waves/v1/tts/live',
api_key='your-smallest-ai-key',
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 } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your STT vendor */)
.withLlm(/* configure your LLM vendor */)
.withTts(new SmallestAITTS({
url: 'https://api.smallest.ai/waves/v1/tts/live',
apiKey: 'your-smallest-ai-key',
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',
}));import (
Agora "github.com/AgoraIO/agora-agents-go/v2"
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
WithLlm(/* configure your LLM vendor */).
WithTts(
vendors.NewSmallestAITTS(vendors.SmallestAITTSOptions{
URL: "https://api.smallest.ai/waves/v1/tts/live",
APIKey: "your-smallest-ai-key",
Model: "lightning_v3.1_pro",
VoiceID: "hazel",
SampleRate: Agora.Int(16000),
Speed: Agora.Float64(1.0),
Language: "zh",
NumberPronunciationLanguage: "zh",
MathNotation: Agora.Bool(true),
PronunciationDicts: []string{},
SessionID: "session_001",
RequestID: "request_001",
}),
)Use the following tts configuration in your request. Only api_key is required:
"tts": {
"vendor": "smallestai",
"params": {
"url": "https://api.smallest.ai/waves/v1/tts/live",
"api_key": "<smallest_ai_api_key>",
"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
| Parameter | Description |
|---|---|
api_keystring | The Smallest AI API key used to authenticate requests. You must provide a valid key for the service to function. |
urlstring | The Smallest AI streaming TTS endpoint. For example, |
modelstring | The Smallest AI TTS model to use, such as |
voice_idstring | The Smallest AI voice identifier to use. For example, |
sample_rateinteger | Output audio sample rate in Hz. For example, |
speednumber | Speech rate multiplier, where |
languagestring | Language code used for speech synthesis. For example, |
number_pronunciation_languagestring | Language code used when reading numbers aloud. Set this when numbers should be spoken in a different language from the surrounding text. |
math_notationboolean | Whether to read mathematical notation as spoken mathematics rather than as literal symbols. |
pronunciation_dictsarray[string] | Identifiers of Smallest AI pronunciation dictionaries to apply, used to override how specific terms are spoken. |
session_idstring | Caller-supplied session identifier, passed through to Smallest AI for tracing. |
request_idstring | Caller-supplied request identifier, passed through to Smallest AI for tracing. |
Caution
The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to the underlying vendor without validation. For a full list of supported options, refer to the Smallest AI documentation.
This integration is fully supported for use with Conversational AI Engine. 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.
