modern-winter-66316
12/03/2025, 2:05 AMtall-airline-16756
12/03/2025, 2:05 AMtall-airline-16756
12/03/2025, 2:05 AMmodern-winter-66316
12/03/2025, 2:05 AMtall-airline-16756
12/03/2025, 2:06 AMpyproject.toml (or requirements.txt) and a Python Dockerfile (or remove any stray package.json).
◦ Then run lk agent deploy . — the CLI detects Python when the project files/Dockerfile indicate it.
If you want, I can:
• Check which deployment source the dashboard shows for CA_4T2cvqbL6JwH (tell me what you see on the agent page), or
• Walk you through updating your Dockerfile or removing a stray package.json so lk agent deploy recognizes Python.
Which would you like to do next?
Sources: Deploying to production | LiveKit Docs | Builds and Dockerfiles | LiveKit Docs | Voice AI quickstart | LiveKit docsmodern-winter-66316
12/03/2025, 2:06 AMtall-airline-16756
12/03/2025, 2:07 AMpackage.json if you’re not using Node.
◦ Include pyproject.toml or requirements.txt.
◦ Add a Python Dockerfile (example below).
• Example minimal Dockerfile (adjust entrypoint):
FROM python:3.11-slim
WORKDIR /app
COPY pyproject.toml requirements.txt ./
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "src/agent.py"]
• Run locally to test build: docker build -t myagent:local . && docker run --rm myagent:local
• Deploy with CLI: lk agent deploy .
3) If CLI still assumes Node.js
• Check repo root for package.json — delete or move it if not needed.
• Ensure Dockerfile present and references Python base image.
• Re-run lk agent deploy .
4) Validation & rollback
• After deploy/redeploy, check agent logs on dashboard for startup errors.
• If new code fails, use dashboard to roll back to previous image/version or redeploy earlier commit from GitHub.
Which do you want now — I’ll:
• Walk you through checking the agent page and interpreting what it shows, or
• Help update your repo (I can show concrete edits) so lk agent deploy works from CLI?modern-winter-66316
12/03/2025, 2:17 AMtall-airline-16756
12/03/2025, 2:18 AMlk agent deploy or the dashboard.
Agent code (minimal, voice-agent pattern)
# src/agent.py
from dotenv import load_dotenv
import asyncio
from livekit import agents
from livekit.agents import AgentSession, JobContext, Worker, WorkerType
load_dotenv(".env.local")
class Assistant(agents.Agent):
def __init__(self):
super().__init__(instructions="You are a helpful short-response voice assistant.")
async def handle_job(job: JobContext):
# create per-job services here (STT/LLM/TTS). Replace with your providers.
# Example uses placeholder service objects; swap in real SDKs/config.
stt = None # e.g., Deepgram/STT client
llm = None # e.g., OpenAI client
tts = None # e.g., Cartesia/TTS client
session = AgentSession(
ctx=job,
tts=tts,
stt=stt,
llm=llm,
instructions="Greet and offer help"
)
await session.start()
await session.generate_reply(instructions="Say hello and ask how you can help.")
await session.stop()
@agents.clr.run_app
class MyWorker:
def __init__(self):
self.worker = Worker(worker_name="my-assistant-worker", worker_type=WorkerType.AI)
# register job handler
self.worker.on("job", handle_job)
if __name__ == "__main__":
# The decorator run_app will start the worker loop; include minimal bootstrap if needed
asyncio.get_event_loop().run_forever()
Project layout
• my-agent-project/
◦ src/agent.py
◦ pyproject.toml or requirements.txt
◦ Dockerfile
◦ .env.local (not committed)
◦ livekit.toml (CLI config)
Minimal requirements file example (requirements.txt)
livekit-agents[deepgram,openai,cartesia,silero]
python-dotenv
Minimal Dockerfile (adjust entrypoint/imports to your app)
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "src/agent.py"]
Essential env vars (.env.local)
• LIVEKIT_API_KEY
• LIVEKIT_API_SECRET
• LIVEKIT_URL
• Any provider keys: OPENAI_API_KEY, DEEPGRAM_API_KEY, CARTESIA_KEY, etc.
Quick deployment notes
• Dashboard: best for immediate redeploys — open project → Agents → CA_4T2cvqbL6JwH → Redeploy/Rebuild or update image tag.
• CLI: ensure repo root has no stray `package.json`; include `pyproject.toml`/`requirements.txt` and a Python Dockerfile. Then run lk agent deploy .
• Test locally: docker build -t myagent:local . && docker run --rm myagent:local to catch startup errors.
If you want, I can:
• Provide a filled example replacing placeholders with Deepgram/OpenAI/Cartesia snippets, or
• Inspect your repo files (list of root files) to point out what to change so lk agent deploy detects Python. Which do you want? Sources: Voice AI quickstart | LiveKit docs | examples/voice_agents | livekit/livekit_composite | DeepWiki | examples/frontdesk | livekit/livekit_composite | DeepWiki | App templates | LiveKit docs | Deploying to production | LiveKit Docs