Overview
UltravoxRealtimeLLMService provides real-time conversational AI capabilities using Ultravox’s Realtime API. It supports both text and audio modalities with voice transcription, streaming responses, and tool usage for creating interactive AI experiences.
Ultravox Realtime API Reference
Pipecat’s API methods for Ultravox Realtime integration
Example Implementation
Complete Ultravox Realtime conversation example
Async Tool Example
Ultravox with async function calling (cancel_on_interruption=False)
Ultravox Documentation
Official Ultravox API documentation
Ultravox Console
Access Ultravox models and manage API keys
Installation
To use Ultravox Realtime services, install the required dependencies:Prerequisites
Ultravox Account Setup
Before using Ultravox Realtime services, you need:- Ultravox Account: Sign up at Ultravox Console
- API Key: Generate an Ultravox API key from your account dashboard
- Model Access: Ensure access to Ultravox Realtime models
- Usage Limits: Configure appropriate usage limits and billing
Required Environment Variables
ULTRAVOX_API_KEY: Your Ultravox API key for authentication
Key Features
- Audio-Native Model: Ultravox is an audio-native model for natural voice interactions
- Real-time Streaming: Low-latency audio processing and streaming responses
- Multiple Input Modes: Support for Agent, One-Shot, and Join URL input parameters
- Voice Transcription: Built-in transcription with streaming output
- Function Calling: Support for tool integration and API calling
- Configurable Duration: Set maximum call duration limits
Configuration
UltravoxRealtimeLLMService
Configuration parameters for connecting to Ultravox. One of three input
parameter types must be provided. See Input Parameter
Types below.
Tools to use with a one-shot call: a
ToolsSchema, or a plain list of direct
functions and/or FunctionSchema objects. May only be set when using
OneShotInputParams.Runtime-configurable settings. See Settings below.
Settings
Runtime-configurable settings passed via thesettings constructor argument using UltravoxRealtimeLLMService.Settings(...). These can be updated mid-conversation with LLMUpdateSettingsFrame. See Service Settings for details.
NOT_GIVEN values are omitted, letting the service use its own defaults. Only
parameters that are explicitly set are included.Input Parameter Types
Ultravox supports three different ways to create or join a call:AgentInputParams
Use a pre-configured Ultravox Agent to handle calls consistently.OneShotInputParams
Create a one-off call with inline configuration.JoinUrlInputParams
Join an existing Ultravox call using a join URL.Usage
Basic Setup with Agent
One-Shot Call
One-Shot with Tools
Join Existing Call
Switching Output Medium at Runtime
Notes
- Audio-native model: Ultravox processes audio directly rather than relying on a separate STT step. Voice transcriptions are provided for reference but may not always align with the model’s understanding of user input.
- Server-side context management: Ultravox handles conversation context server-side. The LLM context in Pipecat is only used for passing function call results back to the service.
- Audio sample rate: The service uses a 48kHz sample rate. Input audio at different sample rates is automatically resampled.
- Output medium: The service supports both
"voice"and"text"output modes, switchable at runtime usingLLMUpdateSettingsFrame. - Call duration limits: When using
AgentInputParamsorOneShotInputParams, you can set a maximum call duration between 10 seconds and 1 hour. - Tools with agents: When using
AgentInputParams, tools are configured on the agent itself. Useone_shot_selected_toolsonly withOneShotInputParams. - Async tool support: Functions registered with
cancel_on_interruption=Falseare supported. When an async function is invoked, Ultravox ships a placeholderclient_tool_resultimmediately to unfreeze the conversation (since Ultravox’s API freezes between tool invocation and result). The actual result is injected as user-side text once the tool completes. Streamed intermediate results (is_final=False) are not supported.