`LLMModelUsage`, `TTSModelUsage`, `STTModelUsage` ...
# ask-ai
b
LLMModelUsage
,
TTSModelUsage
,
STTModelUsage
on which event does these usage class emitted
✅ 1
t
Thanks for reaching out, Jura. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about which event emits the
LLMModelUsage
,
TTSModelUsage
, and
STTModelUsage
classes. • These usage classes are included in the payload of the MetricsCollected event. • Event name:
MetricsCollected
• Payload type:
MetricsCollectedEvent
(contains
llm_usage
,
tts_usage
,
stt_usage
/
LLMModelUsage
,
TTSModelUsage
,
STTModelUsage
) • When it’s emitted: during an AgentSession’s Running phase — periodically after model inference or when a processing stage completes (for example, after an LLM response, TTS generation, or STT transcription completes). If you’d like, I can: • Show a short code snippet for subscribing to
MetricsCollected
in your SDK (Node.js or Python). • Explain the specific fields included in each usage class (TTFT, token counts, audio duration, etc.). Which would you prefer? Sources: Agents (Node.js) | livekit/livekit_composite | DeepWiki | Deepgram STT | LiveKit Documentation | Agent session | LiveKit Documentation | LLM Metrics | LiveKit Documentation, with interactive elements
b
MetricsCollected
is deprecating
t
Thanks — I’m following up on your note that
MetricsCollected
is deprecating and your earlier question about which event emits
LLMModelUsage
,
TTSModelUsage
, and
STTModelUsage
. Quick summary of what I can confirm: • Those usage classes were included in the
MetricsCollected
payload (
MetricsCollectedEvent
) and emitted during an AgentSession’s Running phase after model inference. • I do not have a confirmed replacement event or an official migration path in the sources I can access. To help you effectively, could you tell me one or both of the following: • Where you saw the deprecation notice (SDK/CLI output, a documentation page, or a compiler/runtime warning)? If it’s a docs page, a link or the exact wording would help. • Which SDK and version are you using (Node.js or Python, and the package version)? With that info I can: • Check whether a replacement event or new pattern is available for reporting
LLMModelUsage
,
TTSModelUsage
, and
STTModelUsage
. • Suggest a short-term workaround (for example, capturing usage directly at the model-call sites) if
MetricsCollected
is removed and no direct replacement exists. • Provide a code snippet for your SDK to help collect usage until we identify the new pattern. Which SDK/version and where you saw the deprecation message? Sources: LLM Metrics | LiveKit Documentation | STT Metrics | LiveKit Documentation | TTS Metrics | LiveKit Documentation | Build a multilingual voice agent that automatically switches languages | Li... | Agents (Python) | livekit/livekit_composite | DeepWiki, with interactive elements