Skip to content

Commit

Permalink
Add log file option to ollama service
Browse files Browse the repository at this point in the history
  • Loading branch information
Velnbur committed Jun 17, 2024
1 parent 45a7346 commit 585e301
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/services/ollama.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ in {
Since `ollama run` is mostly a shell around the ollama server, this is usually sufficient.
'';
};

logFile = mkOption {
type = types.nullOr types.path;
default = null;
example = "/var/tmp/ollama.log";
description = ''
The file to write the ollama server logs to.
If not set, logs are written to stdout.
'';
};
};
};

Expand All @@ -87,6 +97,9 @@ in {
RunAtLoad = true;
ProgramArguments = [ "${cfg.package}/bin/ollama" "serve" ];

StandardOutPath = cfg.logFile;
StandardErrorPath = cfg.logFile;

EnvironmentVariables = cfg.environmentVariables // {
HOME = cfg.home;
OLLAMA_MODELS = cfg.models;
Expand Down

0 comments on commit 585e301

Please sign in to comment.