Repository navigation
chore(release): backport #32956 onto patch-1.93.0rc1 for the 1.93.0 rc2 cut - #33499
Conversation
fix(completion): forward aws credential kwargs into litellm_params so the responses bridge keeps WIF auth (cherry picked from commit c75fccf)
Greptile SummaryThis backport cherry-picks #32956 onto
Confidence Score: 5/5The change is safe to merge: it forwards AWS credential kwargs that were previously dropped on the chat→Responses API bridge and adds one targeted IAM action to the STS session-policy ceiling. All five changed files have a well-scoped, clearly motivated change. The credential forwarding in main.py uses a dict expansion over a named constant, which correctly reaches the sparse-extraction loop in get_litellm_params without any duplicate-key risk. The session-policy addition in base_aws_llm.py follows the same pattern as the existing ClaudePlatformLiteLLM statement. Tests cover both the credential-forwarding path (parametrized over WIF and static-key cases) and all four structural properties of the new policy statement, using only mocks with no real network calls. No existing tests appear weakened. No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/litellm_core_utils/get_litellm_params.py | Refactors OPTIONAL_KWARGS_KEYS to split out AWS_CREDENTIAL_KWARGS_KEYS as a named subset; the union preserves the original key set and the backward-compat alias is intact. |
| litellm/main.py | Replaces the single explicit aws_bedrock_project_id= kwarg with a dict-expansion over all AWS_CREDENTIAL_KWARGS_KEYS, so every AWS credential kwarg is forwarded into litellm_params and reaches the Responses API bridge. |
| litellm/llms/bedrock/base_aws_llm.py | Adds bedrock-mantle:CreateInference to the STS session-policy ceiling so OIDC/WIF requests to bedrock_mantle routes are not blocked at the session-policy layer. |
| tests/test_litellm/test_main.py | New parametrized test verifies that acompletion forwards both WIF and static-key AWS credentials through the responses bridge, using respx/monkeypatch mocks only — no real network calls. |
| tests/test_litellm/llms/bedrock/test_web_identity_session_policy.py | Adds TestBedrockMantleActionsCovered with four assertions covering presence, Effect, resource scope, and SecureTransport condition of the new BedrockMantleLiteLLM policy statement. |
Reviews (1): Last reviewed commit: "Merge pull request #32956 from BerriAI/l..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Brings h2o-main (upstream 1.93.0 release line + the h2o commits) up to the upstream v1.99.4 release. The 1.93.0 release-line backports on our side (BerriAI#33499, BerriAI#33847, BerriAI#33869, BerriAI#33904) are all present in v1.99.4 from main, so every file only they touched takes upstream's version; the h2o changes are re-applied on top of upstream's new code. Conflicted files and their resolution: - Dockerfile, docker/Dockerfile.database, docker/Dockerfile.non_root: upstream (the /opt/prisma bake from the 1.93 backports is in v1.99.4; no h2o lines). - litellm-rust/Cargo.lock, litellm-rust/crates/python-bridge/src/lib.rs: upstream (release-line backport only). - pyproject.toml, uv.lock: upstream. No h2o commit added a dependency. - litellm/litellm_core_utils/core_helpers.py, get_litellm_params.py, litellm/llms/anthropic/experimental_pass_through/messages/transformation.py, litellm/main.py, litellm/proxy/utils.py, litellm/router.py, litellm/types/guardrails.py, litellm/proxy/guardrails/guardrail_hooks/ model_armor/{__init__,file_scanning,model_armor}.py: upstream (release-line backports, e.g. coerce_token_limit / skip_unscannable_attachments, already in v1.99.4). - tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py, tests/test_litellm/proxy/test_proxy_utils.py, tests/test_litellm/test_main.py, tests/test_litellm/test_router.py: upstream (same backports). - litellm/litellm_core_utils/get_llm_provider_logic.py: upstream code, h2o redaction kept -- "dynamic_api_key needs to be a string." never echoes the key. - litellm/proxy/auth/user_api_key_auth.py: upstream's %-style logging, h2o redaction kept -- the custom-header debug line no longer logs the (abbreviated) key. - litellm/proxy/route_llm_request.py: upstream. The h2o lazy DB reload (reload_models_on_demand) is DROPPED: v1.99.4's route_request retries a ProxyModelNotFoundError through model_registry_read_through, which loads the missing model from the DB (bounded by a miss TTL and a resync budget). Upstream's read-through requires store_model_in_db=True. - litellm/llms/bedrock/chat/converse_transformation.py: upstream's fix for the same bug as h2o h2oai#24 (the toolChoice / tool_choice.type conflict and the missing type): native toolConfig.toolChoice keeps the caller's choice and the passthrough drops its type. h2o's rework that deleted the native toolChoice is dropped in its favour. Re-applied on top: the guards upstream lacks -- no passthrough without MAPPED tools, for tool_choice="none", or for a non-bool parallel_tool_calls (_drop_parallel_tool_use_config_with_nothing_to_say). - tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py: both sides kept; the h2o tests re-pinned to upstream's design (native toolChoice carries the choice, passthrough carries only disable_parallel_tool_use); the test of the removed h2o builder is dropped. Also, outside the conflicts: - litellm/llms/gemini/count_tokens/handler.py: upstream; its own "if not contents" guard supersedes the h2o None check. - litellm/llms/vertex_ai/vertex_llm_base.py: h2o base64 credentials kept, ruff-formatted. - litellm/integrations/h2o/router/h2orouter_policy.py: docstring no longer names the removed reload_models_on_demand. - gateway/routes/allowlist.py: the h2o /v1/router/models endpoint added to the gateway component (v1.99.4 splits routes across gateway/backend and test_component_allowlists fails on an uncovered route). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Relevant issues
Backports #32956 onto a fresh base branch cut from the
v1.93.0-rc.1tag, so the 1.93.0 rc2 build carries the fix. #32956 forwards AWS credential kwargs (region, access key, secret, session token, web identity token, role name, session name) from the top-levelcompletion()call intolitellm_params, so a chat request that is routed through the chat -> Responses API bridge keeps Web Identity Federation auth instead of dropping the deployment's credentials. It also adds thebedrock-mantle:CreateInferenceaction to the STS session policy so the same path works for the responses-only bedrock mantle models. Carries the LIT-3859 fix.The other PR originally requested for this line, #33248 (left-anchor the Create Key and Create Team CTAs), is intentionally NOT included: rc1 predates the Teams/Keys UI migration, so it renders
OldTeams.tsxand the legacy keys page, not the migratedTeams.tsx/VirtualKeysTable.tsxthat #33248 edits. The cherry-pick conflicts in every file and has nothing to attach to on this line, so it is dropped rather than hand-adapted.Linear ticket
Resolves LIT-3859
Pre-Submission checklist
What is included
fix(completion): forward aws credential kwargs into litellm_params so the responses bridge keeps WIF auth (cherry-picked-x -m 1from staging mergec75fccf; the pick is patch-identical to the source, no adaptation)No version bump: rc1's
pyproject.tomlalready reads1.93.0and finalv1.93.0is unreleased (nov1.93.0tag, norelease/v1.93.0branch, DockerHubv1.93.0returns 404; onlyv1.93.0-rc.1is published). The pick rides the pending1.93.0; release tooling cutsv1.93.0-rc.2from this branch. No production.tsxis touched, so there is no UI rebuild.Base branch and provenance
Base is
patch-1.93.0rc1, a new branch created at the exactv1.93.0-rc.1commit (10d5804b);git diff v1.93.0-rc.1 patch-1.93.0rc1is empty. The one commit on this PR carries a(cherry picked from commit c75fccf)footer and that SHA is reachable fromlitellm_internal_staging. No merge commits, no_experimental/out/artifacts.Known noise on this line
None on the targeted test set once
boto3is present in the env. A bare env withoutboto3fails 22 bedrock/WIF tests withModuleNotFoundError: No module named 'boto3'; that is an environment gap, not a code failure, and CI installs boto3.Screenshots / Proof of Fix
The original ticket reproducer needs a live Web Identity Federation setup (a Google-issued OIDC token plus a real IAM role and a bedrock mantle deployment), which is not reproducible on a local dev box, so the end-to-end WIF replay lives in #32956 itself. On this backport branch the evidence is the pick's own tests passing on the rc1 code, plus a live-proxy sanity pass that the credential-forwarding path is intact.
Targeted test delta, captured at
fba058b865(the pick) versus10d5804b(rc1 baseline):The pick's own new tests, all passing on rc1:
Live proxy on the built branch (
fba058b865), real API calls:Adversarial behavioral review (deep mode, five independent lenses including three refutation passes) sealed a SURVIVED verdict with zero verified findings: every symbol the pick references resolves on rc1; a revert-to-red delta proof (reverting the forwarding line turns the WIF-forwarding test red, restoring it turns it green) confirms the pick actually delivers the fix on this line; and
OPTIONAL_KWARGS_KEYSmembership plus the_OPTIONAL_KWARGS_KEYSbackward-compat alias are byte-identical pre and post pick, so no existing caller ofcompletion,get_litellm_params, orBaseAWSLLMis broken. The real STS AssumeRoleWithWebIdentity exchange was mocked here (it needs live AWS WIF, which is exercised end-to-end in #32956), so that boundary is covered there rather than on this branch.Type
🐛 Bug Fix
Changes
Cherry-pick of #32956 only. No hand-written code; the single commit is a verbatim
-x -m 1pick of the staging merge, plus this PR targets the newpatch-1.93.0rc1base branch cut from the rc1 tag.