From 03de8f56a67f399a6fa88c084651e2d725368df4 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 6 May 2026 15:27:27 -0700 Subject: [PATCH] feat: systemd unit for litellm-agent-runtime daemon Reads runtime config from /etc/litellm-agent/runtime.env (written by EC2 user-data, mode 600). Restart=on-failure with a 5s backoff so transient network blips during bootstrap don't permanently kill the session. LIT-2878 --- infra/ami/files/litellm-agent-runtime.service | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 infra/ami/files/litellm-agent-runtime.service diff --git a/infra/ami/files/litellm-agent-runtime.service b/infra/ami/files/litellm-agent-runtime.service new file mode 100644 index 00000000000..72b5d03ef42 --- /dev/null +++ b/infra/ami/files/litellm-agent-runtime.service @@ -0,0 +1,22 @@ +[Unit] +Description=LiteLLM agent-session runtime daemon +Documentation=https://docs.litellm.ai/docs/agent_sessions +After=network-online.target cloud-final.service +Wants=network-online.target + +[Service] +Type=simple +User=root +# Runtime config dropped by user-data. +EnvironmentFile=-/etc/litellm-agent/runtime.env +ExecStart=/usr/bin/python3.13 /opt/litellm-agent-runtime/daemon +Restart=on-failure +RestartSec=5 +# Limit accidental log volume; the daemon should rate-limit its own output. +StandardOutput=journal +StandardError=journal +KillMode=mixed +TimeoutStopSec=15 + +[Install] +WantedBy=multi-user.target