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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(ui): keep completion-mode models in the playground chat dropdown (#37954)
yuneng-jiang1c421f3578f1
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/chat_ui/EndpointUtils.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/chat_ui/EndpointUtils.test.tsxindex 778effdaea6..c528071fa8a 100644--- a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/chat_ui/EndpointUtils.test.tsx+++ b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/chat_ui/EndpointUtils.test.tsx@@ -247,6 +247,13 @@ describe("isModelCompatibleWithEndpoint / filterModelsForEndpoint", () => {expect(isModelCompatibleWithEndpoint(batchModel, EndpointType.REALTIME)).toBe(false);});+ it("keeps completion-mode models for the chat endpoint", () => {+ const completionModel: ModelGroup = { model_group: "davinci-002", mode: "completion" };+ expect(isModelCompatibleWithEndpoint(completionModel, EndpointType.CHAT)).toBe(true);+ expect(isModelCompatibleWithEndpoint(completionModel, EndpointType.RESPONSES)).toBe(true);+ expect(isModelCompatibleWithEndpoint(completionModel, EndpointType.SPEECH)).toBe(false);+ });+it("keeps image-edit models for the image-edits endpoint using the mode the backend sends", () => {const imageEditModel: ModelGroup = { model_group: "gpt-image-1", mode: "image_edit" };const imageModel: ModelGroup = { model_group: "dall-e-3", mode: "image_generation" };diff --git a/ui/litellm-dashboard/src/components/chat_ui/mode_endpoint_mapping.tsx b/ui/litellm-dashboard/src/components/chat_ui/mode_endpoint_mapping.tsxindex 18e44e06efe..930ded5d1a5 100644--- a/ui/litellm-dashboard/src/components/chat_ui/mode_endpoint_mapping.tsx+++ b/ui/litellm-dashboard/src/components/chat_ui/mode_endpoint_mapping.tsx@@ -7,6 +7,7 @@ export enum ModelMode {IMAGE_GENERATION = "image_generation",VIDEO_GENERATION = "video_generation",CHAT = "chat",+ COMPLETION = "completion",RESPONSES = "responses",IMAGE_EDITS = "image_edit",ANTHROPIC_MESSAGES = "anthropic_messages",@@ -36,6 +37,7 @@ export const litellmModeMapping: Record<ModelMode, EndpointType> = {[ModelMode.IMAGE_GENERATION]: EndpointType.IMAGE,[ModelMode.VIDEO_GENERATION]: EndpointType.VIDEO,[ModelMode.CHAT]: EndpointType.CHAT,+ [ModelMode.COMPLETION]: EndpointType.CHAT,[ModelMode.RESPONSES]: EndpointType.RESPONSES,[ModelMode.IMAGE_EDITS]: EndpointType.IMAGE_EDITS,[ModelMode.ANTHROPIC_MESSAGES]: EndpointType.ANTHROPIC_MESSAGES,