Skip to content

Commit f119157

Browse files
authored
[Fix] UI - Fixed Label for vLLM in Model Create Flow (BerriAI#16285)
* Fixed Label for vLLM * Make vLLM api key not required
1 parent 2541a54 commit f119157

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

ui/litellm-dashboard/src/components/add_model/provider_specific_fields.test.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,22 @@ describe("ProviderSpecificFields", () => {
4444
expect(apiKeyLabel).toBeInTheDocument();
4545
});
4646
});
47+
48+
it("should render the provider specific fields for vLLM", async () => {
49+
const { getByLabelText, getByPlaceholderText } = render(
50+
<Form>
51+
<ProviderSpecificFields selectedProvider={"Hosted_Vllm" as Providers} />
52+
</Form>,
53+
);
54+
55+
await waitFor(() => {
56+
const apiBaseInput = getByPlaceholderText("https://...");
57+
expect(apiBaseInput).toBeInTheDocument();
58+
expect(apiBaseInput).toHaveAttribute("type", "text");
59+
60+
// Check for API Key field
61+
const apiKeyLabel = getByLabelText("vLLM API Key");
62+
expect(apiKeyLabel).toBeInTheDocument();
63+
});
64+
});
4765
});

ui/litellm-dashboard/src/components/add_model/provider_specific_fields.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,9 @@ const PROVIDER_CREDENTIAL_FIELDS: Record<Providers, ProviderCredentialField[]> =
507507
},
508508
{
509509
key: "api_key",
510-
label: "OpenAI API Key",
510+
label: "vLLM API Key",
511511
type: "password",
512-
required: true,
512+
required: false,
513513
},
514514
],
515515
[Providers.Voyage]: [
@@ -581,7 +581,7 @@ const PROVIDER_CREDENTIAL_FIELDS: Record<Providers, ProviderCredentialField[]> =
581581
label: "API Key",
582582
type: "password",
583583
required: true,
584-
}
584+
},
585585
],
586586
};
587587

ui/litellm-dashboard/src/components/chat_ui/CodeSnippets.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface GenerateCodeParams {
1717
selectedVectorStores: string[];
1818
selectedGuardrails: string[];
1919
selectedMCPTools: string[];
20-
selectedVoice: string;
20+
selectedVoice?: string;
2121
endpointType: string;
2222
selectedModel: string | undefined;
2323
selectedSdk: "openai" | "azure";

0 commit comments

Comments
 (0)