@@ -1058,16 +1058,24 @@ export const MCP_AUTH_TYPE_OPTIONS = [
10581058 { value : "custom-header" , label : "Custom header (pending backend)" } ,
10591059] as const ;
10601060
1061- /** Aligns with dataFoundry `LLM_PROVIDER` env and Mastra router provider ids . */
1061+ /** Chat models use one OpenAI-compatible provider path; vendor choice lives in baseUrl/modelName . */
10621062export const LLM_PROVIDER_OPTIONS = [
10631063 { value : "openai-compatible" , label : "OpenAI compatible (LLM_PROVIDER=openai-compatible)" } ,
1064- { value : "bailian" , label : "Bailian DashScope (bailian)" } ,
1065- { value : "deepseek" , label : "DeepSeek (deepseek)" } ,
1066- { value : "openai" , label : "OpenAI (openai)" } ,
1067- { value : "anthropic" , label : "Anthropic (anthropic)" } ,
1068- { value : "google" , label : "Google Gemini (google)" } ,
10691064] as const ;
10701065
1066+ function normalizeLlmProvider ( provider ?: string ) : string {
1067+ const normalized = provider ?. trim ( ) . toLowerCase ( ) . replaceAll ( "_" , "-" ) ?? "" ;
1068+ if (
1069+ normalized === "bailian"
1070+ || normalized === "deepseek"
1071+ || normalized === "openai"
1072+ || normalized === "openai-compatible"
1073+ ) {
1074+ return "openai-compatible" ;
1075+ }
1076+ return normalized || "openai-compatible" ;
1077+ }
1078+
10711079export function normalizeLlmSettings (
10721080 settings ?: Record < string , string > ,
10731081) : {
@@ -1077,7 +1085,7 @@ export function normalizeLlmSettings(
10771085 modelName : string ;
10781086} {
10791087 return {
1080- provider : settings ?. provider ?? "openai-compatible" ,
1088+ provider : normalizeLlmProvider ( settings ?. provider ) ,
10811089 baseUrl : settings ?. baseUrl ?? settings ?. base_url ?? "" ,
10821090 apiKey : settings ?. apiKey ?? settings ?. api_key ?? "" ,
10831091 modelName :
@@ -1668,7 +1676,7 @@ export const WORKSPACE_CONFIG_FIELDS: Record<
16681676 inputType : "select" ,
16691677 options : [ ...LLM_PROVIDER_OPTIONS ] ,
16701678 helpText :
1671- "openai-compatible / bailian use the OpenAI-compatible path. anthropic/google await integration validation ." ,
1679+ "All chat models use the OpenAI-compatible /chat/completions path ." ,
16721680 required : true ,
16731681 fullWidth : true ,
16741682 } ,
0 commit comments