dry-rainbow-66344
09/08/2025, 4:23 AMlk agent deploy every single time to update the code on server? or is there any other way I can update the code on the server for the agent?tall-airline-16756
09/08/2025, 4:23 AMtall-airline-16756
09/08/2025, 4:23 AMlk agent deploy command. This will kick off a smooth rolling deployment where LiveKit Cloud builds a new container image from your updated code (using your Dockerfile), spins up new instances alongside the current ones, directs new sessions to these fresh instances, and then gently shuts down the old instances once their active sessions finish (which can take up to an hour).
Just a heads up: this is the only way to update your agent's code. Other commands like update or update-secrets are meant for updating metadata or secrets, not the code itself.
Sources: Deploying to production | LiveKit Docs | Agent deployment CLI reference | LiveKit Docs | autocomplete/fish_autocompletedry-rainbow-66344
09/08/2025, 4:25 AM{"message": "starting worker", "level": "INFO", "name": "livekit.agents", "version": "1.2.6", "rtc-version": "1.0.12", "timestamp": "2025-09-08T04:23:56.767481+00:00"}
{"message": "preloading plugins", "level": "INFO", "name": "livekit.agents", "packages": ["livekit.plugins.cartesia", "livekit.plugins.deepgram", "livekit.plugins.openai", "livekit.plugins.silero", "livekit.plugins.sarvam", "livekit.plugins.google", "livekit.plugins.turn_detector", "av"], "timestamp": "2025-09-08T04:23:56.767591+00:00"}
{"message": "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 93, "timestamp": "2025-09-08T04:23:58.532893+00:00"}
{"message": "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 96, "timestamp": "2025-09-08T04:23:58.551216+00:00"}
{"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 93, "elapsed_time": 0.35, "timestamp": "2025-09-08T04:23:58.879281+00:00"}
{"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 96, "elapsed_time": 0.33, "timestamp": "2025-09-08T04:23:58.885423+00:00"}
{"message": "registered worker", "level": "INFO", "name": "livekit.agents", "id": "CAW_zcmfosSmbZFA", "url": "https://voice-agent-101bt5fj.livekit.cloud", "region": "US East B", "protocol": 16, "timestamp": "2025-09-08T04:23:58.927539+00:00"}
{"message": "received job request", "level": "INFO", "name": "livekit.agents", "job_id": "AJ_d5ibSciCJ53a", "dispatch_id": "", "room_name": "sbx-2bra0q-jcLTB9En6F5xiR9aesQquU", "agent_name": "", "resuming": false, "timestamp": "2025-09-08T04:24:27.902754+00:00"}
{"message": "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 159, "timestamp": "2025-09-08T04:24:27.986027+00:00"}
{"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 159, "elapsed_time": 0.25, "timestamp": "2025-09-08T04:24:28.232938+00:00"}
{"message": "EOU metrics", "level": "INFO", "name": "livekit.agents", "room": "sbx-2bra0q-jcLTB9En6F5xiR9aesQquU", "end_of_utterance_delay": 0.49, "transcription_delay": 0.17, "pid": 93, "job_id": "AJ_d5ibSciCJ53a", "timestamp": "2025-09-08T04:24:31.064912+00:00"}tall-airline-16756
09/08/2025, 4:25 AMdry-rainbow-66344
09/08/2025, 4:26 AM{"message": "received job request", "level": "INFO", "name": "livekit.agents", "job_id": "AJ_d5ibSciCJ53a", "dispatch_id": "", "room_name": "sbx-2bra0q-jcLTB9En6F5xiR9aesQquU", "agent_name": "", "resuming": false, "timestamp": "2025-09-08T04:24:27.902754+00:00"}
{"message": "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 159, "timestamp": "2025-09-08T04:24:27.986027+00:00"}
{"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 159, "elapsed_time": 0.25, "timestamp": "2025-09-08T04:24:28.232938+00:00"}
{"message": "EOU metrics", "level": "INFO", "name": "livekit.agents", "room": "sbx-2bra0q-jcLTB9En6F5xiR9aesQquU", "end_of_utterance_delay": 0.49, "transcription_delay": 0.17, "pid": 93, "job_id": "AJ_d5ibSciCJ53a", "timestamp": "2025-09-08T04:24:31.064912+00:00"}
{"message": "process memory usage is high", "level": "WARNING", "name": "livekit.agents", "memory_usage_mb": 507.31640625, "memory_warn_mb": 500, "memory_limit_mb": 0, "pid": 93, "job_id": "AJ_d5ibSciCJ53a", "timestamp": "2025-09-08T04:25:18.900214+00:00"}tall-airline-16756
09/08/2025, 4:26 AMdry-rainbow-66344
09/08/2025, 4:27 AMtall-airline-16756
09/08/2025, 4:27 AMjob_memory_warn_mb setting.
2. Make Sure Resources Are Enough: For smooth sailing, LiveKit suggests 4 cores and 8GB RAM per worker for most voice AI apps. If things get busy, try cutting down on simultaneous jobs or turn off plugins you don’t really need.
3. Keep an Eye on Usage: The LiveKit Cloud dashboard is your friend here—it shows you memory and CPU use, so you can spot anything that’s hogging resources.
4. Adjust Limits When Needed: If memory use keeps crossing the warning line, you might want to raise that limit or set a job_memory_limit_mb to keep processes running smoothly.
Feel free to reach out if you want a hand putting these tips into action or if you have any other questions. I’m here to help!
Sources: livekit-agents/livekit/agents/worker.py | Deploying to custom environments | LiveKit Docs | Deploy and scale agents on LiveKit Clouddry-rainbow-66344
09/08/2025, 4:28 AMtall-airline-16756
09/08/2025, 4:29 AMjob_memory_warn_mb and job_memory_limit_mb through the WorkerOptions settings when you’re setting up your agent. For instance, setting job_memory_warn_mb lets you define when to get a memory warning, and job_memory_limit_mb sets the max memory usage before the process stops.
If you’d like a hand finding or changing these settings in your deployment, just let me know—I’m here to help!
Sources: examples/avatar_agents/bithuman/agent_local.pydry-rainbow-66344
09/08/2025, 4:29 AMtall-airline-16756
09/08/2025, 4:29 AMjob_memory_warn_mb or job_memory_limit_mb in LiveKit Cloud. Instead, you’ll want to configure these settings right in the agent’s code using the WorkerOptions class. Here’s a little example to guide you:
from livekit.agents import WorkerOptions, cli
if __name__ == "__main__":
cli.run_app(
WorkerOptions(
entrypoint_fnc=entrypoint,
worker_type=WorkerType.ROOM,
job_memory_warn_mb=1500,
job_memory_limit_mb=2000,
num_idle_processes=1,
)
)
Once you’ve updated the code, just redeploy the agent using lk agent deploy. If you want, I’m here to help you through the process—just let me know!
Sources: tests/test_ipc.pydry-rainbow-66344
09/08/2025, 4:30 AMdef prewarm(proc: JobProcess):
proc.userdata["vad"] = silero.VAD.load()
if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm))tall-airline-16756
09/08/2025, 4:31 AMWorkerOptions configuration like this:
from livekit.agents import WorkerOptions, cli
def prewarm(proc: JobProcess):
proc.userdata["vad"] = silero.VAD.load()
if __name__ == "__main__":
cli.run_app(
WorkerOptions(
entrypoint_fnc=entrypoint,
prewarm_fnc=prewarm,
job_memory_warn_mb=1500, # Set memory warning threshold
job_memory_limit_mb=2000 # Set memory limit
)
)
Once you’ve made these changes, just redeploy your agent using lk agent deploy. If you run into any issues or have questions, feel free to reach out—I’m here to help!