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(ui): resolve provider dropdown enum keys in getPlaceholder

mateo-berriea4316b24527
diff --git a/ui/litellm-dashboard/src/components/provider_info_helpers.test.tsx b/ui/litellm-dashboard/src/components/provider_info_helpers.test.tsx
index b9516945faa..b163a6b341c 100644
--- a/ui/litellm-dashboard/src/components/provider_info_helpers.test.tsx
+++ b/ui/litellm-dashboard/src/components/provider_info_helpers.test.tsx
@@ -237,6 +237,11 @@ describe("provider_info_helpers", () => {
expect(getPlaceholder(Providers.NVIDIA_RIVA)).toBe("nvidia_riva/nvidia/parakeet-ctc-1_1b-asr");
});
+ it("should resolve enum keys from the provider dropdown, not just enum values", () => {
+ expect(getPlaceholder("NVIDIA_RIVA")).toBe("nvidia_riva/nvidia/parakeet-ctc-1_1b-asr");
+ expect(getPlaceholder("WATSONX")).toBe("watsonx/ibm/granite-3-3-8b-instruct");
+ });
+
it("should return default gpt-3.5-turbo placeholder for unknown provider", () => {
expect(getPlaceholder("UnknownProvider" as any)).toBe("gpt-3.5-turbo");
});
diff --git a/ui/litellm-dashboard/src/components/provider_info_helpers.tsx b/ui/litellm-dashboard/src/components/provider_info_helpers.tsx
index 86d67867fcf..ae311070c07 100644
--- a/ui/litellm-dashboard/src/components/provider_info_helpers.tsx
+++ b/ui/litellm-dashboard/src/components/provider_info_helpers.tsx
@@ -426,8 +426,10 @@ const providerPlaceholderMap: Partial<Record<Providers, string>> = {
[Providers.ZAI]: "zai/glm-4.5",
};
-export const getPlaceholder = (selectedProvider: string): string =>
- providerPlaceholderMap[selectedProvider as Providers] ?? "gpt-3.5-turbo";
+export const getPlaceholder = (selectedProvider: string): string => {
+ const resolvedProvider = Providers[selectedProvider as keyof typeof Providers] ?? (selectedProvider as Providers);
+ return providerPlaceholderMap[resolvedProvider] ?? "gpt-3.5-turbo";
+};
export const getProviderModels = (provider: Providers, modelMap: any): Array<string> => {
let providerKey = provider;