full-terabyte-95216
02/17/2026, 10:55 AMtall-airline-16756
02/17/2026, 10:55 AMtall-airline-16756
02/17/2026, 10:55 AMlookup_product_catalog(query="red shoes")). This inference has its own generation latency (time to first token + generation).
2. Tool execution: the runtime parses the function call and invokes your tool (API, DB query, etc.). This includes network round-trip, backend processing, and response serialization.
3. Second LLM inference: the tool result is appended to the conversation/context and the LLM is called again to generate the final natural-language response using that data. This is a separate inference with its own latency.
4. Optional post-processing (e.g., TTS) if you convert text to audio — adds more latency.
Why total latency is higher
• Normal request = 1 LLM inference + minimal/no external calls → ~1s.
• Tool-call request = 2 LLM inferences + 1 external tool call (plus optional TTS) → additive latencies typically producing 2–4s total. The extra LLM pass and the external call are the primary contributors to the 3+ second difference.
Targeted ways to reduce e2e latency
• Reduce tool/backend latency:
◦ Add caching for product lookups (in-memory or CDN) to avoid long DB/external calls.
◦ Optimize queries (indexes, narrower payloads) or use a faster store for frequently-read data.
• Reduce LLM inference time:
◦ Use a faster/smaller model for the tool-decision or response generation steps where acceptable.
◦ Use models or settings that lower Time To First Token (TTFT).
• Avoid a full second LLM pass when possible:
◦ If the tool output is simple and deterministic, return a formatted response directly from the tool and skip the second LLM generation for some requests.
◦ Or have the model produce a concise structured reply which your application formats for the user without another full LLM call.
• Use streaming:
◦ Stream LLM tokens (or stream tool results) to overlap work and shave perceived latency.
• Instrumentation:
◦ Measure and break down latency into: first LLM inference, tool call time, second LLM inference, and any TTS. That shows exactly where your bottleneck is so optimizations target the right place.
If you’d like, tell me:
• Which parts you control (catalog DB, external API, both).
• Whether you can change models or add caching.
With that I can recommend the highest-impact optimization(s) and a simple plan to test latency improvements.
Sources: LLM Metrics | LiveKit Documentation | Tool definition and use | LiveKit Documentation | examples/voice_agents | livekit/livekit_composite | DeepWikifull-terabyte-95216
02/17/2026, 11:02 AMtall-airline-16756
02/17/2026, 11:02 AMfull-terabyte-95216
02/17/2026, 11:06 AMtall-airline-16756
02/17/2026, 11:06 AM