feat: add vLLM LXC container script - #1678
Conversation
Adds privileged Ubuntu 24.04 LXC container for vLLM, an OpenAI-compatible inference server supporting NVIDIA GPU passthrough with CPU fallback. - Privileged container (var_unprivileged=0) for GPU passthrough - Ubuntu 24.04 for CUDA compatibility - Python venv install with nvidia-smi GPU detection and CPU fallback - Clean wrapper script pattern for systemd service (avoids heredoc escaping) - vllm-cli helper for start/stop/logs/config/models/version - Default model: Qwen/Qwen2.5-1.5B-Instruct (gated-free, small footprint) - OpenAI-compatible API on port 8000 Co-Authored-By: claude-flow <ruv@ruv.net>
|
Why was the PR template removed? |
|
Apologies for the missing template — updated the PR description to fill in the full ProxmoxVED template including all prerequisites, code/security review checklist, and application requirements (vLLM: 75k+ stars, active since Feb 2023, releases published). |
|
we normally prefer uv based venv to not interfere with system packages (this got suggested by some people) Also you seem to be missing the json file for the frontend, can you add that? check json folder and docs folder for help. |
Fixed :) |
… + add model requirements note
|
@piotrlaczykowski This PR has been marked as stale. It will be closed if no new commits are added in 7 days. |
- ct/vllm.sh: use check_for_gh_release + CHECK_UPDATE_RELEASE instead
of manual get_latest_gh_tag + version file comparison
- ct/vllm.sh: lower default resources to 4 CPU / 8192 MB RAM
- install/vllm-install.sh: use get_latest_github_release (strips v prefix)
instead of get_latest_gh_tag + manual ${RELEASE#v} stripping
- install/vllm-install.sh: default model changed to Qwen/Qwen2.5-0.5B-Instruct
(smallest ungated model), add comments with examples for other sizes
- json/vllm.json: update install_methods resources to 4 CPU / 8192 MB RAM
- json/vllm.json: update warning note to reflect new resource defaults
|
All resolved |
|
@piotrlaczykowski Recent activity detected. Removing stale label. |
|
Anyone to review? @CrazyWolf13 |
|
@piotrlaczykowski then request a review ^^ |
|
|
||
| if check_for_gh_release "vLLM" "vllm-project/vllm"; then | ||
| RELEASE="${CHECK_UPDATE_RELEASE}" | ||
| RELEASE_VERSION="${RELEASE#v}" |
There was a problem hiding this comment.
I think we don't need this extra var and can apply ${RELEASE#v} directly where needed
|
|
||
| msg_info "Updating ${APP} to ${RELEASE}" | ||
| $STD uv pip install --python /opt/vllm/.venv/bin/python --upgrade "vllm==${RELEASE_VERSION}" | ||
| msg_ok "Updated ${APP} to ${RELEASE}" |
There was a problem hiding this comment.
can you directly resovle the $app var
| echo -e "${INFO}${YW} Swagger docs:${CL}" | ||
| echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000/docs${CL}" |
There was a problem hiding this comment.
those probably don't need an extra info, as /docs is pretty much the standard and the api probably also not.
|
|
||
| RELEASE=$(get_latest_github_release "vllm-project/vllm") | ||
|
|
||
| msg_info "Installing ${APP} v${RELEASE} (Patience — this takes 5-15 minutes)" |
| msg_info "No GPU detected — installing vLLM with CPU/OpenVINO backend" | ||
| $STD uv pip install --python /opt/vllm/.venv/bin/python "vllm==${RELEASE}" --extra-index-url https://download.pytorch.org/whl/cpu | ||
| fi | ||
| echo "v${RELEASE}" >/opt/vLLM_version.txt |
There was a problem hiding this comment.
can you do this to ~/.vllm that is where we normally put it.
| msg_info "Configuring ${APP}" | ||
| mkdir -p /etc/vllm /opt/vllm-models | ||
| cat <<EOF >/etc/vllm/vllm.env | ||
| # Set MODEL to a Hugging Face model ID before starting the service. | ||
| # Example (small, ungated): Qwen/Qwen2.5-0.5B-Instruct | ||
| # Example (medium): Qwen/Qwen2.5-7B-Instruct | ||
| # Example (gated): meta-llama/Llama-3.1-8B-Instruct (requires HF_TOKEN) | ||
| MODEL="Qwen/Qwen2.5-0.5B-Instruct" | ||
| HOST="0.0.0.0" | ||
| PORT="8000" | ||
| GPU_MEM_UTIL="0.90" | ||
| MAX_MODEL_LEN="4096" | ||
| TENSOR_PARALLEL_SIZE="1" | ||
| QUANTIZATION="" | ||
| # HF_TOKEN="" | ||
| HF_HOME="/opt/vllm-models" | ||
| EOF | ||
| msg_ok "Configured ${APP}" | ||
|
|
||
| msg_info "Creating vLLM Server Wrapper" |
There was a problem hiding this comment.
| msg_info "Configuring ${APP}" | |
| mkdir -p /etc/vllm /opt/vllm-models | |
| cat <<EOF >/etc/vllm/vllm.env | |
| # Set MODEL to a Hugging Face model ID before starting the service. | |
| # Example (small, ungated): Qwen/Qwen2.5-0.5B-Instruct | |
| # Example (medium): Qwen/Qwen2.5-7B-Instruct | |
| # Example (gated): meta-llama/Llama-3.1-8B-Instruct (requires HF_TOKEN) | |
| MODEL="Qwen/Qwen2.5-0.5B-Instruct" | |
| HOST="0.0.0.0" | |
| PORT="8000" | |
| GPU_MEM_UTIL="0.90" | |
| MAX_MODEL_LEN="4096" | |
| TENSOR_PARALLEL_SIZE="1" | |
| QUANTIZATION="" | |
| # HF_TOKEN="" | |
| HF_HOME="/opt/vllm-models" | |
| EOF | |
| msg_ok "Configured ${APP}" | |
| msg_info "Creating vLLM Server Wrapper" | |
| msg_info "Configuring ${APP}" | |
| mkdir -p /etc/vllm /opt/vllm-models | |
| cat <<EOF >/etc/vllm/vllm.env | |
| # Set MODEL to a Hugging Face model ID before starting the service. | |
| # Example (small, ungated): Qwen/Qwen2.5-0.5B-Instruct | |
| # Example (medium): Qwen/Qwen2.5-7B-Instruct | |
| # Example (gated): meta-llama/Llama-3.1-8B-Instruct (requires HF_TOKEN) | |
| MODEL="Qwen/Qwen2.5-0.5B-Instruct" | |
| HOST="0.0.0.0" | |
| PORT="8000" | |
| GPU_MEM_UTIL="0.90" | |
| MAX_MODEL_LEN="4096" | |
| TENSOR_PARALLEL_SIZE="1" | |
| QUANTIZATION="" | |
| # HF_TOKEN="" | |
| HF_HOME="/opt/vllm-models" | |
| EOF |
No extra msg block needed for such short actions
| "interface_port": 8000, | ||
| "documentation": "https://docs.vllm.ai", | ||
| "website": "https://github.com/vllm-project/vllm", | ||
| "logo": "https://raw.githubusercontent.com/vllm-project/vllm/main/docs/source/assets/logos/vllm-logo-text-light.png", |
There was a problem hiding this comment.
utilize one from selfh.st/icons
| "cpu": 4, | ||
| "ram": 8192, | ||
| "hdd": 40, | ||
| "os": "Ubuntu", |
There was a problem hiding this comment.
is ubuntu preferrable from debian in any way?
because of drivers?
| }, | ||
| "notes": [ | ||
| { | ||
| "text": "GPU passthrough requires a privileged LXC container with NVIDIA drivers installed on the Proxmox host. Edit /etc/vllm/vllm.env to configure model and settings before starting the service.", |
There was a problem hiding this comment.
that is just wrong, it does not need to be priviledged for gpu passthrough
|
no feedback, stale pr / closed |
✍️ Description
Adds `ct/vllm.sh` and `install/vllm-install.sh` for a privileged Ubuntu 24.04 LXC running vLLM, an OpenAI-compatible inference server for local LLM inference with NVIDIA GPU passthrough.
Key design decisions:
Default resources: 8 vCPU · 16 GB RAM · 40 GB disk · Ubuntu 24.04
🔗 Related PR / Issue
Link: N/A — new script submission
✅ Prerequisites (X in brackets)
🛠️ Type of Change (X in brackets)
🔍 Code & Security Review (X in brackets)
📋 Additional Information (optional)
The service intentionally does not auto-start on first install. GPU model loading can take several minutes depending on model size and hardware. Users should edit `/etc/vllm/vllm.env` to set their preferred model, then start with `vllm-cli start`.
📦 Application Requirements (for new scripts)
🌐 Source