diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/panels/AddModelPanel.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/panels/AddModelPanel.integration.test.tsx index efba26734ff..19e1e3aa8bd 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/panels/AddModelPanel.integration.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/panels/AddModelPanel.integration.test.tsx @@ -87,6 +87,7 @@ const alwaysMounted = { api_key: undefined, api_base: undefined, custom_llm_provider: "openai", + litellm_credential_name: null, model: "gpt-4o", }; diff --git a/ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.test.tsx b/ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.test.tsx index 2aa8f93b72b..7ef09d34924 100644 --- a/ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.test.tsx +++ b/ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.test.tsx @@ -73,28 +73,4 @@ describe("prepareModelAddRequest", () => { expect(deployment.litellmParamsObj.litellm_credential_name).toBe("selected-credential"); expect(deployment.litellmParamsObj.timeout).toBe(5); }); - - it("keeps litellm_credential_name from LiteLLM Params JSON when no credential is selected", async () => { - const formValues = { - model_mappings: [ - { - public_name: "Public Model", - litellm_model: "litellm/public", - }, - ], - model_name: "custom-model-name", - litellm_extra_params: JSON.stringify({ - litellm_credential_name: "from-json", - timeout: 5, - }), - litellm_credential_name: null, - }; - - const deployments = await prepareModelAddRequest({ ...formValues }, "token", null); - - expect(deployments).toHaveLength(1); - const [deployment] = deployments!; - expect(deployment.litellmParamsObj.litellm_credential_name).toBe("from-json"); - expect(deployment.litellmParamsObj.timeout).toBe(5); - }); }); diff --git a/ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.tsx b/ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.tsx index b4ae51d5423..bb2f78fa84e 100644 --- a/ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.tsx +++ b/ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.tsx @@ -91,9 +91,6 @@ export const prepareModelAddRequest = async (formValues: Record, ac if (value === "") { continue; } - if (key === "litellm_credential_name" && value == null) { - continue; - } // Skip the custom_pricing and pricing_model fields as they're only used for UI control if (key === "custom_pricing" || key === "pricing_model" || key === "cache_control") { continue; @@ -127,7 +124,7 @@ export const prepareModelAddRequest = async (formValues: Record, ac if (value && value != undefined) { try { litellmExtraParams = JSON.parse(value); - if ("litellm_credential_name" in litellmExtraParams && formValues.litellm_credential_name) { + if ("litellm_credential_name" in litellmExtraParams) { delete litellmExtraParams.litellm_credential_name; } } catch (error) {