From 8cd1c4d276221d86ac80206fe17bcdbf10756ba4 Mon Sep 17 00:00:00 2001 From: oqyude Date: Thu, 31 Jul 2025 13:43:10 +0300 Subject: [PATCH] ai setup --- flake.nix | 1 + home/main.nix | 4 ++++ modules/server/ai.nix | 20 ++++++++++++++++++++ modules/software/ai.nix | 17 +++++++++++++---- 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100755 modules/server/ai.nix diff --git a/flake.nix b/flake.nix index c9af0e8..8e1f525 100755 --- a/flake.nix +++ b/flake.nix @@ -117,6 +117,7 @@ }; }; server = { + ai = import ./modules/server/ai.nix flakeContext; cloudflared = import ./modules/server/cloudflared.nix flakeContext; immich = import ./modules/server/immich.nix flakeContext; nextcloud = import ./modules/server/nextcloud.nix flakeContext; diff --git a/home/main.nix b/home/main.nix index e69d541..0d83fda 100755 --- a/home/main.nix +++ b/home/main.nix @@ -69,6 +69,10 @@ let source = config.lib.file.mkOutOfStoreSymlink "${inputs.zeroq.dirs.therima-drive}"; target = "External"; }; + "LM Studio" = { + source = config.lib.file.mkOutOfStoreSymlink "${inputs.zeroq.dirs.vetymae-drive}/AI/LM Studio"; + target = ".lmstudio"; + }; }; pointerCursor = { enable = true; diff --git a/modules/server/ai.nix b/modules/server/ai.nix new file mode 100755 index 0000000..c52d081 --- /dev/null +++ b/modules/server/ai.nix @@ -0,0 +1,20 @@ +{ inputs, ... }@flakeContext: +{ + config, + lib, + pkgs, + ... +}: +{ + services.open-webui = { + enable = true; + environment = { + ANONYMIZED_TELEMETRY = "False"; + DO_NOT_TRACK = "True"; + SCARF_NO_ANALYTICS = "True"; + OLLAMA_API_BASE_URL = "http://127.0.0.1:1234"; + # Disable authentication + WEBUI_AUTH = "False"; + }; + }; +} diff --git a/modules/software/ai.nix b/modules/software/ai.nix index fa12dfd..12eee8b 100755 --- a/modules/software/ai.nix +++ b/modules/software/ai.nix @@ -7,11 +7,22 @@ }: { services = { - nextjs-ollama-llm-ui.enable = true; - ollama = { + nextjs-ollama-llm-ui.enable = false; + open-webui = { enable = true; + environment = { + ANONYMIZED_TELEMETRY = "False"; + DO_NOT_TRACK = "True"; + SCARF_NO_ANALYTICS = "True"; + OLLAMA_API_BASE_URL = "http://127.0.0.1:1234"; + WEBUI_AUTH = "False"; # Disable authentication + }; + }; + ollama = { + enable = false; package = pkgs.ollama-rocm; environmentVariables = { + HSA_OVERRIDE_GFX_VERSION = "11.5.0"; HCC_AMDGPU_TARGET = "gfx1150"; # used to be necessary, but doesn't seem to anymore }; user = "ollama"; # "${inputs.zeroq.devices.admin}"; @@ -23,8 +34,6 @@ }; }; - services.open-webui.enable = true; - nixpkgs.config.permittedInsecurePackages = [ "libsoup-2.74.3" ];