LiveKitBudgetGuard (integrations/livekit.py)

floe-guard · src/floe_guard/integrations/livekit.py · python · MIT
voice

LiveKit Agents adapter (optional extra: ``pip install floe-guard[livekit]``). Like Pipecat, a LiveKit ``AgentSession`` (STT -> LLM -> TTS) has no single call site to wrap: turns fire for the life of a call. The two enforcement points are the agent's ``llm_node`` (before the LLM c

# Source: https://github.com/Floe-Labs/floe-guard | License: MIT | Copyright 2026 Floe Labs
# Provided via justclaw.it.com; keep this notice with the code.
"""LiveKit Agents adapter (optional extra: ``pip install floe-guard[livekit]``).

Like Pipecat, a LiveKit ``AgentSession`` (STT -> LLM -> TTS) has no single call
site to wrap: turns fire for the life of a call. The two enforcement points are
the agent's ``llm_node`` (before the LLM call, so a turn is blocked before its
TTS/audio spend piles on) and each component's ``metrics_collected`` event —
the LLM/STT/TTS plugins each emit their real usage right after doing their work.
(The session-level ``metrics_collected`` event was deprecated in
``livekit-agents`` 1.5; the per-component event carries the same per-turn metric
object and is not d

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key