Skip to content

Litellm backend cache config#29605

Draft
tin-berri wants to merge 9 commits into
litellm_internal_stagingfrom
litellm_backend_cache_config
Draft

Litellm backend cache config#29605
tin-berri wants to merge 9 commits into
litellm_internal_stagingfrom
litellm_backend_cache_config

Conversation

@tin-berri
Copy link
Copy Markdown

@tin-berri tin-berri commented Jun 3, 2026

Relevant issues

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Screenshots / Proof of Fix

Type

🐛 Bug Fix

Changes

shin-berri and others added 8 commits May 13, 2026 22:37
[Infra] Promote internal staging to main
[Infra] Promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 3 committers have signed the CLA.

✅ yuneng-berri
❌ Tin Chi Lo
❌ shin-berri


Tin Chi Lo seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tin-berri
Copy link
Copy Markdown
Author

@greptileai

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 3, 2026

Greptile Summary

This PR adds ConfigMap-based proxy config support to the backend Helm component, mirroring the equivalent feature that already exists for the gateway.

  • A new helm/litellm/templates/backend/configmap.yaml is added (identical in structure to the gateway configmap) and a backend.config stanza (create: false, proxy_config: {}) is added to values.yaml.
  • deployment.yaml is updated to inject the CONFIG_FILE_PATH env var, mount the ConfigMap into the container, and annotate pods with a sha256 checksum of the configmap so that config changes trigger a rolling restart.

Confidence Score: 4/5

Safe to merge; the change is additive and gated behind config.create: false by default, so existing deployments are unaffected.

The change faithfully ports the gateway config pattern to the backend. The one nuance is that the annotations block is now always emitted in the pod template even when both config.create is false (default) and podAnnotations is empty, producing an empty annotations: key. The gateway avoids this because its config.create defaults to true. This won't break deployments but will produce diff noise for GitOps users who upgrade from the previous chart version.

helm/litellm/templates/backend/deployment.yaml — the annotations block restructuring

Important Files Changed

Filename Overview
helm/litellm/templates/backend/configmap.yaml New ConfigMap template for backend proxy config; mirrors the existing gateway configmap exactly and is correctly gated on backend.config.create
helm/litellm/templates/backend/deployment.yaml Adds checksum annotation, CONFIG_FILE_PATH env var, volumeMount, and volume for the backend config; restructures annotations block so it is always emitted even when empty (default state)
helm/litellm/values.yaml Adds backend.config.create (false by default) and backend.config.proxy_config ({}) to mirror the existing gateway.config shape

Reviews (1): Last reviewed commit: "change deployment configs to include a l..." | Re-trigger Greptile

Comment on lines 15 to +21
annotations:
{{- if .Values.backend.config.create }}
checksum/config: {{ include (print $.Template.BasePath "/backend/configmap.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.backend.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 When backend.config.create is false (the default) and backend.podAnnotations is empty (also the default), the rendered pod template will contain a bare annotations: key with no children — equivalent to annotations: null. While Kubernetes accepts this, it produces unnecessary noise in GitOps diff tools (ArgoCD, Flux) for users who upgrade from the previous chart version, and it differs from the original conditional behavior. The gateway avoids this because its config.create defaults to true, ensuring the checksum annotation is always present. Wrapping the whole block in a top-level conditional keeps the annotations section absent when nothing is to be emitted.

Suggested change
annotations:
{{- if .Values.backend.config.create }}
checksum/config: {{ include (print $.Template.BasePath "/backend/configmap.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.backend.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if or .Values.backend.config.create .Values.backend.podAnnotations }}
annotations:
{{- if .Values.backend.config.create }}
checksum/config: {{ include (print $.Template.BasePath "/backend/configmap.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.backend.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@tin-berri tin-berri self-assigned this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants