2024-01-09 13:59:25 +00:00
|
|
|
{ config, pkgs, ... }:
|
2023-11-16 12:25:58 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
domain = "pino.giugl.io";
|
|
|
|
backendPort = 3000;
|
|
|
|
frontendPort = 3002;
|
2024-01-09 13:59:25 +00:00
|
|
|
llama-cpp = pkgs.unstablePkgs.llama-cpp.override { cudaSupport = true; };
|
|
|
|
ollama = pkgs.unstablePkgs.ollama.override { inherit llama-cpp; };
|
2023-11-16 12:25:58 +00:00
|
|
|
in
|
|
|
|
{
|
2024-01-09 13:59:25 +00:00
|
|
|
environment.systemPackages = [ ollama ];
|
2023-11-16 12:25:58 +00:00
|
|
|
architect.vhost.${domain} = {
|
|
|
|
dnsInterfaces = [ "tailscale" ];
|
|
|
|
|
|
|
|
locations."/" = {
|
|
|
|
host = "172.17.0.1";
|
|
|
|
port = frontendPort;
|
|
|
|
allowLan = true;
|
|
|
|
allow = [ config.architect.networks."tailscale".net ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.oci-containers = {
|
|
|
|
containers = {
|
|
|
|
big-agi = {
|
2024-01-09 13:59:25 +00:00
|
|
|
image = "ghcr.io/enricoros/big-agi:latest";
|
2023-11-16 12:25:58 +00:00
|
|
|
autoStart = true;
|
|
|
|
|
|
|
|
ports = [
|
|
|
|
"172.17.0.1:${toString frontendPort}:${toString backendPort}"
|
|
|
|
];
|
|
|
|
environmentFiles = [
|
|
|
|
"/var/lib/llm/big-agi.env"
|
|
|
|
];
|
|
|
|
extraOptions = [
|
|
|
|
"--pull=always"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|