fix llm stuff

This commit is contained in:
atagen 2024-09-11 10:15:54 +10:00
parent ad421cea84
commit 5786863608
12 changed files with 131 additions and 95 deletions

View file

@ -1,19 +1,24 @@
{
lib,
pkgs,
config,
...
}: {
services.podman = {
containers.ollama = {
containers.ollama = let
username = config.mainUser;
in {
image = "ollama/ollama:latest";
devices = ["nvidia.com/gpu=all"];
autostart = false;
networks = ["ollama"];
volumes = [
"/home/${username}/.local/share/ollama:/models"
];
environment.OLLAMA_MODELS = "/models";
extraOptions = [
"--health-cmd"
(lib.escapeShellArg "bash -c 'cat < /dev/null > /dev/tcp/localhost/11434'")
];
# TODO make a volume lol
};
networks.ollama = {
@ -21,10 +26,4 @@
Gateway = "192.168.10.1";
};
};
# containers.ollama = {
# image = "ollama/ollama:latest";
# # TODO: volume for models!
# extraOptions = ["--network=host" "--device=nvidia.com/gpu=all"];
# };
}