diff --git a/systems/artemision/configuration.nix b/systems/artemision/configuration.nix index 2edc4b9..172df93 100644 --- a/systems/artemision/configuration.nix +++ b/systems/artemision/configuration.nix @@ -80,7 +80,6 @@ users.users = { alice.extraGroups = [ "calibre-web" ]; }; - users.groups.ollama = { }; system.stateVersion = "24.05"; diff --git a/systems/palatine-hill/docker/default.nix b/systems/palatine-hill/docker/default.nix index 6535987..b365625 100644 --- a/systems/palatine-hill/docker/default.nix +++ b/systems/palatine-hill/docker/default.nix @@ -20,7 +20,7 @@ ./nextcloud.nix # ./postgres.nix # ./restic.nix - ./torr.nix + #./torr.nix # ./unifi.nix ]; diff --git a/systems/palatine-hill/ollama.nix b/systems/palatine-hill/ollama.nix index 8ee64db..9cfd4ec 100644 --- a/systems/palatine-hill/ollama.nix +++ b/systems/palatine-hill/ollama.nix @@ -2,6 +2,9 @@ pkgs, ... }: +let + vars = import ./vars.nix; +in { services = { ollama = { @@ -20,6 +23,7 @@ "qwen2.5-coder:1.5b-base" "nomic-embed-text:latest" ]; + models = vars.primary_ollama; environmentVariables = { FLASH_ATTENTION = "1"; OLLAMA_KV_CACHE_TYPE = "q8_0"; @@ -35,10 +39,12 @@ # context length for agents OLLAMA_CONTEXT_LENGTH = "64000"; }; + openFirewall = true; }; open-webui = { enable = true; port = 21212; + openFirewall = true; }; }; users.users.ollama = { @@ -50,4 +56,16 @@ isSystemUser = true; }; users.groups.ollama = { }; + systemd.services = { + ollama.serviceConfig = { + Nice = 19; + IOSchedulingPriority = 7; + }; + ollama-model-loader.serviceConfig = { + Nice = 19; + CPUWeight = 50; + IOSchedulingClass = "idle"; + IOSchedulingPriority = 7; + }; + }; } diff --git a/systems/palatine-hill/vars.nix b/systems/palatine-hill/vars.nix index 8566078..821c461 100644 --- a/systems/palatine-hill/vars.nix +++ b/systems/palatine-hill/vars.nix @@ -19,4 +19,5 @@ rec { primary_torr = "${zfs_primary}/torr"; primary_plex = "${zfs_primary}/plex"; primary_plex_storage = "${zfs_primary}/plex_storage"; + primary_ollama = "${zfs_primary}/ollama"; }