From aee62d0155e272d69a8d137ee58d858d8bd3a1d7 Mon Sep 17 00:00:00 2001 From: Myned <dev@bjork.tech> Date: Wed, 26 Mar 2025 20:55:22 -0500 Subject: [PATCH] ollama: modify config --- options/custom/services/ollama.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/options/custom/services/ollama.nix b/options/custom/services/ollama.nix index b84716e..b3bcef0 100644 --- a/options/custom/services/ollama.nix +++ b/options/custom/services/ollama.nix @@ -15,7 +15,16 @@ in { # https://wiki.nixos.org/wiki/Ollama services.ollama = { enable = true; - openFirewall = true; + + # Bind to all interfaces, but only Tailscale can access the closed port + # https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-expose-ollama-on-my-network + host = "0.0.0.0"; + #// openFirewall = true; # 11434/tcp + + environmentVariables = { + # https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size + OLLAMA_CONTEXT_LENGTH = "8192"; + }; # https://wiki.nixos.org/wiki/Ollama#AMD_GPU_with_open_source_driver # https://github.com/ollama/ollama/blob/main/docs/gpu.md#overrides