
operating-livekit-agents
Deploys and operates a LiveKit agent in production: shipping a version to LiveKit Cloud and rolling it back, secrets and configuration, the worker process model and prewarming, safe async inside worker processes, provider timeouts and degradation, graceful shutdown, SDK upgrades, and observability. Use when the user says "deploy my agent", "roll back the deployment", "tail the agent logs", "the first call after a restart is slow", "attached to a different loop / event loop is closed", "prewarm the VAD", "shut down without dropping calls", "upgrade livekit-agents safely", "correlate logs by session", or is changing an agent codebase that is already live. Not for designing the agent (building-livekit-agents) or reproducing one bad conversation locally (debugging-livekit-agents).
- Installs
- 381
- Last 24h
- +10
- Trending rank
- #8782
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/livekit/agent-skills --skill operating-livekit-agents- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads operating-livekit-agents automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Operating LiveKit agents
Everything after the agent works: getting a version onto LiveKit Cloud, keeping it fast and alive
under real load, and changing it without breaking what's already running. The commands live under
lk agent; read lk agent --help and each subcommand's help rather than trusting this skill for
flags — it deliberately doesn't restate them. reading-livekit-docs has the deployment and
observability docs.
Deploying to LiveKit Cloud
The shape is stable even as the flags move:
- A project directory is bound to an agent by a config file the CLI writes (
livekit.toml). Commands run from that directory find the agent without an id. - The agent ships as a container. The CLI can generate a Dockerfile for the project, or you
bring a prebuilt image. Run the container's start command locally (
lk agent start) before the first deploy — it's production mode, with production logging and a shutdown drain, and it is not whatdevmode runs. - Each deploy creates a version and rolls it out.
status,versions, andlogs(build logs and deploy logs are separate) tell you what's live and why a rollout failed. - Secrets are injected as environment variables and managed apart from the code — never baked into the image or committed. Changing secrets restarts the agent.
- Rollback returns to a previous version. How instant that is depends on the plan; the docs say. Know the rollback command before you need it.
After a deploy, verify with the same tools you'd use on a stranger's agent: status for the
rollout, logs for the first minutes, and a real conversation — running-livekit-simulations can
run a scenario file against the deployed agent by name, which is the cheapest end-to-end check that
the thing serving traffic is the thing you meant to ship.
The worker process model
Both SDKs run sessions in worker processes spawned from a parent. Misunderstanding this is the single most common source of production-only bugs.
The parent prewarms; children inherit. Load expensive, read-only resources — VAD and turn detection models, persistent clients — once in the parent through the SDK's prewarm hook, and each session inherits them without re-loading. Everything shared this way must be read-only or concurrency-safe; mutating parent state from a child is undefined behavior. Don't prewarm session-specific state, and don't prewarm what costs more memory than it saves — every byte in the parent is in every child's footprint. Then verify the child actually uses the prewarmed instance: the classic mistake is prewarming a model and having session code load a fresh one anyway, so the prewarm did nothing and startup is still slow.
The framework owns the event loop. Never create a new async runtime inside a worker, and never
block on an async call from a synchronous constructor to force a result. If initialization needs
async work, load lazily on first use from an already-async method, or split construction from an
awaited initialize step. When you see errors about events bound to a different loop, a loop
already running, tasks destroyed while pending, or a closed loop that can't be reused, the cause is
almost always one of those two things — trace back to where a runtime was created or a sync path
awaited something.
Providers
STT, TTS, LLM, VAD and any backend will fail in production: rate limits, timeouts, overload, outages. Set timeouts — a call that hangs is worse than one that fails fast. Distinguish transient failures worth retrying from persistent ones that need a fallback or escalation. Degrade to a meaningful spoken response, never to silence. Log provider response times, because rising latency is usually the first sign of an outage.
Adding a provider to an existing agent: check whether the SDK already has a plugin before writing one; follow how the codebase already initializes, configures, and handles errors for its other providers; run its config through the same pipeline; and test under realistic latency, not just happy-path responses.
Performance: measure before you change anything
The metric users feel is time to first audio — from the caller finishing to the agent starting to speak. Break it down before optimizing: connection, provider initialization, first inference, tool execution. Watch context growth over a long call; unbounded history means every turn is slower than the last.
The anti-patterns worth grepping for:
- Synchronous I/O in an async context. One blocking HTTP call or file read freezes audio for every concurrent operation in that process.
- Loading during a call — a model or connection established on first use inside a session is latency the caller hears. Move it to prewarm or session setup.
- Unbounded context with no summarization.
- Every tool registered globally regardless of conversation phase; each definition costs every LLM call.
Endpointing and turn detection are tuning parameters, not defaults to accept. Too aggressive and
the agent talks over people who pause to think; too conservative and every reply feels late. The
right setting depends on the use case — a support agent handling complex questions wants patience,
a quick-answer assistant wants speed. Measure with audio simulations (running-livekit-simulations
scores turn-taking and perceived latency) rather than by feel.
Shutdown and upgrades
In production mode the server drains on a termination signal: it stops taking new jobs, finishes active ones up to a drain timeout, then exits. Two things break this. An orchestrator grace period shorter than the drain timeout kills calls mid-sentence — match them. And post-call work (writing state, publishing events, finalizing recordings) that isn't tied to the job's lifecycle gets cut off — make sure it completes inside the drain. Dev mode has no drain, so shutdown behavior has to be tested in start mode.
The SDK moves fast and breaks things across versions. Pin the version. Read the changelog with
reading-livekit-docs before upgrading. Upgrade on a branch, run the test suite, then have real
conversations and run the simulation suite — some regressions only appear in actual dialogue. Watch
latency and error rates for the first hours after the deploy.
Observability
Three things make a production incident tractable instead of a mystery:
- Every log line carries the session id, so one call can be traced end to end.
- Phase boundaries are timed — connected, first user speech, first agent response — so you can see where latency entered, not just that it did.
- Provider metrics are tracked separately from application logs, so a degrading provider is visible without digging.
LiveKit Cloud provides agent logs, session insights, and tracing you can export to your own observability provider; the docs describe what's available and how to wire it.
Debugging a production failure
Classify first, then reproduce:
- Loop and task errors — the worker process model, above. Find where a runtime was created or a sync path awaited.
- Provider timeouts vs. degradation — a single timeout is transient; a rising latency trend is systemic. Provider response-time logs tell you which.
- Silent tool failures — a tool that raised was caught by the framework and the user heard a vague reply or nothing. Tools need explicit error handling that returns something the model can say.
- Connection instability — understand the SDK's built-in reconnection before adding retries on top of it; log connection state changes.
Then take it local: reproduce the conversation with debugging-livekit-agents, pin the cause as a
test with testing-livekit-agents, and if it was a whole-conversation failure, add a scenario so it
can't come back quietly.
Changing a codebase that's already live
Read the project's own docs and conventions first — they override anything general. Read two or three modules like the one you're about to add before writing it, and follow how they're initialized, configured, tested, and wired into the config pipeline. Use the test fixtures and mock patterns that already exist rather than building parallel ones; a second way to do something that already has a way confuses every future contributor. Mock at the boundary — the provider call, the database — and exercise the real module logic.
Related skills
- Designing the agent in the first place:
building-livekit-agents - Reproducing a bad conversation locally:
debugging-livekit-agents - Pinning a production bug as a test:
testing-livekit-agents - End-to-end checks against a deployed agent:
running-livekit-simulations - Deployment and observability docs, changelogs:
reading-livekit-docs
FAQ
What does the operating-livekit-agents skill do?
Deploys and operates a LiveKit agent in production: shipping a version to LiveKit Cloud and rolling it back, secrets and configuration, the worker process model and prewarming, safe async inside worker processes, provider timeouts and degradation, graceful shutdown, SDK upgrades, and observability. Use when the user says "deploy my agent", "roll back the deployment", "tail the agent logs", "the first call after a restart is slow", "attached to a different loop / event loop is closed", "prewarm the VAD", "shut down without dropping calls", "upgrade livekit-agents safely", "correlate logs by session", or is changing an agent codebase that is already live. Not for designing the agent (building-livekit-agents) or reproducing one bad conversation locally (debugging-livekit-agents).
How do I install operating-livekit-agents?
Run npx skills add https://github.com/livekit/agent-skills --skill operating-livekit-agents in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/operating-livekit-agents/ (personal) or .claude/skills/operating-livekit-agents/ (project).
Which AI agents can use operating-livekit-agents?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is operating-livekit-agents safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains operating-livekit-agents?
It is published by livekit in livekit/agent-skills. It has 381 recorded installs.
More from livekit/agent-skills
livekit-agents
livekit/agent-skills
Build voice AI agents with LiveKit Cloud and the Agents SDK. Use when the user asks to "build a voice agent", "create a LiveKit agent", "add voice AI", "implement handoffs", "structure agent workflows", or is working with LiveKit Agents SDK. Provides opinionated guidance for the recommended path: LiveKit Cloud + LiveKit Inference. REQUIRES writing tests for all implementations.
livekit-simulations
livekit/agent-skills
Generate targeted test scenarios for a LiveKit voice or chat agent and run them as simulations — locally, from the agent's own code plus what the user wants stress-tested. Use whenever the user wants to "test my agent", "what should I test", "create/generate simulation scenarios", "make a sim test suite", "use lk agent simulate", "stress-test the X flow", "set up scenarios for my agent", or wants to probe edge cases / refusals / regressions before shipping. Generates scenarios on the user's machine (their code is never uploaded) and lets the user deeply steer what gets tested. Trigger even without the word "simulation" when the user clearly wants to decide what to test and verify how their agent behaves across realistic conversations. Not for building a new agent from scratch (use the livekit-agents skill), load-testing, or ordinary unit tests.
building-livekit-agents
livekit/agent-skills
Open the skill to read its SKILL.md instructions.
reading-livekit-docs
livekit/agent-skills
Looks up current LiveKit facts (API signatures, CLI flags, config options, model and provider support, SDK changelogs, pricing) from the docs instead of answering from memory. Use whenever a question touches LiveKit specifics: "does LiveKit support X", "what changed in agents 1.8", "what are the arguments to Y", "how much does LiveKit cost", "find an example of Z in the LiveKit repos", or before writing any LiveKit code. Other LiveKit skills load this one first. Covers the LiveKit Docs MCP server and the lk docs CLI.
debugging-livekit-agents
livekit/agent-skills
Drives a live multi-turn conversation with a LiveKit agent running locally, using lk agent debugger. Use when the user says "test my agent", "try my agent", "does this work", or "why did it call that tool", after editing an agent to check how it behaves, or when an agent on a speech-to-speech model or one that mishears users needs checking. The default for a bare "test"; for regression tests use testing-livekit-agents, for graded runs running-livekit-simulations.
testing-livekit-agents
livekit/agent-skills
Open the skill to read its SKILL.md instructions.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.