43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: 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:v1.78.5-stable";
|
|
image = "ghcr.io/berriai/litellm:v1.80.0-stable";
|
|
ports = ["127.0.0.1:${toString servicePort}:4000"];
|
|
environmentFiles = [config.age.secrets.litellm-env.path];
|
|
environment = {
|
|
ANONYMIZED_TELEMETRY = "False";
|
|
DO_NOT_TRACK = "True";
|
|
SCARF_NO_ANALYTICS = "True";
|
|
STORE_MODEL_IN_DB = "True";
|
|
};
|
|
volumes = [ "/var/lib/litellm/config.yaml:/app/config.yaml" ];
|
|
extraOptions = ["--add-host=postgres:10.89.0.1" "--ip=10.89.0.30" "--network=web"];
|
|
};
|
|
|
|
# Traefik configuration
|
|
services.traefik.dynamicConfigOptions.http = {
|
|
services.${serviceName}.loadBalancer.servers = [
|
|
{
|
|
url = "http://localhost:${toString servicePort}/";
|
|
}
|
|
];
|
|
|
|
routers.${serviceName} = {
|
|
rule = "Host(`llm.az-gruppe.com`)";
|
|
tls = {
|
|
certResolver = "ionos";
|
|
};
|
|
service = serviceName;
|
|
entrypoints = "websecure";
|
|
};
|
|
};
|
|
}
|