{ config, pkgs, ... }: let domain = "pino.giugl.io"; backendPort = 8080; frontendPort = 3030; # llama-cpp = pkgs.unstablePkgs.llama-cpp.override { cudaSupport = true; }; # ollama = pkgs.unstablePkgs.ollama.override { inherit llama-cpp; }; in { # environment.systemPackages = [ ollama ]; architect.vhost.${domain} = { dnsInterfaces = [ "tailscale" ]; locations."/" = { host = "172.17.0.1"; port = frontendPort; allowLan = true; allowWAN = true; # allow = [ config.architect.networks."tailscale".net ]; extraConfig = '' proxy_read_timeout 600s; ''; }; }; architect.vhost."ollama.giugl.io" = { dnsInterfaces = [ "tailscale" ]; locations."/" = { host = "172.17.0.1"; port = 11434; allowLan = true; allowWAN = true; # allow = [ config.architect.networks."tailscale".net ]; extraConfig = '' proxy_read_timeout 600s; ''; }; }; virtualisation.oci-containers = { containers = { ollama-webui = { image = "ghcr.io/open-webui/open-webui:main"; autoStart = true; ports = [ "172.17.0.1:${toString frontendPort}:${toString backendPort}" ]; environment = { PORT = "${toString backendPort}"; OLLAMA_API_BASE_URL = "http://172.17.0.1:11434/api"; }; extraOptions = [ "--pull=always" ]; volumes = [ "/var/lib/ollama-webui:/app/backend/data" ]; }; ollama = { image = "ollama/ollama:latest"; autoStart = true; extraOptions = [ "--pull=always" "--gpus=all" ]; environment = { OLLAMA_ORIGINS = "*"; }; volumes = [ "/ollama:/root/.ollama" ]; ports = [ "127.0.0.1:11434:11434" "172.17.0.1:11434:11434" ]; }; }; }; }