fix(ui): improve Add Model form with provider filters and logo fixes

- Filter redundant providers from dropdown: ANTHROPIC_TEXT, AZURE_TEXT,
  COHERE_CHAT, OLLAMA_CHAT, VERTEX_AI_BETA
- Fix logo lookup for Mistral AI and Azure AI Foundry by normalizing
  provider identifiers (MistralAI -> MISTRAL, Azure_AI_Studio -> AZURE_AI)
- Update Azure AI Foundry logo to use dedicated azure_ai_foundry.png
- Filter invalid image model variants with resolution/quality prefixes
  (e.g., "1024-x-1024/gpt-image-1.5", "standard/1024-x-1024/gpt-image-1")

Follow-up to PR #19264
This commit is contained in:
Chesars 2026-01-19 09:33:15 -03:00
parent ddebd6c7e6
commit daceb7721c
3 changed files with 12 additions and 5 deletions

View file

@ -411,7 +411,7 @@
"default_model_placeholder": "azure/my-deployment"
},
{
"provider": "Azure_AI_Studio",
"provider": "AZURE_AI",
"provider_display_name": "Azure AI Foundry (Studio)",
"litellm_provider": "azure_ai",
"credential_fields": [
@ -1663,7 +1663,7 @@
"default_model_placeholder": "gpt-3.5-turbo"
},
{
"provider": "MistralAI",
"provider": "MISTRAL",
"provider_display_name": "Mistral AI",
"litellm_provider": "mistral",
"credential_fields": [

View file

@ -92,6 +92,11 @@ const AddModelForm: React.FC<AddModelFormProps> = ({
"OpenAI_Text",
"OpenAI_Compatible",
"OpenAI_Text_Compatible",
"ANTHROPIC_TEXT",
"AZURE_TEXT",
"COHERE_CHAT",
"OLLAMA_CHAT",
"VERTEX_AI_BETA",
]);
const sortedProviderMetadata: ProviderCreateInfo[] = useMemo(() => {

View file

@ -222,7 +222,7 @@ export const providerLogoMap: Record<string, string> = {
[Providers.ANTHROPIC_TEXT]: `${asset_logos_folder}anthropic.svg`,
[Providers.AssemblyAI]: `${asset_logos_folder}assemblyai_small.png`,
[Providers.Azure]: `${asset_logos_folder}microsoft_azure.svg`,
[Providers.Azure_AI_Studio]: `${asset_logos_folder}microsoft_azure.svg`,
[Providers.Azure_AI_Studio]: `${asset_logos_folder}azure_ai_foundry.png`,
[Providers.AZURE_TEXT]: `${asset_logos_folder}microsoft_azure.svg`,
[Providers.BASETEN]: `${asset_logos_folder}baseten.svg`,
[Providers.Bedrock]: `${asset_logos_folder}bedrock.svg`,
@ -369,8 +369,10 @@ export const getPlaceholder = (selectedProvider: string): string => {
};
const isValidModelName = (modelName: string): boolean => {
const resolutionOnlyPattern = /^\d{3,4}-x-\d{3,4}\/dall-e-[23]$/;
return !resolutionOnlyPattern.test(modelName);
// Filter out image model variants with resolution/quality prefixes
// Examples: "1024-x-1024/gpt-image-1.5", "high/1024-x-1024/gpt-image-1", "standard/1024-x-1024/gpt-image-1"
const invalidImageModelPattern = /^(high|low|medium|standard|hd)?\/?\d{3,4}-x-\d{3,4}\/(dall-e-|gpt-image-)/;
return !invalidImageModelPattern.test(modelName);
};
export const getProviderModels = (provider: Providers, modelMap: any): Array<string> => {