Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix params to test connection

Ishaan Jaff68fd735e97b1
diff --git a/ui/litellm-dashboard/src/components/add_model/ConnectionErrorDisplay.tsx b/ui/litellm-dashboard/src/components/add_model/ConnectionErrorDisplay.tsx
index f52c3b7df0b..a46a1b5cfad 100644
--- a/ui/litellm-dashboard/src/components/add_model/ConnectionErrorDisplay.tsx
+++ b/ui/litellm-dashboard/src/components/add_model/ConnectionErrorDisplay.tsx
@@ -45,10 +45,9 @@ const ConnectionErrorDisplay: React.FC<ConnectionErrorDisplayProps> = ({
console.log("result from prepareModelAddRequest:", result);
const { litellmParamsObj, modelInfoObj, modelName: returnedModelName } = result;
- const requestBody = { ...litellmParamsObj, mode: testMode };
- const response = await testConnectionRequest(accessToken, requestBody);
+ const response = await testConnectionRequest(accessToken, litellmParamsObj, modelInfoObj?.mode);
if (response.status === "success") {
message.success("Connection test successful!");
setError(null);
@@ -56,7 +55,7 @@ const ConnectionErrorDisplay: React.FC<ConnectionErrorDisplayProps> = ({
} else {
const errorMessage = response.result?.error || response.message || "Unknown error";
setError(errorMessage);
- setRawRequest(requestBody);
+ setRawRequest(litellmParamsObj);
setRawResponse(response.result?.raw_request_typed_dict);
setIsSuccess(false);
}
diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx
index 81b9bb93e0d..bb06608b117 100644
--- a/ui/litellm-dashboard/src/components/networking.tsx
+++ b/ui/litellm-dashboard/src/components/networking.tsx
@@ -2276,10 +2276,11 @@ export const keyInfoCall = async (accessToken: String, keys: String[]) => {
export const testConnectionRequest = async (
accessToken: string,
- requestBody: Record<string, any>
+ litellm_params: Record<string, any>,
+ mode: string,
) => {
try {
- console.log("Sending model connection test request:", JSON.stringify(requestBody));
+ console.log("Sending model connection test request:", JSON.stringify(litellm_params));
// Construct the URL based on environment
const url = proxyBaseUrl ? `${proxyBaseUrl}/health/test_connection` : `/health/test_connection`;
@@ -2292,7 +2293,8 @@ export const testConnectionRequest = async (
},
body: JSON.stringify(
{
- litellm_params: requestBody
+ litellm_params: litellm_params,
+ mode: mode,
}
)
});