Pipecat TTS, STT, and LLM: Smallest AI Services
Build real-time voice AI pipelines using Smallest AI TTS, STT, and LLM with Pipecat.
This guide walks you through integrating Smallest AI TTS, STT, and LLM into a Pipecat voice pipeline. Pipecat is an open-source Python framework for building real-time voice and multimodal conversational AI agents using a frame-based architecture.
Code Example
The complete runnable example lives in the Pipecat repository, using Smallest AI for STT, LLM, and TTS end to end:
Pipecat Example - Smallest AI STT + LLM + TTS
Setup
1. Create a Virtual Environment
Activate it:
- On Linux/Mac:
- On Windows:
2. Install Pipecat with Smallest AI support
The smallest extra installs the TTS, STT, and LLM services for Smallest AI:
To run the full voice agent example, you also need:
daily- Daily transport, which the bot uses to manage audio rooms and connect participantsopenai- Required bySmallestLLMService, which connects to Electron through Pipecat’s OpenAI-compatible LLM servicesilero- Silero VAD for voice activity detection and interruption handlingrunner- Pipecat development runner that creates Daily rooms automatically and serves the bot locally
3. Create a .env file
DAILY_API_KEY is required - the Pipecat runner creates a Daily room automatically at startup. If you want to reuse an existing room instead of creating a new one each run, set the optional DAILY_ROOM_URL variable. A single SMALLEST_API_KEY covers STT, LLM, and TTS - no separate LLM provider key is needed.
Services
SmallestSTTService
Constructor parameters:
Settings (SmallestSTTService.Settings):
The STT service connects to the Waves v4 STT endpoint (wss://api.smallest.ai/waves/v1/stt/live?model=pulse) and streams audio frames from the pipeline, returning transcriptions with 64ms TTFT. Pipecat’s VAD triggers a finalize message on each end-of-utterance to flush the transcript while keeping the WebSocket session open for the next utterance.
Pulse 2.0:
Pass model=SmallestSTTModel.PULSE_2 to connect to wss://api.smallest.ai/waves/v1/stt/live?model=pulse-2 instead. Pulse 2.0 has a built-in end-of-turn detector, but Pipecat’s VAD and user turn strategies still decide when the user’s turn ends — the VAD-triggered finalize flushes the final transcript as with Pulse, and endpointing has no effect on this model. The rest of SmallestSTTSettings (diarization, PII/PCI redaction, keyword boosting, etc.) still applies. See the Pulse 2.0 model card for benchmarks and the full response shape.
SmallestTTSService
Constructor parameters:
Settings (SmallestTTSService.Settings):
The TTS service connects to wss://api.smallest.ai/waves/v1/tts/live and uses WebSocket streaming for low-latency, real-time audio delivery. The model field is sent per-message, so switching models takes effect on the next utterance without reconnecting. Text fragments within the same LLM turn share a continuation context: they’re sent with the turn’s context_id and continue: true so the server joins them into one continuous generation instead of resetting prosody on each fragment, and the context is closed with continue: false once the turn ends.
SmallestLLMService
Electron access is currently limited to enterprise customers. To request access, reach out to support@smallest.ai.
SmallestLLMService connects to Electron, Smallest AI’s LLM, through the Waves API’s OpenAI-compatible chat completions endpoint. It extends Pipecat’s OpenAILLMService, so it’s a drop-in replacement wherever an OpenAI-compatible LLM service is expected - no provider-specific wiring beyond the API key and base URL.
Constructor parameters:
Settings (SmallestLLMService.Settings):
Inherits the common OpenAI-compatible settings - model, system_instruction, temperature, top_p, max_tokens/max_completion_tokens, frequency_penalty, presence_penalty, and seed - all of which can be updated at runtime via LLMUpdateSettingsFrame. model defaults to "electron" and generally doesn’t need to be set.
Because Electron speaks the OpenAI Chat Completions format, SmallestLLMService works with Pipecat’s existing LLMContext, tool calling, and streaming support unchanged. Electron also supports returning a short spoken filler in its response alongside a tool call (for example, “Let me check that”) when the system prompt asks for one, so the TTS can mask tool-call latency without any extra pipeline wiring - see function-calling-smallest.py for a complete example.
Running the Example
Clone the Pipecat repository and navigate to the examples directory:
Create a .env file with the keys listed in the Setup section above, then run:
Daily transport - server mode (recommended):
Open http://localhost:7860 in your browser. The runner creates a Daily room automatically and redirects you to it.
Daily transport - direct mode (no web server, for quick testing):
The room URL is printed in the terminal. Open it in your browser to join.
The full source for voice-smallest.py is at examples/voice/voice-smallest.py. It sets up a complete interruptible voice bot using Smallest AI for STT, LLM (Electron), and TTS, Silero VAD for interruptions, and Daily as the transport - all wired together with the Pipecat runner, so the whole bot runs on a single SMALLEST_API_KEY.
Other examples
function-calling-smallest.py- tool calling withSmallestLLMService, including the filler-phrase pattern described above.llm-smallest.py- updatingSmallestLLMServicesettings (e.g.temperature) at runtime viaLLMUpdateSettingsFrame.
Notes
- The pipeline is interruptible: if a user speaks while the bot is talking, audio stops immediately and the pipeline re-engages - no custom logic needed.
- For any issues or questions, open an issue in the Pipecat repository or contact us on Discord.