How to deploy agent starter python to production?
# ask-ai
r
How to deploy agent starter python to production?
t
Thanks for reaching out, Saurabh. 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 how to deploy the "agent-starter-python" project to production. Below is a concise, practical deployment checklist and the common options you can pick from. 1) Prepare your environment • Ensure Python >= 3.10 is installed. • Install and authenticate the LiveKit CLI with your LiveKit Cloud project using
lk cloud auth
. 2) Prepare the project • Start from the
agent-starter-python
template (it includes a
Dockerfile
,
.dockerignore
, and production-ready config). • Create a
.env
with required secrets such as
OPENAI_API_KEY
,
DEEPGRAM_API_KEY
(if used),
LIVEKIT_API_KEY
,
LIVEKIT_API_SECRET
, and
LIVEKIT_URL
. Keep secrets out of source control. 3) Build and deploy (LiveKit Cloud - simplest path) • From the project root run
lk agent create
. This will generate any missing deployment files, build a Docker image for your agent, and deploy to LiveKit Cloud with autoscaling and load balancing. • Manage secrets and updates with
lk agent update-secrets
, and use
lk agent rollback
to revert if needed. 4) Self-hosted / advanced deployments • If you prefer to self-host, use your container orchestration of choice (Kubernetes, ECS, etc.). The project’s
Dockerfile
makes it straightforward to build an image and run replicas. • Agent servers connect to LiveKit via WebSocket and will balance jobs across instances automatically. Ensure networking, TLS, and firewall rules allow stable WebSocket connections to LiveKit. 5) CI/CD and automation • Integrate deployment into CI/CD (for example, use the LiveKit
deploy-action
in GitHub Actions) to build images, run tests, and deploy on merge to main. 6) Monitoring and operations • Use the LiveKit Cloud dashboard (or your monitoring stack for self-hosted) to watch session metrics, logs, and performance (TTFT, TTFB). • Scale instances based on load; for Cloud deployments, autoscaling is available. If you want, I can: • Walk you through a sample
Dockerfile
and
.env
for
agent-starter-python
. • Provide step-by-step commands for either LiveKit Cloud deployment (exact
lk
commands) or a Kubernetes deployment manifest. • Help you set up a GitHub Action workflow for automatic builds and deploys. Which deployment path do you want to use: LiveKit Cloud (recommended for easiest production setup) or self-hosted (Kubernetes/ECS)? Sources: Google AI and LiveKit | LiveKit Documentation | examples/voice_agents | livekit/livekit_composite | DeepWiki | Self-hosted deployments | LiveKit Documentation | Deploy LiveKit Agents with GitHub Actions | LiveKit | Agent deployment overview | LiveKit Documentation