+ portUtils +metabase
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
virtualisation.oci-containers.containers.litellm = {
|
||||
}: let
|
||||
serviceName = "litellm";
|
||||
portUtils = import ../../../../lib/port-utils.nix {inherit lib;};
|
||||
servicePort = portUtils.getPort serviceName "AZ-CLD-1";
|
||||
in {
|
||||
virtualisation.oci-containers.containers.${serviceName} = {
|
||||
image = "ghcr.io/berriai/litellm:main-stable";
|
||||
ports = ["127.0.0.1:4000:4000"];
|
||||
ports = ["127.0.0.1:${toString servicePort}:4000"];
|
||||
environmentFiles = [config.age.secrets.litellm-env.path];
|
||||
environment = {
|
||||
ANONYMIZED_TELEMETRY = "False";
|
||||
@@ -18,11 +22,18 @@
|
||||
|
||||
# Traefik configuration
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.litellm.loadBalancer.servers = [{url = "http://127.0.0.1:4000/";}];
|
||||
routers.litellm = {
|
||||
services.${serviceName}.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:${toString servicePort}/";
|
||||
}
|
||||
];
|
||||
|
||||
routers.${serviceName} = {
|
||||
rule = "Host(`llm.az-gruppe.com`)";
|
||||
tls.certResolver = "ionos";
|
||||
service = "litellm";
|
||||
tls = {
|
||||
certResolver = "ionos";
|
||||
};
|
||||
service = serviceName;
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user