diff --git a/src/config/llm.ts b/src/config/llm.ts index 56981d585d66..91ac88e70d50 100644 --- a/src/config/llm.ts +++ b/src/config/llm.ts @@ -28,6 +28,7 @@ export const getLLMConfig = () => { ENABLED_GOOGLE: z.boolean(), GOOGLE_API_KEY: z.string().optional(), GOOGLE_PROXY_URL: z.string().optional(), + GOOGLE_MODEL_LIST: z.string().optional(), ENABLED_MOONSHOT: z.boolean(), MOONSHOT_API_KEY: z.string().optional(), @@ -134,6 +135,7 @@ export const getLLMConfig = () => { ENABLED_GOOGLE: !!process.env.GOOGLE_API_KEY, GOOGLE_API_KEY: process.env.GOOGLE_API_KEY, GOOGLE_PROXY_URL: process.env.GOOGLE_PROXY_URL, + GOOGLE_MODEL_LIST: process.env.GOOGLE_MODEL_LIST, ENABLED_PERPLEXITY: !!process.env.PERPLEXITY_API_KEY, PERPLEXITY_API_KEY: process.env.PERPLEXITY_API_KEY, diff --git a/src/server/globalConfig/index.ts b/src/server/globalConfig/index.ts index 82d8a9e6d620..004eaead6666 100644 --- a/src/server/globalConfig/index.ts +++ b/src/server/globalConfig/index.ts @@ -6,6 +6,7 @@ import { getLLMConfig } from '@/config/llm'; import { BedrockProviderCard, FireworksAIProviderCard, + GoogleProviderCard, GroqProviderCard, NovitaProviderCard, OllamaProviderCard, @@ -39,6 +40,7 @@ export const getServerGlobalConfig = () => { AWS_BEDROCK_MODEL_LIST, ENABLED_GOOGLE, + GOOGLE_MODEL_LIST, ENABLED_GROQ, GROQ_MODEL_LIST, @@ -128,7 +130,14 @@ export const getServerGlobalConfig = () => { }), }, - google: { enabled: ENABLED_GOOGLE }, + google: { + enabled: ENABLED_GOOGLE, + enabledModels: extractEnabledModels(GOOGLE_MODEL_LIST), + serverModelCards: transformToChatModelCards({ + defaultChatModels: GoogleProviderCard.chatModels, + modelString: GOOGLE_MODEL_LIST, + }), + }, groq: { enabled: ENABLED_GROQ, enabledModels: extractEnabledModels(GROQ_MODEL_LIST),