litellm - 💡(How to fix) Fix [Bug]: Bedrock rerank broken after upgrading from v1.83.14 to v1.85 - Unable to map request to provider

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

litellm.APIConnectionError: Unable to map Bedrock request to provider

Root Cause

Likely Root Cause

Code Example

litellm.APIConnectionError: Unable to map Bedrock request to provider

---

model_list:
  - model_name: bedrock-rerank
    litellm_params:
      model: bedrock/arn:aws:bedrock:ap-northeast-1::foundation-model/amazon.rerank-v1:0
      aws_region_name: "ap-northeast-1"

---

curl -X POST http://localhost:4000/rerank \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxx" \
  -d '{
    "model": "bedrock-rerank",
    "query": "hello",
    "documents": ["hello", "world"],
    "top_n": 2
  }'

---

06:13:33 - LiteLLM Proxy:ERROR: common_request_processing.py:1730 - litellm.proxy.proxy_server._handle_llm_api_exception(): Exception occured - litellm.APIConnectionError: Unable to map Bedrock request to provider
RAW_BUFFERClick to expand / collapse

What happened?

After upgrading LiteLLM proxy from v1.83.14 to v1.85.0, Bedrock rerank requests fail with:

litellm.APIConnectionError: Unable to map Bedrock request to provider

The same configuration worked correctly on v1.83.14.

Likely Root Cause

Based on changelog analysis between v1.83.14 and v1.85.0, the regression is most likely caused by:

  1. PR #25499 (feat(vertex_ai): propagate metadata labels to embedding, Imagen, rerank) — This PR modified litellm/llms/base_llm/rerank/transformation.py to add litellm_params: Optional[dict] = None to the abstract transform_rerank_request signature, and updated all other rerank providers (Cohere, Jina, DeepInfra, Fireworks, NVIDIA NIM, HuggingFace, hosted_vllm), but did NOT update litellm/llms/bedrock/rerank/transformation.py. Since Bedrock rerank uses its own handler (as noted in PR #22021: "All other rerank providers go through base_llm_http_handler.rerank(). Bedrock uses its own handler."), this mismatch likely breaks provider mapping.

  2. PR #27257 (Refactor Bedrock response stream shape handling) in v1.85.0 — may have reorganized Bedrock's internal provider registration/mapping and missed the rerank path.

  3. PR #27017 (Align Bedrock count-tokens endpoint assertions with URL-encoded model id) — URL encoding changes to model IDs could break ARN parsing for arn:aws:bedrock:*::foundation-model/amazon.rerank-v1:0.

Relevant Information

  • This is related to #25417 which reported the same error on v1.82.3 via proxy, but the issue here is a clear regression — it worked on v1.83.14 and broke on v1.85.0.
  • Bedrock rerank's BedrockRerankConfig uses _transform_request() rather than the standard transform_rerank_request() from the base class — this architectural divergence is the root of the incompatibility.

Steps to Reproduce

  1. Configure LiteLLM proxy with Bedrock rerank model:
model_list:
  - model_name: bedrock-rerank
    litellm_params:
      model: bedrock/arn:aws:bedrock:ap-northeast-1::foundation-model/amazon.rerank-v1:0
      aws_region_name: "ap-northeast-1"
  1. Start proxy and send a rerank request:
curl -X POST http://localhost:4000/rerank \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxx" \
  -d '{
    "model": "bedrock-rerank",
    "query": "hello",
    "documents": ["hello", "world"],
    "top_n": 2
  }'
  1. Observe error: litellm.APIConnectionError: Unable to map Bedrock request to provider

Relevant log output

06:13:33 - LiteLLM Proxy:ERROR: common_request_processing.py:1730 - litellm.proxy.proxy_server._handle_llm_api_exception(): Exception occured - litellm.APIConnectionError: Unable to map Bedrock request to provider

What LiteLLM version are you on?

  • Working: v1.83.14-stable
  • Broken: v1.85.0

What part of LiteLLM is this about?

Proxy, LLM Translation (Bedrock Rerank)

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix [Bug]: Bedrock rerank broken after upgrading from v1.83.14 to v1.85 - Unable to map request to provider