i am creating a frontend for creating and customiz...
# ask-ai
l
i am creating a frontend for creating and customizing voice agents. 1. What customization options can i provide to users in the frontend based on the capabilities of livekit ? 2. also say i provide a publish agent button to users, how can i deploy the agent to livekit cloud.
t
Thanks for reaching out, Anirban. 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 both parts of your question: what frontend customization you can offer users, and how to implement a “Publish agent” flow that deploys to LiveKit Cloud. Customization options you can expose in the frontend • Agent identity/behavior ◦ System prompt / persona (tone, role, instructions) ◦ Welcome greeting (with dynamic variables like
{{metadata.user_name}}
) • Models and voices ◦ Select STT, LLM, and TTS providers/models ◦ Choose TTS voice variants where supported • Real‑time voice behavior ◦ Turn detection, interruption/preemption behavior, preemptive generation ◦ Noise reduction / input processing and pre‑connect audio buffering • Tools & integrations ◦ HTTP tools (name, method, URL, headers, params, auth) for calling external APIs ◦ Variables and secrets injection (use
{{secrets.KEY}}
for API keys) • Media & session settings ◦ Enable/disable video, text chat, screen sharing ◦ Session limits, max concurrency, and recording options • UX controls ◦ Greeting / fallback messages, retry/timeout behavior, and language/locale toggles How to implement a “Publish agent” button (secure, recommended architecture) 1. Frontend → Backend ◦ Send the user’s configuration (prompts, model choices, tools, secrets references, media settings) to your backend service. Do not deploy directly from the browser because secrets/credentials and deployment actions must be protected. 1. Backend generates agent project ◦ Generate the agent code or configuration from templates (for example, the agent starter templates). ◦ Store sensitive values securely (secrets vault) and substitute only when deploying. 1. Backend performs deployment ◦ Use the LiveKit CLI (
lk agent create
/
lk agent deploy
) or the deployment flow that LiveKit’s Agent Builder uses to publish the agent to LiveKit Cloud from your backend environment. ◦ Ensure the backend has the necessary service credentials and that secrets are never exposed to clients. 1. Post‑deploy actions ◦ Return deployment status to the frontend (success, failure, logs, agent URL/ID). ◦ Optionally, trigger CI/CD (GitHub Actions) or provide downloadable project artifacts for manual review. Alternative (no‑code / user‑driven) • Use LiveKit’s Agent Builder in the browser which offers in‑browser generation and a “Deploy agent” action for users who prefer to deploy directly via the LiveKit UI. Questions to narrow implementation choices • Do you plan to host the deployment backend (CI/CD) yourself, or have users run CLI steps locally? • Which STT/LLM/TTS providers do you intend to support first? • Will users supply secrets (API keys) directly, or do you want to manage secrets on their behalf? If you tell me which option you prefer (hosted backend deploy vs. user CLI vs. Agent Builder) and which models/providers you want to support first, I’ll give a concise implementation checklist and example API payloads you can send from the frontend. Sources: Agent Builder | LiveKit docs | Voice AI quickstart | LiveKit docs | OpenAI and LiveKit partner to turn Advanced Voice into an API | Web and mobile frontends | LiveKit docs | Examples | livekit/livekit_composite | DeepWiki
l
if i dont want to use livekit cloud and instead want to self host it. what are the different self hosting options ?
t
You're asking about self‑hosting LiveKit instead of using LiveKit Cloud — below are the main options and key tradeoffs so you can pick what fits your environment. 1) Virtual Machine (VM) • How: Docker Compose + Caddy (auto TLS via Let’s Encrypt/ZeroSSL) using cloud‑init or an init script. • Good for: Simple production or staging on a single VM (AWS, Azure, DigitalOcean, Linode). • Requirements: Open ports 80/443, 3478/UDP, 50000–60000/UDP (and others depending on features). Caddy handles certificates. 2) Kubernetes • How: Official Helm chart for k8s (GKE/EKS/DOKS supported). Use Ingress + cert‑manager for TLS. • Good for: Scalable, highly available production deployments and multi‑node orchestration. • Requirements: Redis for distributed state, TLS certs as k8s secrets, careful rollout (supports long termination grace period). 3) Distributed / Multi‑region • How: Run multiple LiveKit nodes with Redis backing to share room state and coordinate load. • Good for: High availability, geo routing, and large scale with connection draining during node shutdowns. 4) Local / Dev • How: Install locally (brew, curl script, or binary) and run
livekit-server --dev
. • Good for: Development and testing only. Binds to localhost by default (use
--bind 0.0.0.0
for network access). 5) Independent components (optional) • Ingress service: for RTMP/WHIP ingest — autoscalable, resource‑heavy (recommend ≥4 CPU, 4GB RAM). • Egress service: for recording/streaming out (may require Chrome sandboxing flags in Docker). • SIP server: telephony integration (public SIP/RTP ports required). Quick tradeoffs • VM (Docker Compose): simpler setup, less operational overhead, OK for small-scale. • Kubernetes: more operational complexity but best for scale, HA, and automated ops. • Distributed (Redis): required for multi‑node coordination and global scale. • Local: fastest for dev but not production. If you want, I can: • Give a concise checklist for a VM Docker Compose deployment (ports, env vars, commands). • Provide the minimal Helm values to deploy on Kubernetes with Redis and cert‑manager. Which one would you like next? Sources: Deploy to a VM | LiveKit docs | Deploy to Kubernetes | LiveKit docs | Running LiveKit locally | LiveKit docs | Distributed Setup | LiveKit docs | Self-hosting the Ingress Service | LiveKit docs
l
Agent identity/behavior ◦ System prompt / persona (tone, role, instructions) can i basically give a name to the agent and then say i give a role of receptionist , can i also provide instructions/knowledge about the company etc ??
t
Yes — you can name an agent, assign it a role (e.g., receptionist), and provide company‑specific instructions/knowledge to shape its behavior. How to do each (concise) • Name: set
agent_name
(used for explicit agent dispatch so that named agent handles a room). ◦ Example:
@server.rtc_session(agent_name="receptionist-agent")
• Role & persona: put the role, tone, and behavior in the agent’s system prompt / instructions passed to the Agent class. ◦ Example snippet:
Copy code
class ReceptionistAgent(Agent):
        def __init__(self):
            super().__init__(
                instructions="""
                You are Clara, the friendly front desk receptionist at Acme Corp.
                Greet visitors warmly, answer questions about company hours,
                and direct callers to the correct department.
                """
            )
• Company knowledge / instructions: ◦ Pass structured company data as job metadata when dispatching the agent. ◦ Preload relevant context into the agent’s
ChatContext
before the session starts. ◦ Provide tools (HTTP actions) the agent can call to fetch live company data or knowledge-base entries. ◦ Use secrets/variables for protected values (e.g.,
{{secrets.API_KEY}}
). If you want, I can: • Provide the exact frontend payload shape to send to your backend for agent dispatch (with metadata and secrets placeholders), or • Show a short example of using a tool to fetch company FAQ data during a session. Which would help you next? Sources: Agents telephony integration | LiveKit docs | Agent Builder | LiveKit docs | Agent dispatch | LiveKit docs | External data and RAG | LiveKit Docs
l
now if i want users to be able to create voice agents with telephony support using twillio (SIP TRunking). what info should be provided in the frontend by the user for the same
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
l
can an agent have multiple phone numbers via twillio or just one ?