From df956ab81ec85d859421d631a90f4e33a9ad6d68 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Sat, 18 Apr 2026 21:41:12 +0200 Subject: [PATCH] fix(litellm): add prisma generate and use venv binary directly The install failed on startup because Prisma engine binaries were never generated. Added 'prisma generate' after pip install and changed both the setup command and systemd service to use the venv binary directly instead of 'uv run', ensuring prisma binaries persist between install and service start. Closes #13793 --- ct/litellm.sh | 8 +++++++- install/litellm-install.sh | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ct/litellm.sh b/ct/litellm.sh index 391a4acd1..fc871a340 100644 --- a/ct/litellm.sh +++ b/ct/litellm.sh @@ -38,12 +38,18 @@ function update_script() { msg_info "Updating LiteLLM" $STD "$VENV_PATH/bin/python" -m pip install --upgrade litellm[proxy] prisma + $STD "$VENV_PATH/bin/prisma" generate msg_ok "LiteLLM updated" msg_info "Updating DB Schema" - $STD uv --directory=/opt/litellm run litellm --config /opt/litellm/litellm.yaml --use_prisma_db_push --skip_server_startup + $STD /opt/litellm/.venv/bin/litellm --config /opt/litellm/litellm.yaml --use_prisma_db_push --skip_server_startup msg_ok "DB Schema Updated" + msg_info "Updating Service" + sed -i 's|ExecStart=uv --directory=/opt/litellm run litellm|ExecStart=/opt/litellm/.venv/bin/litellm|' /etc/systemd/system/litellm.service + systemctl daemon-reload + msg_ok "Updated Service" + msg_info "Starting Service" systemctl start litellm msg_ok "Started Service" diff --git a/install/litellm-install.sh b/install/litellm-install.sh index f86ce9d79..c36c79180 100644 --- a/install/litellm-install.sh +++ b/install/litellm-install.sh @@ -30,6 +30,7 @@ $STD uv venv --clear /opt/litellm/.venv $STD /opt/litellm/.venv/bin/python -m ensurepip --upgrade $STD /opt/litellm/.venv/bin/python -m pip install --upgrade pip $STD /opt/litellm/.venv/bin/python -m pip install litellm[proxy] prisma +$STD /opt/litellm/.venv/bin/prisma generate msg_ok "Installed LiteLLM" msg_info "Configuring LiteLLM" @@ -40,7 +41,7 @@ general_settings: database_url: postgresql://$PG_DB_USER:$PG_DB_PASS@127.0.0.1:5432/$PG_DB_NAME store_model_in_db: true EOF -uv --directory=/opt/litellm run litellm --config /opt/litellm/litellm.yaml --use_prisma_db_push --skip_server_startup +$STD /opt/litellm/.venv/bin/litellm --config /opt/litellm/litellm.yaml --use_prisma_db_push --skip_server_startup msg_ok "Configured LiteLLM" msg_info "Creating Service" @@ -50,7 +51,7 @@ Description=LiteLLM [Service] Type=simple -ExecStart=uv --directory=/opt/litellm run litellm --config /opt/litellm/litellm.yaml +ExecStart=/opt/litellm/.venv/bin/litellm --config /opt/litellm/litellm.yaml Restart=always [Install]