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/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

paramsrequired
api_keystring
required

The Smallest AI API key used to authenticate requests. You must provide a valid key for the service to function.

urlstring
optional

The Smallest AI streaming TTS endpoint. For example, https://api.smallest.ai/waves/v1/tts/live.

modelstring
optional

The Smallest AI TTS model to use, such as lightning_v3.1_pro or lightning_v3.1. Voice identifiers are model-specific, so voice_id must belong to the model you select.

voice_idstring
optional

The Smallest AI voice identifier to use. For example, hazel.

sample_rateinteger
optional

Output audio sample rate in Hz. For example, 16000.

speednumber
optional

Speech rate multiplier, where 1.0 is the model's default pace.

languagestring
optional

Language code used for speech synthesis. For example, zh.

number_pronunciation_languagestring
optional

Language code used when reading numbers aloud. Set this when numbers should be spoken in a different language from the surrounding text.

math_notationboolean
optional

Whether to read mathematical notation as spoken mathematics rather than as literal symbols.

pronunciation_dictsarray[string]
optional

Identifiers of Smallest AI pronunciation dictionaries to apply, used to override how specific terms are spoken.

session_idstring
optional

Caller-supplied session identifier, passed through to Smallest AI for tracing.

request_idstring
optional

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.