Compare commits
2 Commits
26be9bfb0c
...
61db0ce277
| Author | SHA1 | Date |
|---|---|---|
|
|
61db0ce277 | |
|
|
3c5dfd08c2 |
|
|
@ -64,6 +64,9 @@ host, run:
|
|||
Installer downloads prefer IPv4 by default because some networks have broken or
|
||||
slow IPv6 paths to `ollama.com`. Override with
|
||||
`LAB_OLLAMA_INSTALL_CURL_IP_VERSION=` if you want curl's automatic behavior.
|
||||
The Ryzen integrated GPU is left disabled for Ollama by default; set
|
||||
`LAB_OLLAMA_IGPU_ENABLE=true` or `debian_pc_ollama_igpu_enable: "true"` when
|
||||
you intentionally want to test Vulkan/iGPU inference.
|
||||
|
||||
If the Debian host cannot reach `ollama.com`, download the matching Linux
|
||||
tarball from another machine, copy it to Debian, and point `jeannie` at it:
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ debian_pc_ollama_tarball_file: ""
|
|||
debian_pc_ollama_host: 0.0.0.0:11434
|
||||
debian_pc_ollama_models_dir: /data/ollama/models
|
||||
debian_pc_ollama_default_model: qwen2.5:0.5b
|
||||
debian_pc_ollama_igpu_enable: "false"
|
||||
|
||||
debian_pc_persistent_directories:
|
||||
- /data/openebs/local/registry
|
||||
|
|
|
|||
|
|
@ -318,6 +318,7 @@
|
|||
[Service]
|
||||
Environment="OLLAMA_HOST={{ debian_pc_ollama_host }}"
|
||||
Environment="OLLAMA_MODELS={{ debian_pc_ollama_models_dir }}"
|
||||
Environment="OLLAMA_IGPU_ENABLE={{ debian_pc_ollama_igpu_enable }}"
|
||||
register: debian_pc_ollama_override
|
||||
when: debian_pc_install_ollama | bool
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ services:
|
|||
url: http://192.168.100.73:11434
|
||||
bind_address: 0.0.0.0:11434
|
||||
models_dir: /data/ollama/models
|
||||
igpu_enable: false
|
||||
rpi_dns:
|
||||
host: rpi4
|
||||
pihole_dns_port: 53
|
||||
|
|
|
|||
21
jeannie
21
jeannie
|
|
@ -60,6 +60,7 @@ mapping = {
|
|||
"services.local_registry.endpoint": "LAB_REGISTRY_ENDPOINT",
|
||||
"services.ollama.bind_address": "LAB_OLLAMA_BIND_ADDRESS",
|
||||
"services.ollama.models_dir": "LAB_OLLAMA_MODELS_DIR",
|
||||
"services.ollama.igpu_enable": "LAB_OLLAMA_IGPU_ENABLE",
|
||||
"services.rpi_dns.pihole_web_port": "PIHOLE_WEB_PORT",
|
||||
"services.rpi_dns.uptime_kuma_port": "UPTIME_KUMA_PORT",
|
||||
"ai_gateway.provider": "LAB_AI_GATEWAY_PROVIDER",
|
||||
|
|
@ -3393,11 +3394,16 @@ website_translation_model() {
|
|||
website_ollama_listen() {
|
||||
local bind_address="${WEBSITE_OLLAMA_BIND_ADDRESS:-${LAB_OLLAMA_BIND_ADDRESS:-0.0.0.0:11434}}"
|
||||
local models_dir="${LAB_OLLAMA_MODELS_DIR:-/data/ollama/models}"
|
||||
local igpu_enable="${LAB_OLLAMA_IGPU_ENABLE:-false}"
|
||||
local dropin_dir="/etc/systemd/system/ollama.service.d"
|
||||
local dropin_file="${dropin_dir}/homelab.conf"
|
||||
local waited=0
|
||||
|
||||
require_debian_server "website-ollama-listen"
|
||||
|
||||
bind_address="${bind_address#http://}"
|
||||
bind_address="${bind_address#https://}"
|
||||
|
||||
if ! systemctl cat ollama.service >/dev/null 2>&1; then
|
||||
echo "ollama.service was not found on this Debian server." >&2
|
||||
exit 1
|
||||
|
|
@ -3409,14 +3415,23 @@ website_ollama_listen() {
|
|||
if id ollama >/dev/null 2>&1; then
|
||||
sudo chown ollama:ollama "${models_dir}"
|
||||
fi
|
||||
printf '[Service]\nEnvironment="OLLAMA_HOST=%s"\nEnvironment="OLLAMA_MODELS=%s"\n' "${bind_address}" "${models_dir}" |
|
||||
printf '[Service]\nEnvironment="OLLAMA_HOST=%s"\nEnvironment="OLLAMA_MODELS=%s"\nEnvironment="OLLAMA_IGPU_ENABLE=%s"\n' "${bind_address}" "${models_dir}" "${igpu_enable}" |
|
||||
sudo tee "${dropin_file}" >/dev/null
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama.service
|
||||
sudo systemctl is-active --quiet ollama.service
|
||||
|
||||
echo "Ollama service is active. Verifying http://${bind_address%:*}:11434/api/tags..."
|
||||
curl -fsS "http://127.0.0.1:11434/api/tags" >/dev/null
|
||||
echo "Ollama service is active. Waiting for http://127.0.0.1:11434/api/tags..."
|
||||
until curl -fsS --connect-timeout 2 --max-time 5 "http://127.0.0.1:11434/api/tags" >/dev/null 2>&1; do
|
||||
waited=$((waited + 2))
|
||||
if ((waited >= 60)); then
|
||||
echo "Ollama service did not expose the local API after ${waited}s." >&2
|
||||
echo "Recent service logs:" >&2
|
||||
sudo journalctl -u ollama.service -n 80 --no-pager >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
echo "Ollama API is reachable on the Debian host."
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue