creamy-tiger-14805
11/03/2025, 9:25 AMtall-airline-16756
11/03/2025, 9:25 AMtall-airline-16756
11/03/2025, 9:26 AMfrom livekit.agents import WorkerOptions
# Option 1: Disable memory warnings entirely
opts = WorkerOptions(
job_memory_warn_mb=0, # Set to 0 to disable warnings
# ... other options
)
# Option 2: Increase the warning threshold
opts = WorkerOptions(
job_memory_warn_mb=1000, # Increase from default 500MB to 1000MB
# ... other options
)
For JavaScript/TypeScript Agents:
const procOpts = {
memoryWarnMB: 0, // Set to 0 to disable warnings
memoryLimitMB: 0, // Memory limit (0 = disabled)
// ... other options
};
While adjusting these settings is totally fine, it might also be helpful to take a closer look at the memory usage itself. Sometimes, this can reveal opportunities to optimize or catch memory leaks early. Please feel free to reach out if you'd like any help with that or if you have any other questions—I’m here to support you!
Sources: livekit-agents/livekit/agents/worker.py | agents/src/ipc/supervised_proc.tscreamy-tiger-14805
11/03/2025, 9:36 AMtall-airline-16756
11/03/2025, 9:37 AMWorkerOptions while calling cli.run_app() inside the main part of your agent script. Usually, this happens within the if __name__ == "__main__": section of your main Python file.
Here’s a little example to guide you:
if __name__ == "__main__":
cli.run_app(WorkerOptions(
entrypoint_fnc=entrypoint, # Your main function for handling jobs
job_memory_warn_mb=1000 # Adjust memory warning threshold here
))
Just swap out entrypoint with the name of your function that processes the jobs. If anything feels unclear or you want me to walk you through it step-by-step, please don’t hesitate to ask—I’m here to help!
Sources: python-agent-example-app/main.py | livekit-agents/README.md | Worker options | LiveKit Docs | metrics/send-metrics-to-3p/send_metrics_to_3p.py | main.py