Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Update conditional_public_model_name.tsx (#11713)

tanjiroedc84b6b6d03
diff --git a/ui/litellm-dashboard/src/components/add_model/conditional_public_model_name.tsx b/ui/litellm-dashboard/src/components/add_model/conditional_public_model_name.tsx
index 0f79401753e..40a124264a7 100644
--- a/ui/litellm-dashboard/src/components/add_model/conditional_public_model_name.tsx
+++ b/ui/litellm-dashboard/src/components/add_model/conditional_public_model_name.tsx
@@ -40,11 +40,14 @@ const ConditionalPublicModelName: React.FC = () => {
const currentMappings = form.getFieldValue('model_mappings') || [];
// Only update if the mappings don't exist or don't match the selected models
- const shouldUpdateMappings = currentMappings.length !== selectedModels.length ||
- !selectedModels.every(model =>
- currentMappings.some((mapping: { public_name: string; litellm_model: string }) =>
- mapping.public_name === model ||
- (model === 'custom' && mapping.public_name === customModelName)));
+ const shouldUpdateMappings = currentMappings.length !== selectedModels.length ||
+ !selectedModels.every(model =>
+ currentMappings.some((mapping: { public_name: string; litellm_model: string }) => {
+ if (model === 'custom') {
+ return mapping.litellm_model === 'custom' || mapping.litellm_model === customModelName;
+ }
+ return mapping.litellm_model === model;
+ }));
if (shouldUpdateMappings) {
const mappings = selectedModels.map((model: string) => {