chore(release): backport #33853 and #33864 onto patch-1.93.0rc2 to complete the 1.93.0 stable cut - #33869
Conversation
…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 SummaryThis PR backports two cherry-picks onto
Confidence Score: 5/5Both 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.
|
| 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
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
@greptileaito re-request a review after pushing changes)What is included
fix(docker): bake prisma CLI and engines at a fixed path so fresh-DB migrations work for any uid offline (verbatim pick of staging squash567ebcb3e9)fix(router): treat malformed configured token limits as absent on /v1/models (pick of staging squashef7007c3dd; every added and removed line is byte-identical to the source, the patch-id differs only through surrounding context the line does not carry)Both commits carry
(cherry picked from commit ...)footers whose SHAs are reachable fromlitellm_internal_staging; no merge commits, no_experimental/out/artifacts, no version bump (the branch still rides the pending1.93.0). Neither pick touchespyproject.tomloruv.lock, so the green image-scan and osv-scan dispatch runs from #33847 remain representative for the dependency set; #33853 changesDockerfile/docker/Dockerfile.database, which the image-scan workflow does not build, and is a patch-identical pick of the change staging validated the same dayKnown noise on this line
tests/test_litellm/proxy/test_proxy_utils.py::test_get_custom_urlfails on the untouched base (environment-dependent URL expectation) exactly as documented on #33847; it is the same single failure before and after these picksScreenshots / 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):Type
🐛 Bug Fix
Changes
Two cherry-picks only; no hand-written code. With these,
patch-1.93.0rc2carries the full intended 1.93.0 stable set and release tooling can cutv1.93.0from the branch