diff --git a/nixos/optional-apps/llama-sakura-llm.nix b/nixos/optional-apps/llama-sakura-llm.nix index b15ae794..1adecd7b 100644 --- a/nixos/optional-apps/llama-sakura-llm.nix +++ b/nixos/optional-apps/llama-sakura-llm.nix @@ -76,10 +76,13 @@ in path = with pkgs; [ curl ]; postStart = '' - while ! curl -f http://${cfg.host}:${builtins.toString cfg.port}/health; do - echo "Still waiting for llama-cpp to start" - sleep 1 - done + curl \ + --fail \ + --retry 30 \ + --retry-delay 5 \ + --retry-max-time 120 \ + --retry-all-errors \ + http://${cfg.host}:${builtins.toString cfg.port}/health ''; serviceConfig = LT.serviceHarden // { diff --git a/nixos/optional-apps/uni-api.nix b/nixos/optional-apps/uni-api.nix index 3de389e0..74dd3c17 100644 --- a/nixos/optional-apps/uni-api.nix +++ b/nixos/optional-apps/uni-api.nix @@ -162,6 +162,17 @@ in exec ${pkgs.nur-xddxdd.uni-api}/bin/uni-api ''; + postStart = '' + ${pkgs.curl}/bin/curl \ + --fail \ + --retry 10 \ + --retry-delay 5 \ + --retry-max-time 60 \ + --retry-all-errors \ + -H "Authorization: Bearer $(cat ${config.age.secrets.uni-api-admin-api-key.path})" \ + http://uni-api.localhost/v1/models + ''; + serviceConfig = LT.serviceHarden // { Restart = "always"; RestartSec = "3";