Skip to content

fix(ui): stop listing bedrock_mantle models under the Bedrock provider - #31478

Merged
mateo-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_fix_bedrock_mantle_ui_provider_filter
Jun 26, 2026
Merged

fix(ui): stop listing bedrock_mantle models under the Bedrock provider#31478
mateo-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_fix_bedrock_mantle_ui_provider_filter

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Resolves LIT-3992

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

This is a dropdown-filtering fix in the Add Model form, so the proof is what you see in the UI. To reproduce on a local proxy (python litellm/proxy/proxy_cli.py --config litellm/proxy/dev_config.yaml --detailed_debug --reload):

  1. Go to http://localhost:4000/ui/?page=models-and-endpoints and open the Add Model tab
  2. Select Provider "Amazon Bedrock". Before this change the LiteLLM Model Name(s) suggestions include bedrock_mantle/... entries; after this change they no longer appear (you still see bedrock/bedrock_converse models)
  3. Select Provider "Amazon Bedrock Mantle". The bedrock_mantle/... models still appear there

I will attach before/after screenshots of both provider selections

Type

🐛 Bug Fix

Changes

getProviderModels in provider_info_helpers.tsx built each provider's model list by rolling in every litellm_provider that starts with the selected provider's slug. Because "bedrock_mantle".startsWith("bedrock_") is true, the OpenAI-compatible bedrock_mantle/* models (served at bedrock-mantle.{region}.api.aws) were offered under plain Amazon Bedrock. That combination is dead on arrival: a bedrock_mantle/openai.... model string under the bedrock provider does not match the mantle/ route, so it falls through to bedrock-runtime and the request fails.

The prefix rollup is still the right behavior for genuine sub-variants like bedrock_converse, which are not separately selectable providers. The fix introduces a small standaloneSubproviderSlugs set and excludes those slugs from the prefix rollup, so bedrock_mantle/* only shows under the Amazon Bedrock Mantle provider while everything else is unchanged.

I considered a general rule that excludes any registered sub-provider from prefix matching, but vertex_ai_beta is structurally identical to bedrock_mantle (both are registered ${parent}_suffix providers) and the existing tests require it to keep rolling up under Vertex. There is no structural signal separating the two, so the exception lives in one explicit, named place.

Updated provider_info_helpers.test.tsx: the test that previously asserted bedrock_mantle shows under Bedrock now asserts it is excluded (while bedrock and bedrock_converse remain). It fails on the old code and passes on the new code. Full suite: 59/59.


Note

Low Risk
Small, targeted UI filtering change with unit test coverage; no auth, routing, or backend behavior changes.

Overview
Fixes Add Model suggestions so bedrock_mantle/* models no longer appear when Amazon Bedrock is selected, while Amazon Bedrock Mantle still lists only Mantle models.

getProviderModels still rolls in prefix-matched litellm_provider variants (e.g. bedrock_converse), but bedrock_mantle is excluded via a new standaloneSubproviderSlugs set because it is a separately selectable provider whose slug falsely matched the bedrock_ prefix.

Tests now assert Mantle models are not included under the Bedrock key and still appear under BedrockMantle.

Reviewed by Cursor Bugbot for commit 875b124. Bugbot is set up for automated code reviews on this repo. Configure here.

The Add Model form's getProviderModels rolled any litellm_provider that
starts with the selected provider's slug into that provider's list. Because
"bedrock_mantle".startsWith("bedrock_") is true, bedrock_mantle/* models
(OpenAI-compatible, served at bedrock-mantle.{region}.api.aws) showed up
under plain Amazon Bedrock, where that model string routes to bedrock-runtime
and fails.

Exclude standalone sub-providers from the prefix rollup so bedrock_mantle/*
only appears under the Amazon Bedrock Mantle provider, while bedrock_converse
and other genuine sub-variants keep rolling up under Bedrock.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 875b124. Configure here.

@mateo-berri
mateo-berri merged commit 01efcc1 into litellm_internal_staging Jun 26, 2026
125 checks passed
@mateo-berri
mateo-berri deleted the litellm_fix_bedrock_mantle_ui_provider_filter branch June 26, 2026 22:51
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.

2 participants