future-shampoo-29056
10/10/2025, 2:57 AMtall-airline-16756
10/10/2025, 2:57 AMtall-airline-16756
10/10/2025, 2:57 AMListenIP and LocalNet settings in your SIP service configuration to ensure they’re correctly set.
• Jitter Buffer or RTP Misconfiguration: Please verify that EnableJitterBuffer is enabled (set to true) in your SIP configuration. Taking a look at your logs for any RTP-related errors can provide helpful clues too.
• Agent-to-Agent Speech Detection: Make sure your agents are set up to detect and process speech from other agents in the same room by updating the RoomInputOptions.
• Unsubscribed Audio Tracks: Sometimes, there can be delays in subscribing to audio tracks. Checking your logs for any subscription delays and ensuring all participants are fully connected before expecting audio can make a difference.
• Audio Timeout Interruptions: During testing, try simulating audio activity to prevent media timeouts that might interrupt the audio flow.
If you’d like, we can dig deeper together by reviewing your SIP and agent configurations or examining any specific errors in your logs, such as cannot create opus decoder or media timeout. Just let me know how I can assist you further—I’m here to help!
Sources: LiveKit Docs | pkg/sip/room.go | How to Enable Agent-to-Agent Speech Detection in LiveKit | CHANGELOG.md | SIP troubleshooting guide | LiveKit Docsfuture-shampoo-29056
10/10/2025, 2:58 AMtall-airline-16756
10/10/2025, 2:59 AMfuture-shampoo-29056
10/10/2025, 3:48 AMtall-airline-16756
10/10/2025, 3:49 AMSTTMetrics, LLMMetrics, and TTSMetrics that provide useful details such as duration, time to first token (TTFT), and time to first byte (TTFB). You can subscribe to metrics_collected events to easily access these metrics.
• Custom Timing: If you’re working on a custom implementation, a great way is to wrap your processing logic with timestamp checks using time.time() or asyncio.get_event_loop().time(). Logging or emitting the time difference for each step can really help track performance.
• Advanced Observability: For a more comprehensive view, enabling OpenTelemetry allows trace-based observability of the entire agent lifecycle, including custom nodes. This is fantastic for capturing execution flow and spotting any performance bottlenecks.
If you’d like, I’m here to help you implement timing in a specific node or assist with integrating a monitoring tool. Just let me know!
Sources: metrics/send-metrics-to-3p/send_metrics_to_3p.py | Pipeline nodes and hooks | LiveKit Docs | Logs, metrics, and telemetry | LiveKit Docs | agents/src/metrics/base.tsfuture-shampoo-29056
10/10/2025, 4:03 AMtall-airline-16756
10/10/2025, 4:04 AMAgentSession. You can make use of the handy built-in STTMetrics, which includes a duration field showing the time (in seconds) it took to create the transcript after processing the audio input. You can find these metrics through the session.metrics object.
For streaming STT, since the duration metric doesn’t quite apply, a good approach is to set up some custom timing by:
• Tracking when audio chunks are sent to the STT service.
• Noting the timestamps when you receive transcript responses (whether interim or final).
• Calculating the time difference between the audio input and the transcript response to understand the processing latency.
If you’d like, I’m here to help you implement this timing logic or guide you through accessing the STTMetrics in your session. Just let me know!
Sources: Community & Support | livekit/livekit_composite | DeepWiki | livekit-agents/livekit/agents/voice/agent.py | Logs, metrics, and telemetry | LiveKit Docsfuture-shampoo-29056
10/10/2025, 4:05 AMtall-airline-16756
10/10/2025, 4:05 AMSTTMetrics to measure the time taken for STT processing in your `AgentSession`:
from livekit import AgentSession
from livekit.stt import google
# Initialize the AgentSession with Google STT
session = AgentSession(
stt=google.STT(
model="telephony",
languages="ja-JP",
spoken_punctuation=False,
)
)
# Define a callback to handle STT metrics
def on_stt_metrics(metrics):
print(f"STT processing duration: {metrics.duration} seconds")
print(f"Audio duration: {metrics.audio_duration} seconds")
# Subscribe to the metrics_collected event for STT
session.stt.on("metrics_collected", on_stt_metrics)
# Start the session (example usage)
session.start()
# Perform your operations here...
# Stop the session when done
session.stop()
In this example:
• The on_stt_metrics function is called whenever STT metrics are collected.
• You can access the duration (time taken for processing) and audio_duration (length of the input audio) from the metrics object.
• Ensure that the session is started and stopped properly to collect metrics during its lifecycle.
If you have any questions or need a bit more help with this, please feel free to ask. I’m here to support you every step of the way!future-shampoo-29056
10/10/2025, 4:12 AMtall-airline-16756
10/10/2025, 4:13 AMmetrics_collected event listener is set up correctly on your STT instance. Here’s a quick example:
def on_stt_metrics(metrics):
print(f"STT processing duration: {metrics.duration} seconds")
print(f"Audio duration: {metrics.audio_duration} seconds")
session.stt.on("metrics_collected", on_stt_metrics)
• STT Not Processing Audio: Make sure that audio is actually being captured and sent properly to the STT service.
• Google STT Configuration: It’s also a good idea to confirm that your Google Cloud credentials are set up and authenticated correctly.
• Logging Configuration: Finally, check that your logging level is configured to show the metrics. For example:
import logging
logging.basicConfig(level=logging.INFO)
If you’d like, I’m happy to walk through these steps with you or help troubleshoot further. Just let me know!
Sources: metrics/metrics_tts.py | Logs, metrics, and telemetry | LiveKit Docs | Google Cloud STT plugin guide | LiveKit Docsfuture-shampoo-29056
10/10/2025, 4:29 AMtall-airline-16756
10/10/2025, 4:30 AMlog_metrics helper function that makes formatting and logging metrics for each type super easy. Let me walk you through how you can use it in your code:
from livekit.agents import metrics, MetricsCollectedEvent
# Set up the session with Google STT
session = AgentSession(
stt=google.STT(
model="telephony",
languages="ja-JP",
spoken_punctuation=False,
)
)
# Use the log_metrics helper to log all collected metrics
@session.on("metrics_collected")
def _on_metrics_collected(ev: MetricsCollectedEvent):
metrics.log_metrics(ev.metrics)
# Start the session
session.start()
# Perform your operations here...
# Stop the session when done
session.stop()
This will take care of logging all metrics, including the STT ones, in a neat and formatted way. If you have any questions or need a bit more help, just let me know—I’m here for you!