ollama
Options
Section titled “Options”services.ollama.enable
Section titled “services.ollama.enable”Whether to enable Ollama server for local large language models.
Type: boolean
Default:
falseExample:
trueDeclared by:
services.ollama.package
Section titled “services.ollama.package”Which package of Ollama to use.
Hardware acceleration depends on the package: use pkgs.ollama-cuda,
pkgs.ollama-rocm or pkgs.ollama-vulkan for GPU support on Linux.
On macOS, pkgs.ollama uses Metal.
Type: package
Default:
pkgs.ollamaExample:
pkgs.ollama-cudaDeclared by:
services.ollama.environmentVariables
Section titled “services.ollama.environmentVariables”Additional environment variables for the Ollama server process.
See ollama serve --help for available options.
Type: attribute set of string
Default:
{ }Example:
{ OLLAMA_CONTEXT_LENGTH = "8192"; OLLAMA_KEEP_ALIVE = "10m";}Declared by:
services.ollama.host
Section titled “services.ollama.host”The host address the Ollama HTTP server listens on. Wrap IPv6 addresses in brackets.
Type: string
Default:
"127.0.0.1"Example:
"[::]"Declared by:
services.ollama.loadModels
Section titled “services.ollama.loadModels”Models to download with ollama pull once the server is ready.
Models that are already present are not downloaded again.
Search for models at https://ollama.com/library.
Type: list of string
Default:
[ ]Example:
[ "gemma3" "qwen3:0.6b"]Declared by:
services.ollama.modelsDir
Section titled “services.ollama.modelsDir”The directory Ollama reads models from and downloads new models to.
Point this at a shared location (such as ~/.ollama/models, as an absolute path)
to reuse models across projects instead of downloading them per project.
Type: string
Default:
"${config.devenv.state}/ollama/models"Example:
"/home/user/.ollama/models"Declared by:
services.ollama.port
Section titled “services.ollama.port”The base port the Ollama HTTP server listens on.
The actual port is allocated by devenv and may differ;
OLLAMA_HOST and OLLAMA_BASE_URL point to it.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
11434Declared by:

