feat(jeeves)!: re-enable ollama and expose it through nginx

This commit is contained in:
reo101 2024-09-01 17:40:36 +03:00
parent 479c86c003
commit eddd9be861
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
2 changed files with 25 additions and 4 deletions

View file

@ -13,7 +13,7 @@
# ./home-assistant
./samba.nix
# ./steam.nix
# ./ollama.nix
./ollama.nix
# ./sunshine.nix
# ./photoprism.nix
# ./immich.nix

View file

@ -1,6 +1,7 @@
{ inputs, lib, pkgs, config, ... }:
{
networking.firewall.allowedTCPPorts = [11434];
# NOTE: no need now (nginx)
# networking.firewall.allowedTCPPorts = [11434];
services.ollama = {
enable = true;
@ -8,7 +9,17 @@
port = 11434;
acceleration = "rocm";
environmentVariables = {
OLLAMA_ORIGINS = "*";
# NOTE: no need now (nginx), should be only `127.0.0.1`
# OLLAMA_ORIGINS = "*";
};
};
services.nginx.virtualHosts."ollama.jeeves.local" = {
enableACME = false;
forceSSL = false;
locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString config.services.ollama.port}";
proxyWebsockets = true;
};
};
@ -25,6 +36,16 @@
# Disable authentication
WEBUI_AUTH = "False";
};
openFirewall = true;
# NOTE: no need now (nginx)
# openFirewall = true;
};
services.nginx.virtualHosts."openwebui.jeeves.local" = {
enableACME = false;
forceSSL = false;
locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString config.services.open-webui.port}";
proxyWebsockets = true;
};
};
}