From 01efcc1b740c28d9eff5229844258ddc2bc9a137 Mon Sep 17 00:00:00 2001 From: Mateo Wang <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 26 Jun 2026 15:51:03 -0700 Subject: [PATCH] fix(ui): stop listing bedrock_mantle models under the Bedrock provider (#31478) 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. --- .../src/components/provider_info_helpers.test.tsx | 6 +++--- .../src/components/provider_info_helpers.tsx | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/litellm-dashboard/src/components/provider_info_helpers.test.tsx b/ui/litellm-dashboard/src/components/provider_info_helpers.test.tsx index d870c278db0..ea563476c3d 100644 --- a/ui/litellm-dashboard/src/components/provider_info_helpers.test.tsx +++ b/ui/litellm-dashboard/src/components/provider_info_helpers.test.tsx @@ -308,17 +308,17 @@ describe("provider_info_helpers", () => { expect(result).not.toContain("anthropic-native"); }); - it("should include bedrock variants (converse, mantle) when called with 'Bedrock' provider key", () => { + it("should include bedrock converse but exclude standalone bedrock_mantle when called with 'Bedrock' provider key", () => { const modelMap = { "bedrock-base": { litellm_provider: "bedrock" }, "bedrock-converse-model": { litellm_provider: "bedrock_converse" }, - "bedrock-mantle-model": { litellm_provider: "bedrock_mantle" }, + "bedrock_mantle/openai.gpt-5.4": { litellm_provider: "bedrock_mantle" }, "openai-model": { litellm_provider: "openai" }, }; const result = getProviderModels("Bedrock" as Providers, modelMap); expect(result).toContain("bedrock-base"); expect(result).toContain("bedrock-converse-model"); - expect(result).toContain("bedrock-mantle-model"); + expect(result).not.toContain("bedrock_mantle/openai.gpt-5.4"); expect(result).not.toContain("openai-model"); }); diff --git a/ui/litellm-dashboard/src/components/provider_info_helpers.tsx b/ui/litellm-dashboard/src/components/provider_info_helpers.tsx index b6bdbbc85f0..d158cc6a1f0 100644 --- a/ui/litellm-dashboard/src/components/provider_info_helpers.tsx +++ b/ui/litellm-dashboard/src/components/provider_info_helpers.tsx @@ -218,6 +218,8 @@ export const provider_map: Record = { ZAI: "zai", }; +const standaloneSubproviderSlugs = new Set(["bedrock_mantle"]); + const asset_logos_folder = "/ui/assets/logos/"; export const providerLogoMap: Record = { @@ -394,11 +396,13 @@ export const getProviderModels = (provider: Providers, modelMap: any): Array { if (value !== null && typeof value === "object" && "litellm_provider" in (value as object)) { const litellmProvider = (value as any)["litellm_provider"]; + const isPrefixVariant = + typeof litellmProvider === "string" && + (litellmProvider.startsWith(`${custom_llm_provider}_`) || + litellmProvider.startsWith(`${custom_llm_provider}-`)); if ( litellmProvider === custom_llm_provider || - (typeof litellmProvider === "string" && - (litellmProvider.startsWith(`${custom_llm_provider}_`) || - litellmProvider.startsWith(`${custom_llm_provider}-`))) + (isPrefixVariant && !standaloneSubproviderSlugs.has(litellmProvider)) ) { providerModels.push(key); }