Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Sam Heinz
2025-05-13 00:58:31 +10:00
244 changed files with 7969 additions and 5013 deletions
+32 -12
View File
@@ -1,8 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck
# Author: tteck
# Co-Author: havardthom
# Author: havardthom | Co-Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://ollama.com/
@@ -16,11 +15,8 @@ update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
gpg \
git \
build-essential \
pkg-config \
cmake
pkg-config
msg_ok "Installed Dependencies"
msg_info "Installing Golang"
@@ -55,11 +51,35 @@ fi
msg_ok "Set Up Hardware Acceleration"
msg_info "Installing Ollama (Patience)"
$STD git clone https://github.com/ollama/ollama.git /opt/ollama
cd /opt/ollama
$STD go generate ./...
$STD go build .
msg_ok "Installed Ollama"
RELEASE=$(curl -fsSL https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
OLLAMA_INSTALL_DIR="/usr/local/lib/ollama"
BINDIR="/usr/local/bin"
mkdir -p $OLLAMA_INSTALL_DIR
OLLAMA_URL="https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz"
TMP_TAR="/tmp/ollama.tgz"
echo -e "\n"
if curl -fL# -o "$TMP_TAR" "$OLLAMA_URL"; then
if tar -xzf "$TMP_TAR" -C "$OLLAMA_INSTALL_DIR"; then
ln -sf "$OLLAMA_INSTALL_DIR/bin/ollama" "$BINDIR/ollama"
echo "${RELEASE}" >/opt/Ollama_version.txt
msg_ok "Installed Ollama ${RELEASE}"
else
msg_error "Extraction failed archive corrupt or incomplete"
exit 1
fi
else
msg_error "Download failed $OLLAMA_URL not reachable"
exit 1
fi
msg_info "Creating ollama User and Group"
if ! id ollama >/dev/null 2>&1; then
useradd -r -s /usr/sbin/nologin -U -m -d /usr/share/ollama ollama
fi
$STD usermod -aG render ollama || true
$STD usermod -aG video ollama || true
$STD usermod -aG ollama $(id -u -n)
msg_ok "Created ollama User and adjusted Groups"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/ollama.service
@@ -69,7 +89,7 @@ After=network-online.target
[Service]
Type=exec
ExecStart=/opt/ollama/ollama serve
ExecStart=/usr/local/bin/ollama serve
Environment=HOME=$HOME
Environment=OLLAMA_INTEL_GPU=true
Environment=OLLAMA_HOST=0.0.0.0