Skip to content

chore(release): backport #33853 and #33864 onto patch-1.93.0rc2 to complete the 1.93.0 stable cut - #33869

Merged
yuneng-berri merged 2 commits into
patch-1.93.0rc2from
litellm_backport_1930_p2
Jul 18, 2026
Merged

chore(release): backport #33853 and #33864 onto patch-1.93.0rc2 to complete the 1.93.0 stable cut#33869
yuneng-berri merged 2 commits into
patch-1.93.0rc2from
litellm_backport_1930_p2

Conversation

@yuneng-berri

Copy link
Copy Markdown
Collaborator

Relevant issues

Completes the 1.93.0 stable cut on top of #33847. That PR was merged from its 11-pick state, so two staging changes intended for the cut still needed to land on patch-1.93.0rc2: #33853, which restores fresh-database Docker deployments (prisma CLI and engines baked at a fixed path, the fix for the fresh-deploy migration failures tracked since v1.90.0), and #33864, the hardening follow-up to #33721 that was disclosed on #33847 (a deployment configured with a non-numeric token limit made the whole GET /v1/models listing 500; it now degrades to a response without limits, restoring the listing behavior the line had before the cost-map switch)

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

What is included

Both commits carry (cherry picked from commit ...) footers whose SHAs are reachable from litellm_internal_staging; no merge commits, no _experimental/out/ artifacts, no version bump (the branch still rides the pending 1.93.0). Neither pick touches pyproject.toml or uv.lock, so the green image-scan and osv-scan dispatch runs from #33847 remain representative for the dependency set; #33853 changes Dockerfile/docker/Dockerfile.database, which the image-scan workflow does not build, and is a patch-identical pick of the change staging validated the same day

Known noise on this line

tests/test_litellm/proxy/test_proxy_utils.py::test_get_custom_url fails on the untouched base (environment-dependent URL expectation) exactly as documented on #33847; it is the same single failure before and after these picks

Screenshots / Proof of Fix

Targeted test files (tests/test_litellm/proxy/test_proxy_utils.py + tests/test_litellm/test_router.py) on this branch: 172 passed, 1 failed (the known-noise test above). That includes #33864's three regression tests, which fail on the base without the guard with the exact defect (ValueError: invalid literal for int() with base 10: '128,000')

Live proxy on this branch with a deployment configured as model_info: {max_input_tokens: "128,000"}, the request that returned 500 on the pre-guard picks (demonstrated on #33847):

$ curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://localhost:4001/v1/models -H 'Authorization: Bearer sk-1234'
HTTP 200
# from the same response:
gpt-4o          in: 128000  out: 16384   (cost map)
custom-good     in: 32000   out: 8000    (configured model_info)
bad-limit-model in: None    out: None    (malformed value treated as absent)

Type

🐛 Bug Fix

Changes

Two cherry-picks only; no hand-written code. With these, patch-1.93.0rc2 carries the full intended 1.93.0 stable set and release tooling can cut v1.93.0 from the branch

…migrations work for any uid offline (#33853)

* fix(docker): bake prisma CLI and engines at a fixed path so fresh-DB migrations work for any uid offline

The runtime image shipped the prisma CLI and engines under /root/.cache, the
default HOME-derived prisma-python cache location. Any deployment whose
runtime HOME is not /root (kubernetes runAsUser, docker --user, HOME
overrides) missed that cache on a fresh database, fell back to a nodeenv
Node download that crashes on Wolfi (libatomic.so.1), and started the proxy
with zero tables while every DB-backed endpoint returned 500

The bake now lives at /opt/prisma, a path no HOME resolution or cache
volume mount can shadow. The builder records the engine paths there at
generate time, and the runtime stage pins PRISMA_BINARY_CACHE_DIR,
PRISMA_CLI_PATH, PRISMA_CLI_QUERY_ENGINE_TYPE=binary and
PRISMA_OFFLINE_MODE so both litellm-proxy-extras and prisma-python resolve
the baked CLI and engines directly. prisma migrate deploy on a fresh
database now needs no npm and no network access for any runtime uid,
including readOnlyRootFilesystem deployments

Verified against live containers: fresh and existing databases as root,
uid 12345, HOME overridden, on an internal-only docker network, and with
a read-only root filesystem all migrate and serve /team/new successfully

Fixes #33650, #24554

* chore(docker): fail the image build if the baked prisma CLI layout drifts

Asserts the baked CLI shim is executable and its entrypoint exists in the
runtime stage after the COPY and chmod, so a layout change in a future
prisma-python release breaks the image build loudly instead of silently
degrading the migration path at container startup

(cherry picked from commit 567ebcb)
…/models (#33864)

A deployment whose model_info carried a non-numeric max_input_tokens or
max_output_tokens (for example "128,000" or an empty string) made the
bare int() in get_configured_token_limits raise inside the per-model
/v1/models loop, so one misconfigured deployment turned the entire
listing into a 500. Coerce each configured limit safely and treat
malformed values as absent, matching the graceful degradation the
listing had before the cost-map switch

(cherry picked from commit ef7007c)
@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR backports two cherry-picks onto patch-1.93.0rc2 to complete the 1.93.0 stable cut: a Dockerfile fix that bakes Prisma CLI and engines at a fixed /opt/prisma path (restoring fresh-database migration support for non-root UIDs), and a router.py guard that degrades malformed configured token limits to None instead of surfacing a ValueError as a 500 on /v1/models.

  • Dockerfile / docker/Dockerfile.database: prisma generate now runs with HOME=/opt/prisma and PRISMA_BINARY_CACHE_DIR=/opt/prisma/binaries, and the runtime image pins PRISMA_CLI_PATH, PRISMA_OFFLINE_MODE=true, and related env vars; a build-time test -x / test -f guard verifies the baked artifacts before the image is finalised.
  • litellm/router.py: get_configured_token_limits now wraps int() conversion in a _as_int helper that returns None on any TypeError / ValueError, and explicitly excludes bool values from being coerced to 0/1.
  • Tests: Three additive-only test functions cover the full malformed-value matrix, valid numeric-string coercion, and the end-to-end /v1/models listing path — all new, none modify existing assertions.

Confidence Score: 5/5

Both fixes are narrowly scoped, additive-only, and come with dedicated regression tests that fail on the base without the guard.

The router change is a one-function defensive wrapper around an existing int() cast, the Docker change moves Prisma artifacts to a fixed world-readable path with a build-time binary check, and no existing tests were modified — only new ones added.

No files require special attention; all five changed files are straightforward and well-tested.

Important Files Changed

Filename Overview
Dockerfile Bakes Prisma CLI and engines at /opt/prisma with fixed env vars; adds runtime sanity checks confirming the CLI binary and index.js are in place before the image is finalized.
docker/Dockerfile.database Identical Prisma path-pinning change as main Dockerfile; both are consistent, and the database-specific Dockerfile now also gains the PRISMA_OFFLINE_MODE and CLI_PATH env vars.
litellm/router.py Introduces _as_int helper in get_configured_token_limits that silently degrades malformed configured token limits (e.g. "128,000") to None instead of propagating a ValueError that caused a 500 on /v1/models.
tests/test_litellm/test_router.py Adds two new regression tests: one covering the full malformed-value matrix (empty string, "unlimited", comma-formatted, list, dict, bool) and one confirming valid numeric strings still coerce correctly.
tests/test_litellm/proxy/test_proxy_utils.py Adds end-to-end regression test for the /v1/models listing path: verifies that a model configured with max_input_tokens="128,000" produces a 200 response with the token-limit fields absent rather than raising a 500.

Reviews (1): Last reviewed commit: "fix(router): treat malformed configured ..." | Re-trigger Greptile

@yuneng-berri
yuneng-berri merged commit 3510494 into patch-1.93.0rc2 Jul 18, 2026
4 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_backport_1930_p2 branch July 18, 2026 22:38
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.

1 participant