From c43d45c455d9482125fbe5d31eabf3f16a2f6f0e Mon Sep 17 00:00:00 2001 From: Inferencebot Date: Mon, 9 Nov 2026 04:22:30 +0000 Subject: [PATCH] upgrade: pin LiteLLM v1.108.3 (re-validated on real 1.108.3 sources) - Dockerfile FROM v1.103.2 -> v1.108.3; manifest upstreamVersion follows. - Carries main's newer build patches (patch_transcription_response_format.py, patch_audio_default_mp3.py, audio_keepalive.py) that the v1.108.0 branch predates, plus the 1.108.x CORS anchor fallback from that branch. - Re-validated all ten patch scripts against the real v1.108.3 wheel sources: every anchor matched and the patched files compile. patch_expose_cost_headers applies via its 1.108.x anchor; patch_audio_request_cost needs LITELLM_COST_CALCULATOR when run outside a full install (noted in README). - Stop tracking __pycache__. --- .gitignore | 2 + CloudronManifest.json | 2 +- Dockerfile | 2 +- README.md | 15 ++++++- .../patch_expose_cost_headers.cpython-314.pyc | Bin 4172 -> 0 bytes patch_expose_cost_headers.py | 41 ++++++++++++++---- 6 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 .gitignore delete mode 100644 __pycache__/patch_expose_cost_headers.cpython-314.pyc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a60b85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__/ +*.pyc diff --git a/CloudronManifest.json b/CloudronManifest.json index c72a0fa..d078e7b 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -5,7 +5,7 @@ "description": "LiteLLM AI Gateway \u2014 OpenAI-compatible proxy with per-user API keys, usage tracking, rate limiting, and model routing. Packaged for Cloudron with SSO/OIDC and PostgreSQL.", "tagline": "AI gateway for cooperative inference", "version": "1.0.0", - "upstreamVersion": "1.103.2", + "upstreamVersion": "1.108.3", "healthCheckPath": "/health/readiness", "httpPort": 4000, "memoryLimit": 2147483648, diff --git a/Dockerfile b/Dockerfile index 3c0f448..1dfaff4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/berriai/litellm:v1.103.2 +FROM ghcr.io/berriai/litellm:v1.108.3 # v1.84.0 is the fix line for CVE-2026-35029 (auth bypass on # /config/update, fixed 1.83.0) and CVE-2026-59822 (MCP session auth diff --git a/README.md b/README.md index 7a701f1..c442f55 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A Cloudron app package for [LiteLLM](https://litellm.ai/), the open-source AI ga LiteLLM is the single gateway between members and the inference backends. It handles per-member API keys, usage metering, rate limiting (via budget caps), and model routing — all behind one OpenAI-compatible endpoint. -**Current base image:** LiteLLM **v1.103.2**, pinned to the exact tag (fix line for CVE-2026-35029 / CVE-2026-59822, CISA KEV-listed; also carries the streaming-usage fix for prompt_tokens_details). See [Updating LiteLLM](#updating-litellm). +**Current base image:** LiteLLM **v1.108.3**, pinned to the exact tag (upgraded from v1.103.2 in the 2026-11-08/09 maintenance window; minimum supported line remains v1.84.0, the fix line for CVE-2026-35029 / CVE-2026-59822, CISA KEV-listed). See [Updating LiteLLM](#updating-litellm). ## What this provides @@ -149,6 +149,19 @@ expect a 15–20 min maintenance window and **never panic-restart mid-migration* 1. **Pick a target version** from the [LiteLLM changelog](https://github.com/BerriAI/litellm/releases). Stay at or above v1.84.0 (the fix line for CVE-2026-35029 and CVE-2026-59822, the latter on CISA's KEV list). + **Re-validate the build patches against the target's real sources first** — the + scripts fail soft (a moved anchor prints a WARN and exits 0), so a silently + skipped patch ships. Ten patches are in the Dockerfile today; each must print + its `applied` line in the build log. The cheapest rehearsal is to unpack the + target wheel into a scratch tree and run the scripts against it (2026-11-09, + v1.108.3: all ten apply — the CORS anchor needs the 1.108.x fallback already + carried by `patch_expose_cost_headers.py`). Two gotchas in that harness: + `patch_audio_request_cost.py` finds its target by `import litellm`, which fails + outside a full install — point `LITELLM_COST_CALCULATOR` at the scratch + `cost_calculator.py` instead, or it exits with "could not locate"; and running + the scripts by hand leaves files owned by your user, which is fine in scratch + and never in the image. + 2. **Bump the pin** in `Dockerfile`: ```dockerfile diff --git a/__pycache__/patch_expose_cost_headers.cpython-314.pyc b/__pycache__/patch_expose_cost_headers.cpython-314.pyc deleted file mode 100644 index 7fac41fb781c1661745199816c28cceeb2722ff5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4172 zcmb7H-ES1v6`$D|d)I?)On?}u0~eeEhMhIoPD_A<7}yA>#yAU@q%|z#nd{xbvon*q zcd>U~x{V?wQCgKsk;+3J`jCf4%^%R$R{aAO*)3!nsZlFc;?0zzs(opHcV;JRT((uN zG++0ed+z!8-E+M7pzyAOTIibXO9Zr^h3-M=x;h|Dw5BHH_$AwBkqYUJUp!sN3`&Kb zLCG25nd?0T?ZjJ>WbKipA?dm@yJN$`*6V)hdS?HB?XVA84oBBWZ}kRD%CGnyqh#9V zbb9*YAx3-}=mCAFN*O1nhg+E%77ZBT9x(%tG2IL7lI@a(z*}ZCAf{tem$RIvUCduR zn=g<;{>`iT%U8%@)6+eFlvRD-3;6K(%ULpZZ0tMw@nib<@sS)k+Y<1`WnvnRW4k57 z%aoK1PM3`uSq!|2X1E^a0@B*kG+a!O04fm!59WI=w2xIJRo9^mib4n!yNzY8QK5|3 zoY<~5X_}zw=RB7Oo}lb3{a)}49k~2*s7&LNCv1R`&(^FUSa8dE{8`qH)H zh5Y3CeBrXDEthSx3}<0ShV{3p+uHarqZPyDwy7`L4yQqul&VHx1%~ZpVY6AL`Vy^W zNiLTgA%<%a*K;ZH7Byi)Y!HNu2;_$&DrOWX6`0=rEs1MV*;n1v56&^2R0+3n2Hn7Zr6vUAdgGbT~-zSbygG)5JVwl{i z5yxJl5iO3mZ*cer!4t~aj97L+P3{FX0BzE;Y;NC%t6Zm+BU79>h#C+faD=c&_}Beg_=0NRc4eZTvVvK!q;c7PEDUD+^$e^Sb!?Pdhro>9$$oW zS>!8S_z}kk=bW5#ys8y=E)M7nOj*QU04toS0ZIT(P<7}@VlR?v0+I@V&u~H^YB>Nv zg=ZmHn4TrqCJQr>`E&)KI2QTTAQhW2xJNTR7pDdJ!%WafD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ohi{T!ALZWUh z+}##qItCh=MH@e1qMn93+N6qSQAZblG~u@PtT>IjZH3$0Q)m};CXU-PqhwWs$Uwcq zHqyn0;6H%wn;b zMjuf|wvCUt!fGto3y=k(TWG4cJe;;6@hy&=z^L#6mZ_qp3`8xB&>J7l%xU-uE$XYm zQ4mBKW)8-I*Sn?kwkK(&YumaaLBIeSf%TlE_I?nqDZ3x2>Gv int: # Glob rather than pin a Python version: the venv path moves when the base @@ -76,13 +92,22 @@ def main() -> int: if "x-litellm-response-cost-input" in src: print("expose-cost-headers: already applied") return 0 - found = src.count(OLD) - if found != 1: - print(f"WARN expose-cost-headers: expected exactly 1 CORS middleware call, found {found} — skipping") - return 0 - - target.write_text(src.replace(OLD, NEW)) - print(f"expose-cost-headers: appended {len(EXPOSED_HEADERS)} cost header names to expose_headers in {target}") + for old, new, shape in ((OLD, NEW, "1.103.x"), (OLD_V1108, NEW_V1108, "1.108.x")): + found = src.count(old) + if found == 1: + target.write_text(src.replace(old, new)) + print( + f"expose-cost-headers: appended {len(EXPOSED_HEADERS)} cost header names " + f"to expose_headers (anchor {shape}) in {target}" + ) + return 0 + if found > 1: + print(f"WARN expose-cost-headers: expected exactly 1 {shape} CORS middleware call, found {found} — skipping") + return 0 + print( + "WARN expose-cost-headers: no known expose_headers anchor found " + "(neither 1.103.x nor 1.108.x shape) — skipping" + ) return 0