From 1dc0a2afa17646d4ce6188c95f26473c1d266713 Mon Sep 17 00:00:00 2001 From: Bytechoreographer Date: Thu, 16 Apr 2026 16:34:15 +0800 Subject: [PATCH] fix(ui): updateProxyBaseUrl hardcoded localhost:4000 overwrites NEXT_PUBLIC_LITELLM_PROXY_URL updateProxyBaseUrl had its own copy of the localhost:4000 fallback. When getUiConfig received proxy_base_url=null from the backend it used that hardcoded value, immediately overwriting the correct URL set via NEXT_PUBLIC_LITELLM_PROXY_URL. Fix: use the module-level defaultProxyBaseUrl (which already respects NEXT_PUBLIC_LITELLM_PROXY_URL) as the fallback inside updateProxyBaseUrl. Also remove the dead Form.useForm() instance in CredentialsPanel that was never connected to any
, causing the Ant Design "Instance created by useForm is not connected" console warning. Co-Authored-By: Claude Sonnet 4 (1M context) --- .../src/components/model_add/credentials.tsx | 2 -- ui/litellm-dashboard/src/components/networking.tsx | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ui/litellm-dashboard/src/components/model_add/credentials.tsx b/ui/litellm-dashboard/src/components/model_add/credentials.tsx index eb96e1f0ff1..41a5ae601bb 100644 --- a/ui/litellm-dashboard/src/components/model_add/credentials.tsx +++ b/ui/litellm-dashboard/src/components/model_add/credentials.tsx @@ -17,7 +17,6 @@ import { TableRow, Text, } from "@tremor/react"; -import { Form } from "antd"; import { UploadProps } from "antd/es/upload"; import { useState } from "react"; import DeleteResourceModal from "../common_components/DeleteResourceModal"; @@ -43,7 +42,6 @@ const CredentialsPanel: React.FC = ({ uploadProps }) => { const [credentialToDelete, setCredentialToDelete] = useState(null); const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [isCredentialDeleting, setIsCredentialDeleting] = useState(false); - const [form] = Form.useForm(); const restrictedFields = ["credential_name", "custom_llm_provider"]; const handleUpdateCredential = async (values: any) => { diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index b235c75ed2e..f5551612100 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -126,10 +126,7 @@ const updateProxyBaseUrl = (serverRootPath: string, receivedProxyBaseUrl: string return; } const browserLocation = getWindowLocation(); - const resolvedDefaultProxyBaseUrl = - isLocal && process.env.NEXT_PUBLIC_USE_REWRITES !== "true" - ? "http://localhost:4000" - : browserLocation?.origin ?? null; + const resolvedDefaultProxyBaseUrl = defaultProxyBaseUrl ?? browserLocation?.origin ?? null; let initialProxyBaseUrl = receivedProxyBaseUrl || resolvedDefaultProxyBaseUrl; console.log("proxyBaseUrl:", proxyBaseUrl); console.log("serverRootPath:", serverRootPath);