Skip to content

Commit 935f635

Browse files
committed
Refactored litellm script to use uv
1 parent 236daf1 commit 935f635

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

ct/litellm.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ function update_script() {
2828
msg_error "No ${APP} Installation Found!"
2929
exit
3030
fi
31+
3132
msg_info "Updating $APP"
32-
$STD apt-get update
33-
pip install litellm[proxy] --upgrade
33+
PYTHON_VERSION="3.13" setup_uv
34+
$STD "$VENV_PATH/bin/python" -m pip install --upgrade litellm[proxy] prisma
3435
msg_ok "Updated $APP"
3536
exit
3637
}

frontend/public/json/litellm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"privileged": false,
1111
"interface_port": 4000,
1212
"documentation": "https://docs.litellm.ai/",
13-
"config_path": "/opt/litellm.yaml",
13+
"config_path": "/opt/litellm/litellm.yaml",
1414
"website": "https://www.litellm.ai/",
1515
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/litellm-light.webp",
1616
"description": "LLM proxy to call 100+ LLMs in a unified interface & track spend, set budgets per virtual key/user",

install/litellm-install.sh

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@ setting_up_container
1313
network_check
1414
update_os
1515

16-
msg_info "Setup Python3"
17-
$STD apt-get install -y \
18-
python3 \
19-
python3-dev \
20-
python3-pip
21-
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
22-
msg_ok "Setup Python3"
16+
PYTHON_VERSION="3.13" setup_uv
2317

24-
msg_info "Installing ${APPLICATION}"
25-
$STD pip install 'litellm[proxy]'
26-
$STD pip install 'prisma'
27-
msg_ok "Installed ${APPLICATION}"
18+
msg_info "Setting up Virtual Environment"
19+
mkdir -p /opt/litellm
20+
cd /opt/litellm
21+
$STD uv venv /opt/litellmtwo/.venv
22+
$STD /opt/litellmtwo/.venv/bin/python -m ensurepip --upgrade
23+
$STD /opt/litellmtwo/.venv/bin/python -m pip install --upgrade pip
24+
$STD /opt/litellmtwo/.venv/bin/python -m pip install litellm[proxy] prisma
25+
msg_ok "Installed LiteLLM"
2826

2927
PG_VERSION="17" setup_postgresql
3028

@@ -47,7 +45,7 @@ msg_ok "Set up PostgreSQL"
4745

4846
msg_info "Creating Service"
4947
mkdir -p /opt
50-
cat <<EOF >/opt/litellm.yaml
48+
cat <<EOF >/opt/litellm/litellm.yaml
5149
general_settings:
5250
master_key: sk-1234
5351
database_url: postgresql://$DB_USER:$DB_PASS@127.0.0.1:5432/$DB_NAME
@@ -60,7 +58,7 @@ Description=LiteLLM
6058
6159
[Service]
6260
Type=simple
63-
ExecStart=litellm --config /opt/litellm.yaml --use_prisma_migrate
61+
ExecStart=/opt/litellm/.venv/bin/litellm --config /opt/litellm/litellm.yaml --use_prisma_migrate
6462
Restart=always
6563
6664
[Install]

0 commit comments

Comments
 (0)