nice-room-70150
10/29/2025, 6:32 PMtall-airline-16756
10/29/2025, 6:32 PMtall-airline-16756
10/29/2025, 6:32 PMSTTMetrics object to see how long speech recognition takes, including duration (processing time) and audio_duration (input length).
• LLM Latency: The LLMMetrics object helps you capture ttft (time to first token) and duration (total response time).
• Text-to-Speech (TTS) Latency: With the TTSMetrics object, you can measure ttfb (time to first byte) and duration (synthesis time).
On top of that, you can keep an eye on end-to-end latency using metrics like end_of_utterance_delay and transcription_delay. These are accessible through the Python or JavaScript SDKs via the AgentSession object or event listeners.
If you’d like, I’m here to help with more details or even some examples to get you started—just let me know!
Sources: Logs, metrics, and telemetry | LiveKit Docs | Troubleshooting & Common Issues | livekit/livekit_composite | DeepWiki | Operational Guidance & Best Practices | livekit/livekit_composite | DeepWik... | examples/voice_agents/realtime_turn_detector.py | agents/src/voice/agent_activity.tsnice-room-70150
10/29/2025, 6:35 PMtall-airline-16756
10/29/2025, 6:35 PMmetrics.log_metrics(ev.metrics). This usually means that there hasn’t been any meaningful activity during the agent session to produce measurable data. Let’s walk through a few examples together:
• LLM Metrics: Values like ttft and tokens_per_second will only show up when the LLM actually generates a response.
• TTS Metrics: Metrics such as ttfb and audio_duration need the agent to synthesize speech to be recorded.
• STT Metrics: These, like audio_duration, depend on the user’s audio input being transcribed.
Here are a few things to double-check:
1. Make sure your AgentSession is correctly set up with STT, LLM, and TTS services.
2. Confirm the session is actively handling media or interactions — for example, the user is speaking or the agent is responding.
3. Verify that your logging level is set to capture INFO-level metric logs.
For debugging, try to see if the metrics_collected event is being triggered. Also, check that the agent is processing audio or generating responses as expected. You can inspect the metrics using the UsageCollector. If you still find metrics showing zero despite activity, it might be helpful to review your model configurations and the agent’s execution flow for any issues.
Sources: livekit-agents/livekit/agents/metrics/utils.py | Logs, metrics, and telemetry | LiveKit Docs