about summary refs log tree commit diff
path: root/pkgs/by-name/lo/local-ai/module.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/lo/local-ai/module.nix')
-rw-r--r--pkgs/by-name/lo/local-ai/module.nix26
1 files changed, 17 insertions, 9 deletions
diff --git a/pkgs/by-name/lo/local-ai/module.nix b/pkgs/by-name/lo/local-ai/module.nix
index d7b70048121f3..70f486b43b1a7 100644
--- a/pkgs/by-name/lo/local-ai/module.nix
+++ b/pkgs/by-name/lo/local-ai/module.nix
@@ -28,25 +28,33 @@ in
       type = types.either types.package types.str;
       default = "models";
     };
+
+    parallelRequests = mkOption {
+      type = types.int;
+      default = 1;
+    };
+
+    logLevel = mkOption {
+      type = types.enum [ "error" "warn" "info" "debug" "trace" ];
+      default = "warn";
+    };
   };
 
   config = lib.mkIf cfg.enable {
     systemd.services.local-ai = {
       wantedBy = [ "multi-user.target" ];
+      environment.LLAMACPP_PARALLEL = toString cfg.parallelRequests;
       serviceConfig = {
         DynamicUser = true;
         ExecStart = lib.escapeShellArgs ([
           "${cfg.package}/bin/local-ai"
-          "--debug"
-          "--address"
-          ":${toString cfg.port}"
-          "--threads"
-          (toString cfg.threads)
-          "--localai-config-dir"
-          "."
-          "--models-path"
-          (toString cfg.models)
+          "--address=:${toString cfg.port}"
+          "--threads=${toString cfg.threads}"
+          "--localai-config-dir=."
+          "--models-path=${cfg.models}"
+          "--log-level=${cfg.logLevel}"
         ]
+        ++ lib.optional (cfg.parallelRequests > 1) "--parallel-requests"
         ++ cfg.extraArgs);
         RuntimeDirectory = "local-ai";
         WorkingDirectory = "%t/local-ai";