build(packaging): relax core runtime pins to ranges (rc2 backport of #27241) - #27545
Conversation
Backport of #27241 onto litellm_1.84.0rc2. The 12 entries in `[project.dependencies]` were exact `==` pins, a side effect of the Poetry -> uv migration. This forces every downstream package that lists litellm as a dependency to downgrade common runtime libraries (openai, pydantic, aiohttp, click, jsonschema, ...) to the exact versions we ship. Switch to lower-bounded ranges with upper bounds where the upstream package is pre-1.0 or has a known breaking-major-version policy. Reproducibility for our Docker proxy and CI continues to come from `uv.lock`, which is regenerated here as a metadata-only diff. Conflict resolution vs upstream merge: - The upstream merge commit also surfaced unrelated context entries (nvidia-riva-client, soundfile/stt-nvidia-riva extra) that exist in staging but not in rc2. Those are not part of #27241's intent and were dropped from the resolution; the rc2 uv.lock keeps its existing entry set, only the 12 specifier strings changed. - `uv lock --check` passes (392 packages resolved, no drift).
Greptile SummaryThis backport relaxes all 12 core runtime
Confidence Score: 4/5Safe to merge for Docker/CI consumers since uv.lock hashes are unchanged; downstream SDK consumers picking up the lowest allowed versions of The lock file is unchanged in its resolved graph, so the proxy/Docker path is unaffected. The two observations — the The floor versions in
|
| Filename | Overview |
|---|---|
| pyproject.toml | Switches 12 core runtime dependencies from exact == pins to lower-bounded ranges; floors are intentionally set below the previously-pinned versions to allow downstream consumers flexibility. |
| uv.lock | Metadata-only update to requires-dist entries mirroring the pyproject.toml specifier rewrites; resolved versions and hashes are unchanged. |
Reviews (1): Last reviewed commit: "build(packaging): relax core runtime pin..." | Re-trigger Greptile
| # Python with: `uv pip install --resolution=lowest-direct .` | ||
| "fastuuid>=0.14.0,<1.0", | ||
| "httpx>=0.28.0,<1.0", | ||
| "openai>=2.20.0,<3.0.0", |
There was a problem hiding this comment.
openai floor is 13 minor versions below the previously pinned release
The floor >=2.20.0 is significantly below the formerly-pinned ==2.33.0. The openai Python v2 SDK adds new streaming types, response models, and client methods across minor versions. If litellm calls any method or reads any field introduced after 2.20.0, a downstream consumer installing at the floor will get a runtime AttributeError or ImportError. The PR description mentions uv pip install --resolution=lowest-direct . as validation — it would be worth confirming that a full litellm.completion() call (not just an import) succeeds against openai==2.20.0 before merging.
| "tokenizers>=0.21.0,<1.0", | ||
| "click>=8.0.0,<9.0", | ||
| "jinja2>=3.1.0,<4.0", | ||
| "aiohttp>=3.10,<4.0", |
There was a problem hiding this comment.
jsonschema floor drops from 4.23.0 to 4.0.0 — referencing subsystem changed significantly mid-range
Between jsonschema 4.0.0 and 4.23.0, the library split out referencing as a separate dependency and rewired how $ref resolution works. Any schema validation code in litellm that relies on the post-split behavior (e.g., jsonschema.validate with cross-document $ref) may fail silently or raise an unexpected exception when resolved against 4.0.0–4.17.x. The floor could safely be raised to >=4.17.0 (when the referencing integration landed) or at minimum >=4.21.1 to narrow this window.
| "importlib-metadata>=8.0.0,<9.0", | ||
| "tokenizers>=0.21.0,<1.0", | ||
| "click>=8.0.0,<9.0", | ||
| "jinja2>=3.1.0,<4.0", |
There was a problem hiding this comment.
High: Sandbox escape in user-submitted prompt templates
Lowering this floor admits Jinja2 3.1.0 through 3.1.5, which contain the sandbox attr filter bypass fixed in 3.1.6. LiteLLM renders caller-supplied dotprompt_content through ImmutableSandboxedEnvironment in /prompts/test, so an authenticated user on an install resolved to those versions can submit a template that escapes the sandbox instead of being limited to prompt variables.
| "jinja2>=3.1.0,<4.0", | |
| "jinja2>=3.1.6,<4.0", |
High: Vulnerable Jinja2 versions allowed for prompt renderingThis PR relaxes core runtime dependency pins for package consumers. The new Jinja2 lower bound permits versions with a known sandbox bypass while LiteLLM renders caller-supplied dotprompt templates in a sandboxed Jinja environment. Status: 1 new · 1 open |
Summary
Backport of #27241 onto
litellm_1.84.0rc2.The 12 entries in
[project.dependencies]are exact==pins, a side effect of the Poetry → uv migration. This forces every downstream package that lists litellm as a dependency to downgrade common runtime libraries (openai,pydantic,aiohttp,click,jsonschema,python-dotenv, …) to the exact versions we ship.Switches to lower-bounded ranges with upper bounds on packages that are pre-1.0 or follow a breaking-major-version policy. Reproducibility for our Docker proxy and CI continues to come from
uv.lock, which is regenerated here as a metadata-only diff (no resolved versions or hashes change).See #27241 for full motivation, floor table, and validation methodology.
Conflict resolution vs upstream
git cherry-pick -m 1 40a490aeproduced twouv.lockconflicts. Both were caused by entries that exist in staging but not in rc2 — they were unchanged context in the source PR, not part of #27241's intent:nvidia-riva-client(stt-nvidia-rivaextra)soundfile(stt-nvidia-rivaextra)Those lines were dropped from the resolution; rc2's existing
requires-distentry set is preserved. Only the 12 specifier strings changed.Test plan
uv lock --checkafter pyproject change — passes (392 packages, no resolved-version drift)pyproject.tomlanduv.lock