What is the average hourly cost for livekit agents...
# ask-ai
a
What is the average hourly cost for livekit agents hosted in the cloud?
t
Thanks for reaching out, David. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're looking for the average hourly cost for LiveKit agents hosted in the cloud — it's $0.60 per hour (charged at $0.01 per agent session minute). This covers hosting across LiveKit's global data centers, unlimited data transfer to/from the agent, and observability/analytics. Additional charges may apply for inference credits (STT/LLM/TTS), observability events/recordings, and telephony minutes. Would you like a breakdown for a specific usage pattern (concurrent agents, monthly hours, or expected inference usage)? Sources: Deploy and scale agents on LiveKit Cloud | LiveKit Pricing
a
No matter the combination its always above a dollar for me. Is there anyway i can significantly reduce it?
t
Thanks — I hear you: your bill stays above $1/hr despite the per-minute rates shown. I can help reduce it. A few targeted actions that commonly cut costs: • Switch to lower‑cost LLM/STT/TTS providers or smaller models (e.g., cheaper LLM model, lower‑latency STT/TTS tier). • Reduce agent session minutes: keep agents idle/standby instead of continuously warm when traffic is low, or scale warm agents to match peak concurrency. • Lower WebRTC data usage: reduce bitrate, disable video, or use audio‑only connections where possible. • Batch or limit inference usage: reduce frequency of calls to LLM/STT/TTS, cache responses, or do on-device preprocessing to avoid unnecessary inference. • Move recordings/observability retention to lower tiers or reduce retention frequency/quality. • Consider self‑hosting agents if your scale and operational capacity make that cheaper than hosted rates. To give concrete savings estimates, can you tell me: 1) Typical concurrent agents and average session length (minutes)? 2) Which LLM, STT, and TTS providers/models you’re using now? 3) Whether you’re using video or audio‑only, and if recordings/extended observability are enabled? Tell me those and I’ll calculate targeted changes and estimated hourly savings.
a
Average session minutes is 45 minutes I am using gpt4o-mini, assembly streaming and inworld max. I am using audio only
t
Thanks — you're using 45‑minute audio‑only sessions with GPT‑4o‑mini, AssemblyAI streaming STT, and Inworld Max TTS. Your current cost is dominated by LLM output tokens. To significantly reduce costs, try this focused plan: 1. Switch to a much cheaper LLM ◦ Use a nano/ cheaper model (e.g.,
gpt-4.1-nano
or similar) — output token price is ~75% lower than GPT-4o‑mini. ◦ Impact: largest single drop in per‑session cost. 1. Reduce LLM output tokens ◦ Enforce concise responses in prompts (e.g., “one sentence,” “max 30 tokens”). ◦ Use streaming and send only necessary context; truncate long history or summarize prior context before sending. ◦ Cache common responses or use templates for repeated flows. 1. Lower STT/TTS spend ◦ Verify AssemblyAI streaming and Inworld Max are the best fit—AssemblyAI is already low; consider lower‑cost STT tiers if available. ◦ For TTS, switch to a lower‑cost voice/model or use shorter/generated replies (fewer characters). In many cases TTS cost is minor once LLM output is reduced. 1. Reduce agent session time where possible ◦ End sessions automatically after inactivity or use voice activity detection to avoid charging while idle. ◦ Batch user interactions where appropriate so the agent is active only while needed. 1. Combine optimizations for best effect ◦ Example estimate: switching to a cheaper LLM + halving output length can cut LLM output cost ~75% → total session cost may fall from ~$11 to ~$3–$4 (majority saved from LLM reductions). If you want, I can: • Recalculate a precise per‑session and per‑hour estimate using a specific cheaper LLM choice and a target average reply length (tokens or characters). • Suggest exact prompt templates to enforce brevity or sample settings for VAD/inactivity timeout to reduce idle minutes. Which would you like me to do next — run a cost estimate for a particular cheaper model + a target average reply length, or provide concise prompt templates and session timeout recommendations? Sources: LiveKit Pricing | Build voice, video, and physical AI | LiveKit | Towards a future-aligned pricing model | LiveKit Use-cases: Livestreaming | Live Conversations with AI using ChatGPT and WebRTC
a
How do i implement voice activity detection to avoid charging while idle
t
You're asking how to implement voice activity detection (VAD) so you stop paying for STT/LLM/TTS while users are silent. Below are concise, actionable steps using LiveKit's recommended Silero VAD, plus optional timeouts to fully disconnect on long silence. 1) Install the Silero VAD plugin • Python:
Copy code
uv add "livekit-agents[silero]~=1.2"
• Node.js:
Copy code
pnpm install @livekit/agents-plugin-silero
2) Download model weights before starting agents • Python:
Copy code
uv run agent.py download-files
• Node.js:
Copy code
pnpm run download
3) Load VAD into your AgentSession • Python:
Copy code
from livekit.plugins import silero

session = AgentSession(
    vad=silero.VAD.load(),
    # stt, tts, llm, ...
)
• Node.js:
Copy code
import * as silero from '@livekit/agents-plugin-silero';

const session = new voice.AgentSession({
  vad: await silero.VAD.load(),
  // stt, tts, llm, ...
});
4) Use VAD to gate downstream services • Only start STT when VAD indicates speech started. • Stop sending audio to STT while VAD indicates silence. • Delay LLM calls until end-of-turn (use
min_silence_duration
, default 0.55s). • Skip TTS if response would be empty or trivial. 5) Configure silence thresholds and debounce •
min_silence_duration
controls how long silence must persist before ending a turn (tune to avoid chopping short pauses). • Use a short debounce (e.g., 0.4–0.8s) to avoid toggling on brief breaths. 6) Optional: end or disconnect long-idle sessions • Track last voice activity timestamp; if silence > SILENCE_TIMEOUT (e.g., 60–300s), either: ◦ stop the agent and release resources, or ◦ disconnect the user session. • Example logic (pseudo):
Copy code
if now - last_spoke > SILENCE_TIMEOUT:
    await ctx.room.disconnect()
7) Prewarm VAD for faster startup (optional) • Load VAD model in a server prewarm hook and reuse for sessions to reduce cold-start latency. 8) Monitoring and safety nets • Log VAD events (start/stop) to measure how often STT/LLM/TTS are prevented. • Gradually tune thresholds while monitoring user experience and cost impact. Important note: agent session minutes ($0.01/min) still count while the agent is active, but VAD prevents the larger per-use costs (STT, LLM, TTS) by blocking unnecessary processing during silence. Would you like a short sample that shows gating STT + LLM calls on VAD events in your chosen language (Python or Node.js)? Sources: Silero VAD plugin | LiveKit docs | How to detect and handle silence during calls | Deploy and scale agents on LiveKit Cloud | Turn detection and interruptions | LiveKit Docs