Normalize Ollama host configuration
This commit is contained in:
parent
3c5dfd08c2
commit
61db0ce277
|
|
@ -64,6 +64,9 @@ host, run:
|
||||||
Installer downloads prefer IPv4 by default because some networks have broken or
|
Installer downloads prefer IPv4 by default because some networks have broken or
|
||||||
slow IPv6 paths to `ollama.com`. Override with
|
slow IPv6 paths to `ollama.com`. Override with
|
||||||
`LAB_OLLAMA_INSTALL_CURL_IP_VERSION=` if you want curl's automatic behavior.
|
`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
|
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:
|
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_host: 0.0.0.0:11434
|
||||||
debian_pc_ollama_models_dir: /data/ollama/models
|
debian_pc_ollama_models_dir: /data/ollama/models
|
||||||
debian_pc_ollama_default_model: qwen2.5:0.5b
|
debian_pc_ollama_default_model: qwen2.5:0.5b
|
||||||
|
debian_pc_ollama_igpu_enable: "false"
|
||||||
|
|
||||||
debian_pc_persistent_directories:
|
debian_pc_persistent_directories:
|
||||||
- /data/openebs/local/registry
|
- /data/openebs/local/registry
|
||||||
|
|
|
||||||
|
|
@ -318,6 +318,7 @@
|
||||||
[Service]
|
[Service]
|
||||||
Environment="OLLAMA_HOST={{ debian_pc_ollama_host }}"
|
Environment="OLLAMA_HOST={{ debian_pc_ollama_host }}"
|
||||||
Environment="OLLAMA_MODELS={{ debian_pc_ollama_models_dir }}"
|
Environment="OLLAMA_MODELS={{ debian_pc_ollama_models_dir }}"
|
||||||
|
Environment="OLLAMA_IGPU_ENABLE={{ debian_pc_ollama_igpu_enable }}"
|
||||||
register: debian_pc_ollama_override
|
register: debian_pc_ollama_override
|
||||||
when: debian_pc_install_ollama | bool
|
when: debian_pc_install_ollama | bool
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ services:
|
||||||
url: http://192.168.100.73:11434
|
url: http://192.168.100.73:11434
|
||||||
bind_address: 0.0.0.0:11434
|
bind_address: 0.0.0.0:11434
|
||||||
models_dir: /data/ollama/models
|
models_dir: /data/ollama/models
|
||||||
|
igpu_enable: false
|
||||||
rpi_dns:
|
rpi_dns:
|
||||||
host: rpi4
|
host: rpi4
|
||||||
pihole_dns_port: 53
|
pihole_dns_port: 53
|
||||||
|
|
|
||||||
7
jeannie
7
jeannie
|
|
@ -60,6 +60,7 @@ mapping = {
|
||||||
"services.local_registry.endpoint": "LAB_REGISTRY_ENDPOINT",
|
"services.local_registry.endpoint": "LAB_REGISTRY_ENDPOINT",
|
||||||
"services.ollama.bind_address": "LAB_OLLAMA_BIND_ADDRESS",
|
"services.ollama.bind_address": "LAB_OLLAMA_BIND_ADDRESS",
|
||||||
"services.ollama.models_dir": "LAB_OLLAMA_MODELS_DIR",
|
"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.pihole_web_port": "PIHOLE_WEB_PORT",
|
||||||
"services.rpi_dns.uptime_kuma_port": "UPTIME_KUMA_PORT",
|
"services.rpi_dns.uptime_kuma_port": "UPTIME_KUMA_PORT",
|
||||||
"ai_gateway.provider": "LAB_AI_GATEWAY_PROVIDER",
|
"ai_gateway.provider": "LAB_AI_GATEWAY_PROVIDER",
|
||||||
|
|
@ -3393,12 +3394,16 @@ website_translation_model() {
|
||||||
website_ollama_listen() {
|
website_ollama_listen() {
|
||||||
local bind_address="${WEBSITE_OLLAMA_BIND_ADDRESS:-${LAB_OLLAMA_BIND_ADDRESS:-0.0.0.0:11434}}"
|
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 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_dir="/etc/systemd/system/ollama.service.d"
|
||||||
local dropin_file="${dropin_dir}/homelab.conf"
|
local dropin_file="${dropin_dir}/homelab.conf"
|
||||||
local waited=0
|
local waited=0
|
||||||
|
|
||||||
require_debian_server "website-ollama-listen"
|
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
|
if ! systemctl cat ollama.service >/dev/null 2>&1; then
|
||||||
echo "ollama.service was not found on this Debian server." >&2
|
echo "ollama.service was not found on this Debian server." >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -3410,7 +3415,7 @@ website_ollama_listen() {
|
||||||
if id ollama >/dev/null 2>&1; then
|
if id ollama >/dev/null 2>&1; then
|
||||||
sudo chown ollama:ollama "${models_dir}"
|
sudo chown ollama:ollama "${models_dir}"
|
||||||
fi
|
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 tee "${dropin_file}" >/dev/null
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl restart ollama.service
|
sudo systemctl restart ollama.service
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue