SmallestAI TTS
The SmallestAI TTS provider enables your agent to use SmallestAI's high-quality text-to-speech models for generating voice output.
Installation​
Install the SmallestAI-enabled VideoSDK Agents package:
pip install "videosdk-plugins-smallestai"
Importing​
from videosdk.plugins.smallestai import SmallestAITTS
Authentication​
The Smallest AI plugin requires a Smallest AI API key.
Set SMALLEST_API_KEY
in your .env
file.
Example Usage​
from videosdk.plugins.smallestai import SmallestAITTS
from videosdk.agents import CascadingPipeline
# Initialize the SmallestAI TTS model
tts = SmallestAITTS(
# When SMALLEST_API_KEY is set in .env - DON'T pass api_key parameter
api_key="your-smallestai-api-key",
model="lightning",
voice_id="emily"
)
# Add tts to cascading pipeline
pipeline = CascadingPipeline(tts=tts)
When using .env file for credentials, don't pass them as arguments to model instances. The SDK automatically reads environment variables, so omit api_key
from your code.
Configuration Options​
api_key
: (str) Your SmallestAI API key. Can also be set via theSMALLEST_API_KEY
environment variable.model
: (str) The TTS model to use (e.g.,"lightning"
,"lightning-large"
). Defaults to"lightning"
.voice_id
: (str) The ID of the voice to use. Defaults to"emily"
.speed
: (float) Speech speed multiplier. Defaults to1.0
.consistency
: (float) Controls word repetition and skipping. Only supported inlightning-large
model. Defaults to0.5
.similarity
: (float) Controls similarity to the reference audio. Only supported inlightning-large
model. Defaults to0.0
.enhancement
: (bool) Enhances speech quality at the cost of increased latency. Only supported inlightning-large
model. Defaults toFalse
.
Additional Resources​
The following resources provide more information about using Smallest AI with VideoSDK Agents SDK.
-
Python package: The
videosdk-plugins-smallestai
package on PyPI. -
GitHub repo: View the source or contribute to the VideoSDK Smallest AI TTS plugin.
-
Smallest AI docs: Smallest AI docs.
Got a Question? Ask us on discord