Skip to content

Commit

Permalink
add: open-webui
Browse files Browse the repository at this point in the history
  • Loading branch information
KP64 committed Dec 27, 2024
1 parent e364fb4 commit fb30ce7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
18 changes: 10 additions & 8 deletions hosts/kg/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
system = {
inherit stateVersion;
boot.efi.enable = true;
language = "de";
impermanence.enable = true;
security = {
uutils-coreutils.enable = true;
Expand Down Expand Up @@ -205,13 +204,16 @@
physicalConnections = [ (topology.mkConnectionRev "router" "wifi") ];
};

services.ai.ollama = {
enable = true;
acceleration = "cuda";
models = [
"llama3.2"
"llama3.1:8b"
];
services.ai = {
open-webui.enable = true;
ollama = {
enable = true;
acceleration = "cuda";
models = [
"llama3.2"
"llama3.1:8b"
];
};
};

time.timeZone = "Europe/Berlin";
Expand Down
7 changes: 6 additions & 1 deletion services/ai/default.nix
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{ imports = [ ./ollama.nix ]; }
{
imports = [
./ollama.nix
./open-webui.nix
];
}
23 changes: 23 additions & 0 deletions services/ai/open-webui.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ config, lib, ... }:
let
cfg = config.services.ai.open-webui;
in
{
options.services.ai.open-webui.enable = lib.mkEnableOption "Open-Webui";

config = lib.mkMerge [
{
services.open-webui = {
inherit (cfg) enable;
host = "0.0.0.0";
port = 11111;
openFirewall = true;
};
}

(lib.mkIf config.isImpermanenceEnabled {
environment.persistence."/persist".directories =
lib.optional cfg.enable "/var/lib/private/open-webui";
})
];
}

0 comments on commit fb30ce7

Please sign in to comment.