Agent Framework plugin for services from Ultravox
Project Links
Meta
Author: LiveKit
Requires Python: >=3.10.0
Classifiers
Intended Audience
- Developers
License
- OSI Approved :: Apache Software License
Programming Language
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.10
Topic
- Multimedia :: Sound/Audio
- Multimedia :: Video
- Scientific/Engineering :: Artificial Intelligence
LiveKit Ultravox Plugin
LiveKit plugin for Ultravox's real-time speech-to-speech AI models, providing seamless integration with the LiveKit Agents framework.
Installation
pip install livekit-plugins-ultravox
Prerequisites
You'll need an API key from Ultravox. Set it as an environment variable:
export ULTRAVOX_API_KEY="your_api_key_here"
Optional: enable debug logs for the plugin (disabled by default):
export LK_ULTRAVOX_DEBUG=true
Basic Usage
Simple Voice Assistant
import asyncio
from livekit.agents import Agent, AgentSession, JobContext, JobProcess, WorkerOptions, cli
from livekit.plugins import silero
from livekit.plugins.ultravox.realtime import RealtimeModel
async def entrypoint(ctx: JobContext):
await ctx.connect()
session: AgentSession[None] = AgentSession(
allow_interruptions=True,
vad=ctx.proc.userdata["vad"],
llm=RealtimeModel(
model_id="fixie-ai/ultravox",
voice="Mark",
),
)
await session.start(
agent=Agent(
instructions="You are a helpful voice assistant.",
),
room=ctx.room,
)
def prewarm(proc: JobProcess) -> None:
proc.userdata["vad"] = silero.VAD.load()
if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm))
Voice Assistant with Tools
from livekit.agents import function_tool, Agent, AgentSession, JobContext, JobProcess, WorkerOptions, cli
from livekit.plugins import silero
from livekit.plugins.ultravox.realtime import RealtimeModel
@function_tool
async def get_weather(location: str) -> str:
"""Get weather information for a location."""
return f"The weather in {location} is sunny and 72°F"
@function_tool
async def book_appointment(date: str, time: str) -> str:
"""Book an appointment."""
return f"Appointment booked for {date} at {time}"
async def entrypoint(ctx: JobContext):
await ctx.connect()
session: AgentSession[None] = AgentSession(
allow_interruptions=True,
vad=ctx.proc.userdata["vad"],
llm=RealtimeModel(model_id="fixie-ai/ultravox"),
)
await session.start(
agent=Agent(
instructions="You are a helpful assistant with access to weather and scheduling tools.",
tools=[get_weather, book_appointment],
),
room=ctx.room,
)
def prewarm(proc: JobProcess) -> None:
proc.userdata["vad"] = silero.VAD.load()
if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm))
Configuration Options
Ultravox API (/api/calls) Parameters
RealtimeModel(
model_id="fixie-ai/ultravox", # Model to use (warn + pass-through if unknown)
voice="Mark", # Voice to use (warn + pass-through if unknown)
api_key=None, # API key (defaults to env var)
base_url=None, # API base URL (defaults to Ultravox API)
system_prompt="You are helpful.", # System prompt
input_sample_rate=16000, # Input audio sample rate
output_sample_rate=24000, # Output audio sample rate
client_buffer_size_ms=60, # Audio buffer size (min 200ms used on WS)
http_session=None, # Custom HTTP session
)
Notes:
- Unknown models/voices: the plugin logs a warning and sends them as-is; the server validates.
- Metrics: the plugin emits a single `metrics_collected` event per generation. To log them,
add a listener in your app and call the helper:
```python
from livekit.agents import metrics
@session.on("metrics_collected")
def on_metrics_collected(ev):
metrics.log_metrics(ev.metrics)
1.5.1
Mar 23, 2026
1.5.0
Mar 19, 2026
1.5.0rc2
Mar 06, 2026
1.5.0rc1
Feb 13, 2026
1.4.6
Mar 16, 2026
1.4.5
Mar 11, 2026
1.4.4
Mar 03, 2026
1.4.3
Feb 23, 2026
1.4.2
Feb 17, 2026
1.4.1
Feb 06, 2026
1.4.0rc2
Jan 23, 2026
1.4.0rc1
Dec 23, 2025
1.3.12
Jan 21, 2026
1.3.11
Jan 14, 2026
1.3.10
Dec 23, 2025
1.3.9
Dec 19, 2025
1.3.8
Dec 17, 2025
1.3.7
Dec 16, 2025
1.3.6
Dec 03, 2025
1.3.5
Nov 25, 2025
1.3.4
Nov 24, 2025
1.3.3
Nov 19, 2025
1.3.2
Nov 17, 2025
1.3.1
Nov 17, 2025
1.3.0rc2
Nov 15, 2025
1.3.0rc1
Nov 06, 2025
1.2.18
Nov 05, 2025
1.2.17
Oct 29, 2025
1.2.16
Oct 27, 2025
1.2.15
Oct 15, 2025
1.2.14
Oct 01, 2025
1.2.13
Oct 01, 2025
1.2.12
Sep 29, 2025
1.2.11
Sep 18, 2025
1.2.9
Sep 15, 2025
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
livekit-agents[codecs]
(>=1.5.1)