Skip to content

Commit df9581e

Browse files
committed
Add vLLM CT script and GPU passthrough support
Introduce full vLLM container integration with new `ct/vllm.sh` and `install/vllm-install.sh` scripts, including uv/Python setup, hardware acceleration setup, systemd service creation, and update flow. Add `json/vllm.json` metadata with defaults, access details, and operational notes, and register `vllm` in `misc/passthrough.func` so GPU passthrough selection supports the app.
1 parent cf3694c commit df9581e

4 files changed

Lines changed: 181 additions & 0 deletions

File tree

‎ct/vllm.sh‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
source "$(dirname "${BASH_SOURCE[0]}")/../misc/build.func" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_URL:-https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main}/misc/build.func")
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: community-scripts ORG
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
6+
# Source: https://github.com/vllm-project/vllm
7+
8+
APP="vLLM"
9+
var_tags="${var_tags:-ai;llm;inference}"
10+
var_cpu="${var_cpu:-4}"
11+
var_ram="${var_ram:-8192}"
12+
var_disk="${var_disk:-20}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_arm64="${var_arm64:-no}"
16+
var_unprivileged="${var_unprivileged:-1}"
17+
18+
header_info "$APP"
19+
variables
20+
color
21+
catch_errors
22+
23+
function update_script() {
24+
header_info
25+
check_container_storage
26+
check_container_resources
27+
28+
if [[ ! -d /opt/vllm ]]; then
29+
msg_error "No ${APP} Installation Found!"
30+
exit 1
31+
fi
32+
33+
if check_for_gh_release "vllm" "vllm-project/vllm"; then
34+
msg_info "Stopping Service"
35+
systemctl stop vllm
36+
msg_ok "Stopped Service"
37+
38+
create_backup /opt/vllm/vllm.env
39+
40+
msg_info "Updating vLLM (Patience)"
41+
$STD uv pip install --python /opt/vllm/bin/python --upgrade vllm
42+
msg_ok "Updated vLLM"
43+
44+
restore_backup
45+
46+
msg_info "Starting Service"
47+
systemctl start vllm
48+
msg_ok "Started Service"
49+
msg_ok "Updated successfully!"
50+
fi
51+
cleanup_lxc
52+
exit
53+
}
54+
55+
start
56+
build_container
57+
description
58+
59+
msg_ok "Completed Successfully!\n"
60+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
61+
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
62+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000/v1${CL}"

‎install/vllm-install.sh‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: community-scripts ORG
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
6+
# Source: https://github.com/vllm-project/vllm
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt install -y \
18+
build-essential \
19+
python3-dev
20+
msg_ok "Installed Dependencies"
21+
22+
PYTHON_VERSION="3.12" setup_uv
23+
setup_hwaccel
24+
25+
msg_info "Installing vLLM (Patience)"
26+
$STD uv venv --python 3.12 /opt/vllm
27+
$STD uv pip install --python /opt/vllm/bin/python vllm
28+
cat <<EOF >~/.vllm
29+
$(get_latest_github_release "vllm-project/vllm")
30+
EOF
31+
msg_ok "Installed vLLM"
32+
33+
msg_info "Configuring vLLM"
34+
mkdir -p /opt/vllm/models
35+
cat <<EOF >/opt/vllm/vllm.env
36+
VLLM_MODEL=Qwen/Qwen2.5-0.5B-Instruct
37+
VLLM_HOST=0.0.0.0
38+
VLLM_PORT=8000
39+
HF_HOME=/opt/vllm/models
40+
HF_TOKEN=
41+
EOF
42+
msg_ok "Configured vLLM"
43+
44+
msg_info "Creating Service"
45+
cat <<EOF >/etc/systemd/system/vllm.service
46+
[Unit]
47+
Description=vLLM OpenAI-Compatible Inference Server
48+
After=network-online.target
49+
Wants=network-online.target
50+
51+
[Service]
52+
Type=simple
53+
WorkingDirectory=/opt/vllm
54+
EnvironmentFile=/opt/vllm/vllm.env
55+
ExecStart=/opt/vllm/bin/vllm serve \${VLLM_MODEL} --host \${VLLM_HOST} --port \${VLLM_PORT}
56+
Restart=on-failure
57+
RestartSec=10
58+
TimeoutStartSec=0
59+
60+
[Install]
61+
WantedBy=multi-user.target
62+
EOF
63+
systemctl enable -q --now vllm
64+
msg_ok "Created Service"
65+
66+
motd_ssh
67+
customize
68+
cleanup_lxc

‎json/vllm.json‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "vLLM",
3+
"slug": "vllm",
4+
"categories": [
5+
20
6+
],
7+
"date_created": "2026-07-24",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"has_arm": false,
12+
"interface_port": 8000,
13+
"documentation": "https://docs.vllm.ai/",
14+
"website": "https://vllm.ai/",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/vllm.webp",
16+
"config_path": "/opt/vllm/vllm.env",
17+
"description": "vLLM is a high-throughput, memory-efficient inference and serving engine for LLMs. It exposes an OpenAI-compatible HTTP API (/v1) so existing OpenAI clients can serve local models.",
18+
"install_methods": [
19+
{
20+
"type": "default",
21+
"script": "ct/vllm.sh",
22+
"config_path": "/opt/vllm/vllm.env",
23+
"resources": {
24+
"cpu": 4,
25+
"ram": 8192,
26+
"hdd": 20,
27+
"os": "Debian",
28+
"version": "13"
29+
}
30+
}
31+
],
32+
"default_credentials": {
33+
"username": null,
34+
"password": null
35+
},
36+
"notes": [
37+
{
38+
"text": "Select NVIDIA GPU passthrough at container creation. vLLM installs the CUDA build by default and requires an NVIDIA GPU for usable performance; CPU-only inference is impractically slow.",
39+
"type": "warning"
40+
},
41+
{
42+
"text": "The model to serve is set via VLLM_MODEL in /opt/vllm/vllm.env (default Qwen/Qwen2.5-0.5B-Instruct). Restart the service after changing it: systemctl restart vllm",
43+
"type": "info"
44+
},
45+
{
46+
"text": "The configured model is downloaded from HuggingFace on first service start, which needs internet access and disk space. For gated/private models set HF_TOKEN in /opt/vllm/vllm.env. Resource needs scale heavily with the chosen model.",
47+
"type": "info"
48+
}
49+
]
50+
}

‎misc/passthrough.func‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ _GPU_APPS=(
7777
fileflows
7878
"open webui"
7979
tunarr
80+
vllm
8081
debian
8182
)
8283

0 commit comments

Comments
 (0)