You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop carrying the unit file in install.sh, add it to the repository, this allows distributions to cleanly package the unit.
Download the new configuration file as /etc/ollama.conf.example and if /etc/ollama.conf does not exist, copy the example there, otherwise keep user configuration intact.
[Service]
EnvironmentFile=/etc/ollama.conf
This also allows for having all of the options in the configuration neatly visible, instead of having to wade through help/documentation for simple things.
Example config of mine:
# /etc/ollama.conf# The host:port to bind to (default "127.0.0.1:11434")
OLLAMA_HOST=0.0.0.0:11434
# A comma separated list of allowed origins.
OLLAMA_ORIGINS=*://localhost,*://192.168.1.40,*://192.168.1.10
# The path to the models directory (default is "~/.ollama/models")
OLLAMA_MODELS=/models/ollama
HOME=/var/lib/ollama
GIN_MODE=release
What is the impact of not solving this?
Distribution packaging is hard and configuration of ollama has to be done by overriding systemd units.
Anything else?
Adapting hardening from the Arch Linux unit might be a good idea, already saw people in this repository trying to give Ollama permissions to their home folders which the unit prevents.
What are you trying to do?
Run Llama service on Linux via systemd and being able to configure it without unit overrides through a configuration file.
How should we solve this?
Stop using
Environment
, useEnvironmentFile
instead inollama/scripts/install.sh
Lines 100 to 116 in cb03fc9
https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=
Edit documentation accordingly - https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-linux
Stop carrying the unit file in install.sh, add it to the repository, this allows distributions to cleanly package the unit.
Download the new configuration file as
/etc/ollama.conf.example
and if /etc/ollama.conf does not exist, copy the example there, otherwise keep user configuration intact.This also allows for having all of the options in the configuration neatly visible, instead of having to wade through help/documentation for simple things.
Example config of mine:
What is the impact of not solving this?
Distribution packaging is hard and configuration of ollama has to be done by overriding systemd units.
Anything else?
Adapting hardening from the Arch Linux unit might be a good idea, already saw people in this repository trying to give Ollama permissions to their home folders which the unit prevents.
https://gitlab.archlinux.org/archlinux/packaging/packages/ollama/-/blob/7418e63fb87fd43277a6051466325081680d1627/ollama.service
The text was updated successfully, but these errors were encountered: