2024-04-23 21:24:05 -04:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: {
|
2024-06-26 22:13:02 -04:00
|
|
|
config = lib.mkIf config.ar.services.ollama.enable {
|
2024-04-23 21:24:05 -04:00
|
|
|
services.ollama = {
|
|
|
|
enable = true;
|
|
|
|
acceleration =
|
2024-06-26 22:13:02 -04:00
|
|
|
if config.ar.services.ollama.gpu == "amd"
|
2024-04-23 21:24:05 -04:00
|
|
|
then "rocm"
|
2024-06-26 22:13:02 -04:00
|
|
|
else if config.ar.services.ollama.gpu == "nvidia"
|
2024-04-23 21:24:05 -04:00
|
|
|
then "cuda"
|
|
|
|
else null;
|
2024-06-26 22:13:02 -04:00
|
|
|
listenAddress = config.ar.services.ollama.listenAddress;
|
2024-04-23 21:24:05 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|