feat: Added resolved to mirai
This commit is contained in:
@@ -46,7 +46,6 @@
|
|||||||
type = "openai-compatible";
|
type = "openai-compatible";
|
||||||
name = "ryu";
|
name = "ryu";
|
||||||
api_base = "https://ollama.ryu.darksailor.dev/v1";
|
api_base = "https://ollama.ryu.darksailor.dev/v1";
|
||||||
api_key_cmd = "cat ${config.sops.secrets."llama/api_key".path}";
|
|
||||||
models = [
|
models = [
|
||||||
{
|
{
|
||||||
name = "RobinBially/nomic-embed-text-8k";
|
name = "RobinBially/nomic-embed-text-8k";
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
./searxng.nix
|
./searxng.nix
|
||||||
./immich.nix
|
./immich.nix
|
||||||
./lldap.nix
|
./lldap.nix
|
||||||
|
./resolved.nix
|
||||||
|
|
||||||
# ./home-assistant.nix
|
# ./home-assistant.nix
|
||||||
# ./jellyfin.nix
|
# ./jellyfin.nix
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
ENABLE_LOGIN_FORM = "False";
|
ENABLE_LOGIN_FORM = "False";
|
||||||
WEBUI_URL = "https://llama.darksailor.dev";
|
WEBUI_URL = "https://llama.darksailor.dev";
|
||||||
OPENAI_BASE_URL = "https://ollama.darksailor.dev/v1";
|
OPENAI_BASE_URL = "https://ollama.darksailor.dev/v1";
|
||||||
|
OLLAMA_API_BASE_URL = "https://ollama.ryu.darksailor.dev";
|
||||||
};
|
};
|
||||||
environmentFile = "${config.sops.templates."LLAMA_API_KEY.env".path}";
|
environmentFile = "${config.sops.templates."LLAMA_API_KEY.env".path}";
|
||||||
};
|
};
|
||||||
|
|||||||
9
nixos/mirai/services/resolved.nix
Normal file
9
nixos/mirai/services/resolved.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{...}: {
|
||||||
|
services.resolved = {
|
||||||
|
enable = true;
|
||||||
|
dnssec = "true";
|
||||||
|
dnsovertls = "true";
|
||||||
|
domains = ["lemur-newton.ts.net"];
|
||||||
|
fallbackDns = ["1.1.1.1"];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -13,5 +13,6 @@
|
|||||||
./resolved.nix
|
./resolved.nix
|
||||||
./minecraft.nix
|
./minecraft.nix
|
||||||
./fwupd.nix
|
./fwupd.nix
|
||||||
|
./caddy.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
environmentVariables = {
|
environmentVariables = {
|
||||||
OLLAMA_LLM_LIBRARY = "cuda";
|
OLLAMA_LLM_LIBRARY = "cuda";
|
||||||
LD_LIBRARY_PATH = "run/opengl-driver/lib";
|
LD_LIBRARY_PATH = "run/opengl-driver/lib";
|
||||||
|
OLLAMA_ORIGINS = "*";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
open-webui = {
|
open-webui = {
|
||||||
@@ -35,20 +36,7 @@
|
|||||||
'';
|
'';
|
||||||
virtualHosts."ollama.ryu.darksailor.dev".extraConfig = ''
|
virtualHosts."ollama.ryu.darksailor.dev".extraConfig = ''
|
||||||
import hetzner
|
import hetzner
|
||||||
@apikey {
|
reverse_proxy localhost:${builtins.toString config.services.ollama.port}
|
||||||
header Authorization "Bearer {env.LLAMA_API_KEY}"
|
|
||||||
}
|
|
||||||
|
|
||||||
handle @apikey {
|
|
||||||
header {
|
|
||||||
# Set response headers or proxy to a different service if API key is valid
|
|
||||||
Access-Control-Allow-Origin *
|
|
||||||
-Authorization "Bearer {env.LLAMA_API_KEY}" # Remove the header after validation
|
|
||||||
}
|
|
||||||
reverse_proxy localhost:${builtins.toString config.services.ollama.port}
|
|
||||||
}
|
|
||||||
|
|
||||||
respond "Unauthorized" 403
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user