Refactored litellm script to use uv

This commit is contained in:
Andrew Stout 2025-08-08 16:49:55 -05:00
parent c094133ea1
commit ec0de310e8
No known key found for this signature in database
GPG Key ID: B01268A581FC2448
3 changed files with 15 additions and 16 deletions

View File

@ -28,9 +28,10 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
msg_info "Updating $APP" msg_info "Updating $APP"
$STD apt-get update PYTHON_VERSION="3.13" setup_uv
pip install litellm[proxy] --upgrade $STD "$VENV_PATH/bin/python" -m pip install --upgrade litellm[proxy] prisma
msg_ok "Updated $APP" msg_ok "Updated $APP"
exit exit
} }

View File

@ -10,7 +10,7 @@
"privileged": false, "privileged": false,
"interface_port": 4000, "interface_port": 4000,
"documentation": "https://docs.litellm.ai/", "documentation": "https://docs.litellm.ai/",
"config_path": "/opt/litellm.yaml", "config_path": "/opt/litellm/litellm.yaml",
"website": "https://www.litellm.ai/", "website": "https://www.litellm.ai/",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/litellm-light.webp", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/litellm-light.webp",
"description": "LLM proxy to call 100+ LLMs in a unified interface & track spend, set budgets per virtual key/user", "description": "LLM proxy to call 100+ LLMs in a unified interface & track spend, set budgets per virtual key/user",

View File

@ -13,18 +13,16 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Setup Python3" PYTHON_VERSION="3.13" setup_uv
$STD apt-get install -y \
python3 \
python3-dev \
python3-pip
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
msg_ok "Setup Python3"
msg_info "Installing ${APPLICATION}" msg_info "Setting up Virtual Environment"
$STD pip install 'litellm[proxy]' mkdir -p /opt/litellm
$STD pip install 'prisma' cd /opt/litellm
msg_ok "Installed ${APPLICATION}" $STD uv venv /opt/litellmtwo/.venv
$STD /opt/litellmtwo/.venv/bin/python -m ensurepip --upgrade
$STD /opt/litellmtwo/.venv/bin/python -m pip install --upgrade pip
$STD /opt/litellmtwo/.venv/bin/python -m pip install litellm[proxy] prisma
msg_ok "Installed LiteLLM"
PG_VERSION="17" setup_postgresql PG_VERSION="17" setup_postgresql
@ -47,7 +45,7 @@ msg_ok "Set up PostgreSQL"
msg_info "Creating Service" msg_info "Creating Service"
mkdir -p /opt mkdir -p /opt
cat <<EOF >/opt/litellm.yaml cat <<EOF >/opt/litellm/litellm.yaml
general_settings: general_settings:
master_key: sk-1234 master_key: sk-1234
database_url: postgresql://$DB_USER:$DB_PASS@127.0.0.1:5432/$DB_NAME database_url: postgresql://$DB_USER:$DB_PASS@127.0.0.1:5432/$DB_NAME
@ -60,7 +58,7 @@ Description=LiteLLM
[Service] [Service]
Type=simple Type=simple
ExecStart=litellm --config /opt/litellm.yaml --use_prisma_migrate ExecStart=/opt/litellm/.venv/bin/litellm --config /opt/litellm/litellm.yaml --use_prisma_migrate
Restart=always Restart=always
[Install] [Install]