litellm

by RichardoC

Helm chartv0.2.0App v1.75.5-stable

The 'litellm' chart provides a solution for deploying LiteLLM proxy with helm. It is a refined version of the original [litellm](https://github.com/BerriAI/litellm/tree/main/deploy/charts/litellm-helm) chart.

About this chart

litellm

The 'litellm' chart provides a solution for deploying LiteLLM proxy with helm.

It is a refined version of the original litellm chart.

Maintainers

NameEmailUrl
Richardo-Chttps://github.com/RichardoC

Custom callbacks / extra files in the config directory

LiteLLM resolves callback modules referenced in litellm_settings.callbacks relative to the directory containing config.yaml (i.e. /etc/litellm). To ship custom hook/handler .py files, set configDirExtraFiles (keyed by filename). The chart renders them into a ConfigMap (with a content-hashed name) and projects it into /etc/litellm alongside config.yaml, so no extra volumeMounts are needed, and any change rolls out the Deployment automatically.

You almost certainly don't want Python source inlined in your YAML. Keep each handler as a real .py file and load it at install time with Helm's --set-file, which reads the file's contents into the value:

$ helm upgrade --install litellm oci://ghcr.io/richardoc/litellm_helm-chart/litellm \
    --values values.yaml \
    --set-file 'configDirExtraFiles.my_handler\.py=./hooks/my_handler.py'

Then reference the module from your config:

proxy_config:
  litellm_settings:
    callbacks: ["my_handler.proxy_handler_instance"]

--set-file also works through orchestrators that pass Helm flags — e.g. Tilt's helm_resource via flags=['--set-file', 'configDirExtraFiles.my_handler\\.py=./hooks/my_handler.py']. (Inlining the contents directly under configDirExtraFiles in a values file is also supported, e.g. for tooling that can't pass --set-file.)

Notes:

  • Filenames must not collide with config.yaml.
  • The rendered files are folded into a checksum/config-dir-extra pod annotation (and the ConfigMap name is content-hashed), so changing them rolls out the Deployment automatically.

Values

KeyTypeDefaultDescription
affinityobject{}
autoscaling.enabledboolfalse
autoscaling.maxReplicasint10
autoscaling.minReplicasint1
autoscaling.targetCPUUtilizationPercentageint80
configDirExtraFilesobject{}Custom files to drop into the proxy config directory (/etc/litellm) alongside config.yaml — e.g. callback/hook .py modules referenced from litellm_settings.callbacks. LiteLLM resolves those modules relative to the config file's directory, so they must live next to config.yaml. Keys are filenames, values are the file contents. The chart renders these into a ConfigMap (content-hashed name) and projects it into /etc/litellm (no extra mount paths needed), and folds their contents into a checksum/config-dir-extra pod annotation, so changes roll out the Deployment automatically. Filenames must not collide with config.yaml. Rather than inlining source here, prefer keeping each handler as a real file and loading it at install time with helm --set-file 'configDirExtraFiles.my_handler\.py=./hooks/my_handler.py'.
env.LITELLM_LOGstring"ERROR"
env.LITELLM_MODEstring"PRODUCTION"
envFromSecretRefslist[]List of secrets to be used as environment variables for the proxy
extraObjectslist[]List of extra objects to be created, will be templated
fullnameOverridestring""
hooks.migration.commandstring"python litellm/proxy/prisma_migration.py\n"
hooks.migration.enabledbooltrue
hooks.migration.resourcesobject{}
image.pullPolicystring"IfNotPresent"
image.repositorystring"ghcr.io/berriai/litellm-database"
image.tagstring""
imagePullSecretslist[]
ingress.annotationsobject{}
ingress.classNamestring""
ingress.enabledboolfalse
ingress.hosts[0].hoststring"chart-example.local"
ingress.hosts[0].paths[0].pathstring"/"
ingress.hosts[0].paths[0].pathTypestring"ImplementationSpecific"
ingress.tlslist[]
livenessProbe.httpGet.pathstring"/health/liveliness"
livenessProbe.httpGet.portstring"http"
nameOverridestring"litellm"
nodeSelectorobject{}
podAnnotationsobject{}
podDisruptionBudget.createboolfalse
podDisruptionBudget.minAvailableint1
podLabelsobject{}
podSecurityContextobject{}
proxy_config.general_settings.alertinglist[]
proxy_config.general_settings.database_connection_pool_limitint10
proxy_config.general_settings.disable_error_logsboolfalse
proxy_config.general_settings.disable_spend_logsboolfalse
proxy_config.general_settings.master_keystring"os.environ/PROXY_MASTER_KEY"
proxy_config.general_settings.proxy_batch_write_atint60
proxy_config.litellm_settings.json_logsbooltrue
proxy_config.litellm_settings.request_timeoutint600
proxy_config.litellm_settings.set_verboseboolfalse
proxy_config.model_list[0].litellm_params.api_basestring"https://exampleopenaiendpoint-production.up.railway.app/"
proxy_config.model_list[0].litellm_params.api_keystring"fake-key"
proxy_config.model_list[0].litellm_params.modelstring"openai/fake"
proxy_config.model_list[0].model_namestring"fake-openai-endpoint"
readinessProbe.httpGet.pathstring"/health/readiness"
readinessProbe.httpGet.portstring"http"
replicaCountint1
resourcesobject{}
secretFromobject{}
securityContextobject{}
service.portint4000
service.typestring"ClusterIP"
serviceAccount.createboolfalse
startupProbe.failureThresholdint18
startupProbe.httpGet.pathstring"/health/readiness"
startupProbe.httpGet.portstring"http"
startupProbe.periodSecondsint10
tolerationslist[]
volumeMountslist[]
volumeslist[]

Autogenerated from chart metadata using helm-docs v1.14.2

Deploy litellm with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has litellm on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartlitellm is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply