litellm - 💡(How to fix) Fix [Bug]: bedrock doesn't pass model_id to aws invocation url for gemini route [1 participants]

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…
GitHub stats
BerriAI/litellm#25268Fetched 2026-04-08 03:02:23
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Code Example

- model_name: aws/claude-opus-4-6
    litellm_params:
      model: global.anthropic.claude-opus-4-6-v1
      model_id: arn:aws:bedrock:xx

---
RAW_BUFFERClick to expand / collapse

Check for existing issues

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

What happened?

Add an bedrock provider with model_id

  - model_name: aws/claude-opus-4-6
    litellm_params:
      model: global.anthropic.claude-opus-4-6-v1
      model_id: arn:aws:bedrock:xx

invoke it using anthropic and openai endpoint, they both correctly convert the actual api call to https://bedrock-runtime.us-west-2.amazonaws.com/model/arn%xxxxxx

Try invoke it using gemini endpoing /v1beta/models/aws/claude-sonnet-4-6:generateContent

Inspect the log, the base api_url is not being converted to https://bedrock-runtime.us-west-2.amazonaws.com/model/arn%xxxxxx

Steps to Reproduce

Already written

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.82.3

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The issue may be resolved by ensuring the model_id is correctly formatted and passed to the Gemini endpoint, allowing the base API URL to be properly converted.

Guidance

  • Verify that the model_id in the configuration is correctly set to the ARN of the Bedrock model, and that it matches the expected format.
  • Check the implementation of the Gemini endpoint to ensure it correctly handles the model_id and converts the base API URL as expected.
  • Compare the API call conversions between the Anthropic and OpenAI endpoints to identify any differences in handling the model_id.
  • Test the Gemini endpoint with a manually constructed API URL to see if the issue is specific to the automatic conversion.

Example

No code snippet is provided due to lack of specific implementation details in the issue.

Notes

The issue seems to be specific to the Gemini endpoint, and the root cause may be related to how this endpoint handles the model_id or constructs the API URL. Further investigation into the endpoint's implementation is needed.

Recommendation

Apply workaround: Modify the Gemini endpoint to correctly handle the model_id and convert the base API URL, or use a different endpoint that correctly handles the model_id, such as the Anthropic or OpenAI endpoint, as a temporary solution until the Gemini endpoint is fixed.

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