Refines default behavior for preemptive generation to better handle long or intermittent user speech, reducing unnecessary downstream inference and associated cost increases.
Also introduces PreemptiveGenerationOptions for developers who need fine-grained control over this behavior.
class PreemptiveGenerationOptions(TypedDict, total=False):
"""Configuration for preemptive generation."""
enabled: bool
"""Whether preemptive generation is enabled. Defaults to ``True``."""
preemptive_tts: bool
"""Whether to also run TTS preemptively before the turn is confirmed.
When ``False`` (default), only LLM runs preemptively; TTS starts once the
turn is confirmed and the speech is scheduled."""
max_speech_duration: float
"""Maximum user speech duration (s) for which preemptive generation
is attempted. Beyond this threshold, preemptive generation is skipped
since long utterances are more likely to change and users may expect
slower responses. Defaults to ``10.0``."""
max_retries: int
"""Maximum number of preemptive generation attempts per user turn.
The counter resets when the turn completes. Defaults to ``3``."""
Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.5.3...livekit-agents@1.5.4
Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.5.2...livekit-agents@1.5.3
[!NOTE]
livekit-agents 1.5 introduced many new features. You can check out the changelog here.
generate_reply timeout to 10 seconds by @qionghuang6 in https://github.com/livekit/agents/pull/5205min_words_to_interrupt to Phonic plugin options by @qionghuang6 in https://github.com/livekit/agents/pull/5304Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.5.1...livekit-agents@1.5.2
[!NOTE]
livekit-agents 1.5 introduced many new features. You can check out the changelog here.
Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.5.0...livekit-agents@1.5.1
The headline feature of v1.5.0: an audio-based ML model that distinguishes genuine user interruptions from incidental sounds like backchannels ("mm-hmm"), coughs, sighs, or background noise. Enabled by default — no configuration needed.
Key stats:
When a false interruption is detected, the agent automatically resumes playback from where it left off — no re-generation needed.
To opt out and use VAD-only interruption:
session = AgentSession(
...
turn_handling=TurnHandlingOptions(
interruption={
"mode": "vad",
},
),
)
Blog post: https://livekit.com/blog/adaptive-interruption-handling
Endpointing delays now adapt to each conversation's natural rhythm. Instead of a fixed silence threshold, the agent uses an exponential moving average of pause durations to dynamically adjust when it considers the user's turn complete.
session = AgentSession(
...
turn_handling=TurnHandlingOptions(
endpointing={
"mode": "dynamic",
"min_delay": 0.3,
"max_delay": 3.0,
},
),
)
TurnHandlingOptions APIEndpointing and interruption settings are now consolidated into a single TurnHandlingOptions dict passed to AgentSession. Old keyword arguments (min_endpointing_delay, allow_interruptions, etc.) still work but are deprecated and will emit warnings.
session = AgentSession(
turn_handling={
"turn_detection": "vad",
"endpointing": {"min_delay": 0.5, "max_delay": 3.0},
"interruption": {"enabled": True, "mode": "adaptive"},
},
)
New SessionUsageUpdatedEvent provides structured, per-model usage data — token counts, character counts, and audio durations — broken down by provider and model:
@session.on("session_usage_updated")
def on_usage(ev: SessionUsageUpdatedEvent):
for usage in ev.usage.model_usage:
print(f"{usage.provider}/{usage.model}: {usage}")
Usage types: LLMModelUsage, TTSModelUsage, STTModelUsage, InterruptionModelUsage.
You can also access aggregated usage at any time via the session.usage property:
usage = session.usage
for model_usage in usage.model_usage:
print(model_usage)
Usage data is also included in SessionReport (via model_usage), so it's available in post-session telemetry and reporting out of the box.
ChatMessage.metricsEach ChatMessage now carries a metrics field (MetricsReport) with per-turn latency data:
transcription_delay — time to obtain transcript after end of speechend_of_turn_delay — time between end of speech and turn decisionon_user_turn_completed_delay — time in the developer callbackContext summarization now includes function calls and their outputs when building summaries, preserving tool-use context across the conversation window.
Set the agent log level via LIVEKIT_LOG_LEVEL environment variable or through ServerOptions, without touching your code.
| Deprecated | Replacement | Notes |
|---|---|---|
metrics_collected event | session_usage_updated event + ChatMessage.metrics | Usage/cost data moves to session_usage_updated; per-turn latency moves to ChatMessage.metrics. Old listeners still work with a deprecation warning. |
UsageCollector | ModelUsageCollector | New collector supports per-model/provider breakdown |
UsageSummary | LLMModelUsage, TTSModelUsage, STTModelUsage | Typed per-service usage classes |
RealtimeModelBeta | RealtimeModel | Beta API removed |
AgentFalseInterruptionEvent.message / .extra_instructions | Automatic resume via adaptive interruption | Accessing these fields logs a deprecation warning |
AgentSession kwargs: min_endpointing_delay, max_endpointing_delay, allow_interruptions, discard_audio_if_uninterruptible, min_interruption_duration, min_interruption_words, turn_detection, false_interruption_timeout, resume_false_interruption | turn_handling=TurnHandlingOptions(...) | Old kwargs still work but emit deprecation warnings. Will be removed in v2.0. |
Agent / AgentTask kwargs: turn_detection, min_endpointing_delay, max_endpointing_delay, allow_interruptions | turn_handling=TurnHandlingOptions(...) | Same migration path as AgentSession. Will be removed in future versions. |
generate_reply to resolve with the current GenerationCreatedEvent by @qionghuang6 in https://github.com/livekit/agents/pull/5147Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.4.6...livekit-agents@1.5.0
null in enum array for nullable enum schemas by @MSameerAbbas in https://github.com/livekit/agents/pull/5080required field in tool schema when function has no parameters by @longcw in https://github.com/livekit/agents/pull/5082Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.4.5...livekit-agents@1.4.6
generate_reply and update_chat_ctx support to Phonic Plugin by @qionghuang6 in https://github.com/livekit/agents/pull/5058Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.4.4...livekit-agents@1.4.5
agent_worker.py by @kradkfl in https://github.com/livekit/agents/pull/4970Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.4.3...livekit-agents@1.4.4
Full Changelog: https://github.com/livekit/agents/compare/browser-v0.1.4...livekit-agents@1.4.3
Stability-focused release with significant reliability improvements. Fixes multiple memory leaks in the process pool — job counter leaks on cancellation, pending assignment leaks on timeout, socket leaks on startup failure, and orphaned executors on send failure. IPC pipeline reliability has been improved, and several edge-case hangs have been resolved (participant never joining, Ctrl+C propagation to child processes). STT/TTS fallback behavior is now more robust: STT fallback correctly skips the main stream during recovery, and TTS fallback no longer shares resamplers across streams. Other fixes include ChatContext.truncate no longer dropping developer messages, correct cgroups v2 CPU quota parsing, proper on_session_end callback ordering, and log uploads even when sessions fail to start. Workers now automatically reject jobs when draining or full, and the proc pool correctly spawns processes under high load.
RecordingOptions APIThe record parameter on AgentSession.start() now accepts granular options in addition to bool. All keys default to True when omitted.
# record everything (default)
await session.start(agent, record=True)
# record nothing
await session.start(agent, record=False)
# granular: record audio but disable traces, logs, and transcript
await session.start(agent, record={"audio": True, "traces": False, "logs": False, "transcript": False})
Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.4.0...livekit-agents@1.4.2
CEF native binaries for livekit-browser v0.1.3. Supports Python 3.12-3.14 on macOS arm64, Linux x64, and Linux arm64.
CEF native binaries for livekit-browser v0.1.2. Supports Python 3.12-3.14 on macOS arm64, Linux x64, and Linux arm64.
This release adds Python 3.14 support and drops Python 3.9. The minimum supported version is now Python 3.10.
Tools and toolsets now have stable unique IDs, making it possible to reference and filter tools programmatically. Changes to agent configuration (instructions, tools) are now tracked in conversation history via AgentConfigUpdate.
LLMStream.collect() APIA new LLMStream.collect() API makes it significantly easier to use LLMs outside of AgentSession. You can now call an LLM, collect the full response, and execute tool calls with a straightforward API — useful for background tasks, pre-processing, or any workflow where you need LLM capabilities without the full voice agent pipeline.
from livekit.agents import llm
response = await my_llm.chat(chat_ctx=ctx, tools=tools).collect()
for tc in response.tool_calls:
result = await llm.execute_function_call(tc, tool_ctx)
ctx.insert(result.fnc_call)
if result.fnc_call_out:
ctx.insert(result.fnc_call_out)
Realtime models now support commit_user_turn, enabling turn_detection="manual" mode. This gives you full control over when user turns are committed — useful for push-to-talk interfaces or scenarios where automatic VAD-based turn detection isn't ideal.
@ctx.room.local_participant.register_rpc_method("end_turn")
async def end_turn(data: rtc.RpcInvocationData):
session.input.set_audio_enabled(False)
session.commit_user_turn(
transcript_timeout=10.0,
stt_flush_duration=2.0,
)
When the agent server temporarily loses connection and reconnects, active jobs are now automatically migrated rather than being dropped. This significantly improves reliability during transient network issues.
Fixed a bug where late end-of-speech events could trigger duplicate false interruption timers, causing the agent to incorrectly stop speaking. The agent now properly deduplicates these events and tracks STT completion state more reliably.
xai.responses.LLM()azure.responses.LLM(), with support for deployments and Azure authid to tools by @theomonnom in https://github.com/livekit/agents/pull/4653AgentConfigUpdate & initial judges by @theomonnom in https://github.com/livekit/agents/pull/4547LLMStream.collect API & external easier tool executions by @theomonnom in https://github.com/livekit/agents/pull/4680Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.3.12...livekit-agents@1.4.0
Worker.aclose raising RuntimeError by @theomonnom in https://github.com/livekit/agents/pull/4523Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.3.11...livekit-agents@1.3.12
transport_type type in MCPServer by @theomonnom in https://github.com/livekit/agents/pull/4375Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.3.10...livekit-agents@1.3.11
This release brings the ability to use tools that are specific to model providers with provider tools. You can now mix & match function tools and provider tools in your agent by specifying Agent(tools=[..]).
For those that were using the experimental _gemini_tools parameter with Google LLMs, that experimental parameter has been removed in favor of provider tools. See usage example here.
Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.3.9...livekit-agents@1.3.10
livekit-durable functions by @theomonnom in https://github.com/livekit/agents/pull/4272livekit-durable cibw by @theomonnom in https://github.com/livekit/agents/pull/4324Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.3.8...livekit-agents@1.3.9
Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.3.7...livekit-agents@1.3.8
JobRequest.reject by @theomonnom in https://github.com/livekit/agents/pull/4172nvidia optional dependency by @davidzhao in https://github.com/livekit/agents/pull/4264Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.3.6...livekit-agents@1.3.7
AgentHandoff unable to serialize and then deserialize [ONE-LINER] by @slado122 in https://github.com/livekit/agents/pull/4160Full Changelog: https://github.com/livekit/agents/compare/livekit-agents@1.3.5...livekit-agents@1.3.6