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__.
This commit is contained in:
1 parent
5d38403892
commit
c43d45c455
6 files changed
+50
-10
No files matched your search
@@ -0,0 +1,2 @@
|
||||
__pycache__/
|
||||
*.pyc
|
||||
@@ -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,
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Binary file not shown.
@@ -4,7 +4,9 @@ MEMBER REQUEST (co-op/support#39, 2026-10-31). Browser JS calling the gateway fr
|
||||
another origin cannot read a response header unless the server names it in
|
||||
Access-Control-Expose-Headers. LiteLLM sets
|
||||
|
||||
expose_headers=LITELLM_UI_ALLOW_HEADERS
|
||||
expose_headers=LITELLM_UI_ALLOW_HEADERS # through 1.103.x
|
||||
expose_headers=[*LITELLM_UI_ALLOW_HEADERS,
|
||||
*trace_response_expose_headers()] # from 1.108.0
|
||||
|
||||
which covers seven names (semantic-filter, guardrail, cache-key, ...) and none of
|
||||
the cost ones — so `x-litellm-response-cost*` reads as null in JS even though the
|
||||
@@ -62,6 +64,20 @@ NEW = (
|
||||
+ " ],\n"
|
||||
)
|
||||
|
||||
# 1.108.0 refactored the middleware call (upstream added the trace-response
|
||||
# header set to expose_headers). Same operation, new anchor; tried when the
|
||||
# 1.103.2 shape is absent so the script works against either base image.
|
||||
OLD_V1108 = (
|
||||
" expose_headers=[*LITELLM_UI_ALLOW_HEADERS, *trace_response_expose_headers()],\n"
|
||||
)
|
||||
NEW_V1108 = (
|
||||
" expose_headers=[\n"
|
||||
" *LITELLM_UI_ALLOW_HEADERS,\n"
|
||||
" *trace_response_expose_headers(),\n"
|
||||
+ "".join(f' "{h}",\n' for h in EXPOSED_HEADERS)
|
||||
+ " ],\n"
|
||||
)
|
||||
|
||||
|
||||
def main() -> 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")
|
||||
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
|
||||
|
||||
target.write_text(src.replace(OLD, NEW))
|
||||
print(f"expose-cost-headers: appended {len(EXPOSED_HEADERS)} cost header names to expose_headers in {target}")
|
||||
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
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user