diff options
author | tdback <tyler@tdback.net> | 2025-03-22 15:56:13 -0400 |
---|---|---|
committer | tdback <tyler@tdback.net> | 2025-03-22 15:56:13 -0400 |
commit | 99d725b51bda1dfe38cbee939f7d6ff215491084 (patch) | |
tree | 2370e19b812524d9765673431d9268d34558df2d /modules/services/llm/default.nix | |
parent | f517b4789e6543f77958a143f302ce5d6b5a696e (diff) |
modules: retire unused modules
Diffstat (limited to 'modules/services/llm/default.nix')
-rw-r--r-- | modules/services/llm/default.nix | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/modules/services/llm/default.nix b/modules/services/llm/default.nix deleted file mode 100644 index e2e08a9..0000000 --- a/modules/services/llm/default.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ - config, - lib, - ... -}: -with lib; -let - cfg = config.modules.services.llm; -in -{ - options.modules.services.llm = { - enable = mkEnableOption "llm"; - port = mkOption { - default = 8080; - type = types.int; - description = "Which port the Open-WebUI server listens to."; - }; - subnet = mkOption { - default = null; - type = types.str; - description = "The network subnet allowed to acccess Open-WebUI and the ollama API"; - }; - nvidiaGpu = mkOption { - default = false; - type = types.bool; - description = "Use NVIDIA cuda for hardware acceleration."; - }; - models = mkOption { - default = [ ]; - type = types.listOf types.str; - description = "Automatically download these models."; - }; - }; - - config = mkIf cfg.enable { - services.ollama = { - enable = true; - acceleration = if cfg.nvidiaGpu then "cuda" else false; - loadModels = cfg.models; - }; - - services.open-webui = { - enable = true; - host = if cfg.subnet == null then "127.0.0.1" else "0.0.0.0"; - port = cfg.port; - }; - - # Only expose Open-WebUI and ollama API to the local network, since this - # server might have a public IPv6 address. - networking.firewall.extraCommands = - with config.services; - let - api = builtins.toString ollama.port; - web = builtins.toString open-webui.port; - in - mkIf (cfg.subnet != null) '' - iptables -A nixos-fw -p tcp --source ${cfg.subnet} --dport ${api}:${api} -j nixos-fw-accept - iptables -A nixos-fw -p tcp --source ${cfg.subnet} --dport ${web}:${web} -j nixos-fw-accept - ''; - - # Enable the proprietary NVIDIA drivers in a headless fashion. - hardware.graphics.enable = cfg.nvidiaGpu; - services.xserver.videoDrivers = mkIf cfg.nvidiaGpu [ "nvidia" ]; - hardware.nvidia = mkIf cfg.nvidiaGpu { - package = config.boot.kernelPackages.nvidiaPackages.stable; - open = false; - nvidiaPersistenced = true; - }; - }; -} |