Files

72 lines
1.5 KiB
Nix
Raw Permalink Normal View History

2026-03-19 23:17:17 -04:00
{
pkgs,
...
}:
2026-03-21 23:40:19 -04:00
let
vars = import ./vars.nix;
in
2026-03-19 23:17:17 -04:00
{
services = {
ollama = {
enable = true;
package = pkgs.ollama;
syncModels = true;
loadModels = [
"gemma3"
"deepseek-r1:latest"
"deepseek-r1:1.5b"
"qwen3"
#"qwen3-coder-next"
"qwen3-coder"
"lennyerik/zeta"
"llama3.1:8b"
"qwen2.5-coder:1.5b-base"
"nomic-embed-text:latest"
];
2026-03-21 23:40:19 -04:00
models = vars.primary_ollama;
2026-03-19 23:17:17 -04:00
environmentVariables = {
FLASH_ATTENTION = "1";
OLLAMA_KV_CACHE_TYPE = "q8_0";
# Ollama memory configuration
OLLAMA_MAX_LOADED_MODELS = "2";
OLLAMA_MAX_QUEUE = "4";
OLLAMA_NUM_PARALLEL = "2";
# ROCm memory optimization
#HIP_VISIBLE_DEVICES = "0";
#ROCR_VISIBLE_DEVICES = "0";
# context length for agents
OLLAMA_CONTEXT_LENGTH = "64000";
};
2026-03-21 23:40:19 -04:00
openFirewall = true;
2026-03-19 23:17:17 -04:00
};
open-webui = {
enable = true;
port = 21212;
2026-03-21 23:40:19 -04:00
openFirewall = true;
2026-03-19 23:17:17 -04:00
};
};
users.users.ollama = {
extraGroups = [
"render"
"video"
];
group = "ollama";
isSystemUser = true;
};
users.groups.ollama = { };
2026-03-21 23:40:19 -04:00
systemd.services = {
ollama.serviceConfig = {
Nice = 19;
IOSchedulingPriority = 7;
};
ollama-model-loader.serviceConfig = {
Nice = 19;
CPUWeight = 50;
IOSchedulingClass = "idle";
IOSchedulingPriority = 7;
};
};
2026-03-19 23:17:17 -04:00
}