Skip to content

feat(litellm): bare-metal LiteLLM proxy via uv, PostgreSQL and systemd - #1994

Open
aroldobossoni wants to merge 7 commits into
community-scripts:mainfrom
aroldobossoni:feat/litellm-baremetal
Open

feat(litellm): bare-metal LiteLLM proxy via uv, PostgreSQL and systemd#1994
aroldobossoni wants to merge 7 commits into
community-scripts:mainfrom
aroldobossoni:feat/litellm-baremetal

Conversation

@aroldobossoni

Copy link
Copy Markdown

Scripts which are clearly AI generated and not further revised by the Author of this PR (in terms of Coding Standards and Script Layout) may be closed without review.

✍️ Description

Re-adds LiteLLM as a bare-metal Community Script for ProxmoxVED.

  • ct/litellm.sh — LXC creation and update_script() using check_for_gh_release + fetch_and_deploy_gh_release
  • install/litellm-install.sh — PostgreSQL 16, Python 3.12 via setup_uv, official release tarball, Prisma schema sync, systemd service
  • json/litellm.json — metadata for the website

Tested on Proxmox VE 9.2.4 (Debian 13 LXC): install completes, prisma generate succeeds with venv on PATH, http://<CT_IP>:4000/health/liveliness returns healthy.

🔗 Related PR / Issue

Link: #14294 (previous removal from ProxmoxVE)

✅ Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No breaking changes – Existing functionality remains intact.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🏗️ arm64 Support (X in brackets)

  • arm64 supported - Tested and supported on arm64.
  • arm64 not tested - Assumed to work on arm64, but testing has not been done.
  • arm64 not supported - Confirmed upstream dependencies or binaries do not support arm64.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔍 Code & Security Review (X in brackets)

  • Follows CODE-AUDIT.md & CONTRIBUTING.md guidelines
  • Uses correct script structure (AppName.sh, AppName-install.sh, AppName.json)
  • No hardcoded credentials
  • No Docker / Docker Compose – The application is installed bare-metal; Docker is not used.
  • No git pull – Updates use fetch_and_deploy_gh_release, fetch_and_deploy_codeberg_release, fetch_and_deploy_gl_release, or fetch_and_deploy_from_url instead of git pull.

🤖 AI Assistance (X in brackets)

If you used an AI tool (GitHub Copilot, Claude, ChatGPT, etc.) to write or generate any scripts in this PR, you must confirm compliance below.
Select exactly one option.

  • No AI used – Scripts were written without AI assistance.
  • AI was used – I confirm the scripts were built using AGENTS.md and .github/agents/pve-script-creator.agent.md as guidance, and the output has been reviewed and corrected to match those guidelines.

📋 Additional Information (optional)

Prior Docker-based submissions were rejected per AGENTS.md. This submission uses bare-metal installation only.


📦 Application Requirements (for new scripts)

⚠️ Do not remove this section.
It is used by automated PR validation checks.
If this PR is not a new script submission, leave the checkboxes unchecked.

Required for 🆕 New script submissions.
Pull requests that do not meet these requirements may be closed without review.

  • The application is at least 6 months old
  • The application is actively maintained
  • The application has 600+ GitHub stars
  • Official release tarballs are published
  • I understand that not all scripts will be accepted due to various reasons and criteria by the community-scripts ORG

🌐 Source

Made with Cursor

Aroldo de Mattos Bossoni and others added 4 commits July 5, 2026 05:57
Deploy from official GitHub release tarballs with setup_uv,
setup_postgresql, prisma generate from schema.prisma, and systemd
service. No Docker — aligned with ProxmoxVED AGENTS.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prisma spawns prisma-client-py via /bin/sh without the venv on PATH.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop temporary debug logs and redundant core-package deps (curl, gnupg,
sudo) already installed by build.func. Restore standard build.func source.

Co-authored-by: Cursor <cursoragent@cursor.com>
@aroldobossoni
aroldobossoni requested a review from a team as a code owner July 7, 2026 01:17
Aroldo de Mattos Bossoni and others added 2 commits July 6, 2026 23:25
Set logo to upstream proxy logo.jpg, defaults to 1 CPU, 2 GB RAM, 10 GB disk.

Co-authored-by: Cursor <cursoragent@cursor.com>
AGENTS.md requires logo as URL; Twemoji 1f685 renders the train emoji on the site.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tremor021

Copy link
Copy Markdown
Member

This looks good to me already

Comment thread ct/litellm.sh Outdated
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: stout01
# Co-Authors: MickLesk, tremor021 (prior pip/Prisma versions)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Co-Authors: MickLesk, tremor021 (prior pip/Prisma versions)
# Co-Authors: MickLesk, tremor021

Comment thread ct/litellm.sh Outdated
Comment on lines +48 to +49
DATABASE_URL=$(grep 'database_url:' /opt/litellm/litellm.yaml | awk '{print $2}')
export DATABASE_URL

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be one line?

Comment thread install/litellm-install.sh Outdated

# Copyright (c) 2021-2026 community-scripts ORG
# Author: stout01
# Co-Authors: MickLesk, tremor021 (prior pip/Prisma versions)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Co-Authors: MickLesk, tremor021 (prior pip/Prisma versions)
# Co-Authors: MickLesk, tremor021

Comment thread install/litellm-install.sh Outdated
build-essential \
python3-dev \
libpq-dev \
openssl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already installed i believe

Comment thread install/litellm-install.sh Outdated
systemctl enable -q --now litellm
msg_ok "Created Service"

msg_info "Waiting for LiteLLM health check"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont believe a health check should be needed, it should just assume that it works.

Comment thread json/litellm.json Outdated
Comment on lines +40 to +43
{
"text": "Uses PostgreSQL and Python (uv) with the official LiteLLM release tarball.",
"type": "info"
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
"text": "Uses PostgreSQL and Python (uv) with the official LiteLLM release tarball.",
"type": "info"
},

@github-actions github-actions Bot added the stale label Jul 22, 2026
@github-actions github-actions Bot removed the stale label Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@aroldobossoni Recent activity detected. Removing stale label.

Comment thread json/litellm.json
"interface_port": 4000,
"documentation": "https://docs.litellm.ai/",
"website": "https://github.com/BerriAI/litellm",
"logo": "https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f685.png",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this image?

Comment thread json/litellm.json
Comment on lines +39 to +43
},
{
"text": "LITELLM_SALT_KEY cannot be changed after models are added to the proxy.",
"type": "warning"
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
},
{
"text": "LITELLM_SALT_KEY cannot be changed after models are added to the proxy.",
"type": "warning"
}
}

having the notice in the file where they set litellm salt key is enough imo

@michelroegl-brunner

Copy link
Copy Markdown
Member

One thing, and this is not related to the script here is, why did you lie in the PR Template regarding the use of AI? We are most certainly not against the use of AI, some of us use it ourself. But to tick the "I did not Use AI box" and then have cursor as a co author is just a blatant lie, wich I can not unterstand. Can you elaborate here @aroldobossoni what made you do that?!?

@ComictypX

Copy link
Copy Markdown

Tested this PR on Proxmox VE 9.2.9 with the default Debian 13 LXC.

The container creation and LiteLLM installation itself completed successfully, but the installation failed during the Prisma/initialization step with LiteLLM 1.96.0:

ImportError: cannot import name 'get_flat_dependant'
from 'fastapi.dependencies.utils'

This then causes the misleading follow-up error:

ModuleNotFoundError: No module named 'proxy_server'

uv installed FastAPI 0.141.1. I first tried <0.141, which resolved to 0.140.13, but that version already lacks get_flat_dependant as well.

Pinning FastAPI to 0.140.6 fixes the LiteLLM import:

uv pip install --python .venv/bin/python 'fastapi==0.140.6'

After that:

.venv/bin/litellm --version

works correctly and reports LiteLLM 1.96.0.

I also had to ensure the proxy extras/Prisma dependencies were installed and use the schema provided by litellm_proxy_extras before running the Prisma migration. After that LiteLLM starts successfully and the web UI is reachable.

So it may be worth:

  • pinning a compatible FastAPI version until the upstream LiteLLM issue is resolved;
  • checking whether .[proxy,extra_proxy] should be installed instead of only .[proxy];
  • using the Prisma schema shipped with litellm_proxy_extras for prisma generate / prisma migrate deploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants