Repository navigation
Description
Problem or Motivation
k8s/llm/gateway/deployment.yaml pins ghcr.io/berriai/litellm v1.103.x (v1.103.10 live; the baseline #5065 takes the v1.103.11 patch). The newest is v1.109.1 (digest sha256:11175975a3093e05e92faee2fe2fe3412a3ae2fcaa849eb0fe25d5f0d8bcb2e9), 6 minor lines and 35 releases later. #4406 plans the upgrade; this item is the move itself. Renovate (#4893) will offer it, and it needs work:
- Prisma schema migrations run on the gateway database at start and go forward only.
- 1.106.1 asks for a script for old vector stores.
- 1.109.0 needs list fallback targets (the config already uses lists), removes the disk cache, needs
optional_pre_call_checksenforce_model_rate_limitsfor a hard rpm cap, and changes Gemini parameters. - The advisory table of the gateway test (
GATEWAY_ADVISORY_FIXED_INintests/ai/benchmark/test_k8s_llm_gateway.py) stops at the 1.106 line, so the test needs the fixed-in release of each new line.
Notes read: https://github.com/BerriAI/litellm/releases v1.104.3 to v1.109.1. Research of 2026-11-12 (research-k8s, record image:ghcr.io/berriai/litellm).
Proposed Solution & Architectural Design
- Back up
llm-gateway-db. - Check
k8s/llm/gateway/config.yamlagainst the 1.106.1 and 1.109.0 action items. - Extend
GATEWAY_ADVISORY_FIXED_IN; set the image with its digest. - After the sync, run the gateway smoke calls (test(k8s): run gateway smoke calls after LiteLLM upgrade #4885).
Done when the gateway runs v1.109.x and the smoke calls of each model group pass.
Target Subsystem
AI & Agentic Review Pipeline
Existing Tool Considered
The upstream image and its release notes. No new code.
Source: #4893
Alternatives check of 2026-11-22: in-use.
The repository already uses this tool.
Tool: renovatebot/renovate (https://github.com/renovatebot/renovate), AGPL-3.0, last activity 2026-11-21, maintained.
Reason: Searches found only Renovate for the image bump and nothing for the config or schema work. It proposes the v1.109.1 tag and digest but leaves the config items, advisory table and backup to the change.
Covers:
- Proposes the new LiteLLM image tag in the Deployment
- Supports digest pinning in its image rule
- Opens the bump pull request that the smoke calls follow
Lacks:
- No rewrite of config.yaml for the 1.106.1 and 1.109.0 items
- No fixed-in entries for the 1.109 advisory line
- No migration resolver setting, backup step or smoke calls
Proposed design
Problem statement
The gateway Deployment pins ghcr.io/berriai/litellm v1.103.11, and the newest release is v1.109.1, 6 minor lines and 35 releases later. It applies forward-only Prisma migrations and the 1.106.1 and 1.109.0 action items: the removed disk cache, optional_pre_call_checks enforce_model_rate_limits, changed Gemini parameters and list fallback targets. The advisory table of the gateway test stops at line 1.106. The change sets the image, adapts the config, extends the table and enables the v2 migration resolver. A completed backup and the smoke calls of each hosted group prove the move.
Acceptance criteria
Requirement: gateway-image-is-v1-109-1
The gateway Deployment SHALL name the ghcr.io/berriai/litellm image at tag v1.109.1.
Scenario: the k8s row and the rollout show the new image
- WHEN
uv run devops ci --check --only k8sruns on the change and the Deployment rolls out - THEN the k8s row passes and
kubectl -n llm get pod -l app.kubernetes.io/name=llm-gateway -o jsonpath='{.items[0].spec.containers[0].image}'printsghcr.io/berriai/litellm:v1.109.1.
Requirement: gateway-advisory-table-names-line-1-109
The gateway advisory table SHALL name a fixed-in release for line (1, 109) that is at or below the pinned version.
Scenario: the advisory test on the new line
- WHEN
uv run pytest tests/ai/benchmark/test_k8s_llm_gateway.py::TestK8sLLMGatewayManifests::test_gateway_image_is_not_below_the_release_that_fixes_the_critical_advisoriesruns - THEN the test passes on the pinned
v1.109.1image.
Requirement: gateway-config-holds-the-1-109-form
The gateway config SHALL hold the 1.109.0 form of each setting that the 1.106.1 and 1.109.0 notes change.
Scenario: the gateway serves each hosted group after the move
- WHEN the new pod runs on v1.109.1 and the documented smoke call of each hosted group in
openspec/specs/ai-gateway-routing/spec.mdruns - THEN each hosted group answers with a reply.
Requirement: gateway-uses-the-v2-migration-resolver
The litellm container SHALL set USE_V2_MIGRATION_RESOLVER to "true".
Scenario: the start log names the v2 resolver
- WHEN the new pod starts
- THEN its log holds
Using v2 migration resolverand noUsing default (v1) migration resolverline.
Requirement: gateway-database-is-backed-up-before-the-migration
The rollout SHALL start only after a backup of the llm-gateway-db database completes.
Scenario: a completed backup precedes the new pod
- WHEN the new pod starts
- THEN
kubectl -n llm get backupshows a backup of thellm-gateway-dbCluster in phasecompletedwith a completion time before the start time of the new pod.
Existing Tool Considered
No tool covers the need. The alternatives check of 2026-11-15 returned the verdict none, and its searches found no tool for LiteLLM schema migrations or for an image move with its config. The release notes show the steps are LiteLLM's own action-required items. Renovate (#4893) offers only the image bump. The change builds no code: it edits two manifests and one test table, so its build cost is none.
Key questions
- Which Prisma migration resolver does the gateway use on the move to v1.109.1?: Set
USE_V2_MIGRATION_RESOLVERto"true"on thelitellmcontainer, with a comment beside it. The v2 resolver holds a Postgres advisory lock during the migration. The v1 default runs a diff-and-force step for pending migrations while the old pod still writes. (best practice) [sources: k8s/llm/gateway/deployment.yaml, k8s/llm/gateway-db.yaml]- Chosen: v2 migration resolver. It holds a Postgres advisory lock, and the image installs the
extra_proxyextra, so psycopg is present. - Rejected: v1 migration resolver (default). It has no lock and runs a diff-and-force step for pending migrations during the two-version window of a rolling update.
- Chosen: v2 migration resolver. It holds a Postgres advisory lock, and the image installs the
- Does the image reference pin the digest, or only the tag?: Pin only the tag
v1.109.1and record the digestsha256:11175975a3093e05e92faee2fe2fe3412a3ae2fcaa849eb0fe25d5f0d8bcb2e9in a comment. The gateway test derives the version from the tag withparse_repository_tagand asserts that the repository is exactlyghcr.io/berriai/litellm. (best practice) [sources: tests/ai/benchmark/test_k8s_llm_gateway.py, k8s/llm/gateway/deployment.yaml]- Chosen: tag only. The test parses
v1.109.1from the reference, and its repository assertion holds. - Rejected: tag and digest.
parse_repository_tagsplits at@first, so it returns the digest as the tag and the repository assertion fails. The test would need a change to strip the digest.
- Chosen: tag only. The test parses
- Which fixed-in release does line (1, 109) need in
GATEWAY_ADVISORY_FIXED_IN?: Line (1, 109) needs1.109.0, the first release of the line. The two advisory fixes shipped by 1.103.10, so every 1.109 release holds them. The value stays at or below the pinned v1.109.1. [sources: tests/ai/benchmark/test_k8s_llm_gateway.py:65] - Which LiteLLM 1.106.1 and 1.109.0 action items change
k8s/llm/gateway/config.yaml?: The change reads the file and applies each item that its settings use. The 1.109.0 items are the removed disk cache,optional_pre_call_checksenforce_model_rate_limitsfor a hard rpm cap, changed Gemini parameters and list fallback targets that the config already uses. The 1.106.1 item is a script for old vector stores. [sources: k8s/llm/gateway/config.yaml] - Does the Deployment change its update strategy for the move?: Keep the default RollingUpdate and add no strategy field. The v2 migration resolver makes the two-version window safe, and
Recreatewould stop every model call until the new pod starts. (best practice) [sources: k8s/llm/gateway/deployment.yaml]- Chosen: keep the default RollingUpdate. It starts the new pod first and keeps the old pod for its open calls in the 600 s grace period. The v2 lock serializes the migrations.
- Rejected:
Recreate. Every model call fails until the new pod is ready, and the 600 s termination grace exists to let open calls finish.
- How does the change back up
llm-gateway-dbbefore the migration?: Take a CloudNativePG on-demand backup of thellm-gateway-dbCluster when its manifest configures a backup store. Usepg_dumpof the database when it configures none. (best practice) [sources: k8s/llm/gateway-db.yaml, openspec/specs/llm-gateway-database/spec.md]- Chosen: CloudNativePG on-demand backup. The operator takes a consistent backup of the Cluster, and the manifest is read for its backup store.
- Rejected:
pg_dump. It is the fallback when the Cluster configures no backup store, because the dump needs a place to write.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both concern the LiteLLM gateway upgrade beyond 1.103; #4406 plans and researches the upgrade while this candidate executes the image move and config changes.build(deps): take every safe version update before Renovate (#5102)
dan-petty commentedon Nov 13, 2026
New evidence (2026-11-13, read-only investigation of the LiteLLM gateway):
Using default (v1) migration resolver. If your deployment has seen schema thrashing during rolling deploys, try --use_v2_migration_resolver(11 starts and 4 crashes).proxy_cli.py:962-972: flag, env varUSE_V2_MIGRATION_RESOLVER, default False.No pending migrations), but this upgrade moves 6 minor lines and applies many migrations while the old pod runs. v1 runs a diff-and-force step for pending migrations (litellm_proxy_extrasutils.py:1373-1377). v2 holds a Postgres advisory lock (migration_lock.py). The image installs theextra_proxyextra (Dockerfile:83,:105), so v2 has psycopg.USE_V2_MIGRATION_RESOLVER="true"to thelitellmcontainer ink8s/llm/gateway/deployment.yaml. ExpectUsing v2 migration resolverat the next start.P1001at start exits with code 2 and the textDatabase migration failed and cannot be auto-recovered. Manual intervention required.For aP1001this text is false, because the database was only unreachable.devops-cli-service commentedon Nov 15, 2026
Alternatives check: none
Reason: The searches for LiteLLM schema-migration tooling and for a tool that performs an image move with its config work returned nothing relevant, and the upstream release notes show the upgrade steps are LiteLLM's own action-required items, not a separate tool. This issue is an in-repo operational change (pin the image and digest, adapt
config.yaml, extendGATEWAY_ADVISORY_FIXED_IN, back up the DB, run the smoke calls), and it explicitly states that no new code or tool is wanted, so no tool covers it.Tool: none found
Lacks:
k8s/llm/gateway/config.yamlagainst the 1.106.1 and 1.109.0 action itemsGATEWAY_ADVISORY_FIXED_INwith the fixed-in release of each new linellm-gateway-dband running the per-model-group smoke calls (test(k8s): run gateway smoke calls after LiteLLM upgrade #4885)k8s/llm/gateway/deployment.yaml(Renovate only offers the bump; the rest of the work stays manual)Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at b8c7632 (see proposed design in issue body).
devops-cli-service commentedon Nov 22, 2026
The result in the alternatives block of the issue body changed. Before this check:
none, no tool. A person decides what the new result means for the item.Searches (4)
Tools considered:
Searches run:
Sources:
dan-petty commentedon Nov 26, 2026
Closed: the gateway already runs a newer release.
k8s/llm/gateway/is in dan-petty/homelab, which pins LiteLLM 1.111.0, and the live Deployment runs it. The advisory test in this repository is gone. The design also asked forUSE_V2_MIGRATION_RESOLVER, which the homelab Deployment does not set. File a dan-petty/homelab item if you still want it.