Thanks for reaching out! I understand that latency can be a bit tricky since it varies depending on things like network distance and how the service endpoint is performing. While there isn't a fixed latency value for LangChain LLM integration, LiveKit offers some great tools to help you measure it. One helpful metric is the
Time To First Token (TTFT), which shows how long it takes for the LLM to start streaming a response. The best part is, this is automatically collected and reported as part of the LLMMetrics during response processing.
If you're looking to optimize or keep an eye on latency, you can also use the
Agents Metrics API to gather performance data and measure network latency to the LLM service endpoint. Feel free to reach out if you'd like some guidance on how to use these tools—I’m here to help!
Sources:
Getting Help & Troubleshooting | livekit/livekit_composite | DeepWiki |
livekit-agents/livekit/agents/inference/llm.py