Skip to content

fix(bedrock/chat/invoke_handler.py): Fix provider parsing in bedrock - #6645

Closed
bhushitagarwal-circle wants to merge 1 commit into
BerriAI:mainfrom
bhushitagarwal-circle:bedrock_provider_parsing_fix
Closed

bhushitagarwal-circle wants to merge 1 commit into
BerriAI:mainfrom
bhushitagarwal-circle:bedrock_provider_parsing_fix

Conversation

@bhushitagarwal-circle

@bhushitagarwal-circle bhushitagarwal-circle commented Nov 7, 2024 •

Copy link
Copy Markdown

Title

Bedrock has updated the naming convention for the new model names being released. Prior convention was to start the model name with provider name (eg. meta, anthropic) followed by model details. Now, they've added region before provider name. This PR updates provider name extraction to be more generic and compatible for old and new naming convention.

Relevant issues

Fixes #6644

Type

🐛 Bug Fix

Changes

  • Added a list of bedrock model providers (bedrock_model_providers) to litellm/llms/bedrock/chat/invoke_handler.py.

  • Introduced a new function _get_bedrock_provider to determine the provider from a model string.

  • Updated the process_response function to use _get_bedrock_provider instead of splitting the model string directly.

  • Updated the completion function to use _get_bedrock_provider instead of splitting the model string directly.

[REQUIRED] Testing - Attach a screenshot of any new tests passing local

If UI changes, send a screenshot/GIF of working UI fixes

@vercel

vercel Bot commented Nov 7, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 5:40pm

@bhushitagarwal-circle

Copy link
Copy Markdown
Author

This was resolved in the recent versions

This branch was successfully deployed

1 active deployment
Preview — c7be9dc1 Deployed Nov 7, 2024 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect parsing of new bedrock model names

1 participant