added cache to llama swap

This commit is contained in:
Your Name
2026-03-02 23:24:21 +01:00
parent a6e5b1e0eb
commit 30a4f1e83f
+15
View File
@@ -9,6 +9,7 @@
services.llama-swap = {
enable = true;
package = pkgs.unstable.llama-swap;
port = 8085;
openFirewall = true;
@@ -71,4 +72,18 @@
};
};
# llama.cpp tries to create its cache under $HOME/.cache; when launched as a
# system service HOME may default to "/" ("//.cache/..."), which is often
# read-only. Give it a writable cache/state location.
systemd.services.llama-swap.serviceConfig = {
StateDirectory = "llama-swap";
CacheDirectory = "llama-swap";
Environment = [
"HOME=/var/lib/llama-swap"
"XDG_CACHE_HOME=/var/cache/llama-swap"
"MESA_SHADER_CACHE_DIR=/var/cache/llama-swap/mesa"
"MESA_SHADER_CACHE_MAX_SIZE=1G"
];
};
}