From a42117a47a4290e013c99d9c27bbf38fe862c476 Mon Sep 17 00:00:00 2001 From: Sathia Date: Mon, 22 Jun 2026 19:06:18 +0200 Subject: [PATCH] fix: show API key field for Ollama providers and pass apiKey to createOllama --- .../dashboard/settings/handle-ai.tsx | 58 +++++++++---------- .../server/src/utils/ai/select-ai-provider.ts | 2 +- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/apps/dokploy/components/dashboard/settings/handle-ai.tsx b/apps/dokploy/components/dashboard/settings/handle-ai.tsx index 18915609e7..e6e8ffd10a 100644 --- a/apps/dokploy/components/dashboard/settings/handle-ai.tsx +++ b/apps/dokploy/components/dashboard/settings/handle-ai.tsx @@ -275,36 +275,34 @@ export const HandleAi = ({ aiId }: Props) => { )} /> - {!isOllama && ( - ( - - API Key - - { - field.onChange(e); - // Reset model when user changes API Key - if (form.getValues("model")) { - form.setValue("model", ""); - } - }} - /> - - - Your API key for authentication - - - - )} - /> - )} + ( + + API Key + + { + field.onChange(e); + // Reset model when user changes API Key + if (form.getValues("model")) { + form.setValue("model", ""); + } + }} + /> + + + Your API key for authentication + + + + )} + /> {isLoadingServerModels && ( diff --git a/packages/server/src/utils/ai/select-ai-provider.ts b/packages/server/src/utils/ai/select-ai-provider.ts index 52d7c62249..84be6790e6 100644 --- a/packages/server/src/utils/ai/select-ai-provider.ts +++ b/packages/server/src/utils/ai/select-ai-provider.ts @@ -74,8 +74,8 @@ export function selectAIProvider(config: { apiUrl: string; apiKey: string }) { }); case "ollama": return createOllama({ - // optional settings, e.g. baseURL: config.apiUrl, + apiKey: config.apiKey, }); case "deepinfra": return createDeepInfra({