Is deploying on LK cloud the same thing as inferen...
# ask-ai
l
Is deploying on LK cloud the same thing as inference from livekit?
t
Thanks for reaching out, James. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking whether deploying on LiveKit Cloud is the same as doing inference with LiveKit. Short answer: no — they’re related but distinct. • Deploying on LiveKit Cloud = hosting and running your realtime apps/agents on LiveKit’s managed infrastructure (media routing, agent execution, telephony, recording, scaling, etc.). • LiveKit Inference = a specific service within LiveKit that provides AI model access (STT, LLM, TTS) via a unified API for agents to call during sessions. Relationship: when you deploy an agent on LiveKit Cloud it can use LiveKit Inference to handle model calls, but you can also deploy agents that use other model providers or no inference at all. Would you like examples of configuring an AgentSession to use LiveKit Inference or guidance for using a third‑party model provider instead? Sources: Deploying to production | LiveKit Docs | Introducing LiveKit Inference: A unified model interface for voice AI | Models | LiveKit Docs | LiveKit Cloud | LiveKit Docs | LiveKit Cloud billing | LiveKit docs
l
Yes
t
Great — I'll show both options: (A) quick AgentSession examples using LiveKit Inference, and (B) using a third‑party provider via a plugin. Which language do you want the code in: Python or Node.js? Sources: Models | LiveKit Docs | LiveKit Cloud | LiveKit Docs | Intro to LiveKit | LiveKit docs | LiveKit Pricing | AssemblyAI STT | LiveKit Docs
l
Python
t
Responding to your request for Python examples — below are concise examples for (A) using LiveKit Inference and (B) using a third‑party provider via a plugin. A — Using LiveKit Inference (built‑in unified model gateway)
Copy code
from livekit.agents import AgentSession

session = AgentSession(
    stt="assemblyai/universal-streaming:en",
    llm="openai/gpt-4.1-mini",
    tts="cartesia/sonic-3:9626c31c-bec5-4cca-baa8-f8ba9e84c8bc",
)
# Use session.start() / session.run() per your app flow
B — Using a third‑party provider (OpenAI plugin example) 1. Install plugin:
Copy code
uv add "livekit-agents[openai]~=1.2"
1. Configure session in Python:
Copy code
from livekit.agents import AgentSession
from livekit.plugins import openai

session = AgentSession(
    stt=openai.STT(model="whisper-1"),
    llm=openai.LLM(model="gpt-4o"),
    tts=openai.TTS(model="tts-1", voice="alloy"),
)
# Ensure your OpenAI API key is set in environment vars
Notes: • LiveKit Inference requires no extra provider keys; plugin usage requires setting provider credentials (e.g., OPENAI_API_KEY). • You can mix: e.g.,
stt
via LiveKit Inference string and
llm
via a plugin object. Would you like a full runnable example (session lifecycle, start/stop, or handling transcripts) or help picking model IDs?
l
Where to check the usage if inference?
t
You can view LiveKit Inference usage in the LiveKit Cloud dashboard. • Open your project at https://cloud.livekit.io. • Go to Usage and limits to see breakdowns for LLM, STT, and TTS consumption and quotas. • Use Agent observability to monitor real‑time inference activity and session-level metrics. If you want programmatic access or custom reports, I can show how to use the
UsageCollector
in the Agents SDK—would you like a short example? Sources: Deploying to production | LiveKit Docs | Observability data hooks | LiveKit docs