From 518934f928ae213b4f224136874ec2840788ce58 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 13:31:14 +0000 Subject: [PATCH] feat(ui): cache_control_settings \u2014 antd Typography/@ant-design icons - antd Typography.Text \u2192 plain

with text-muted-foreground. - @ant-design PlusOutlined / MinusCircleOutlined \u2192 lucide Plus / MinusCircle. - bg-gray-600 / text-red-500 \u2192 semantic tokens + destructive. antd Form / Form.List / Switch / Select remain since the parent form is antd-driven. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../add_model/cache_control_settings.tsx | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/ui/litellm-dashboard/src/components/add_model/cache_control_settings.tsx b/ui/litellm-dashboard/src/components/add_model/cache_control_settings.tsx index 13e6dc33057..dfa38db3c47 100644 --- a/ui/litellm-dashboard/src/components/add_model/cache_control_settings.tsx +++ b/ui/litellm-dashboard/src/components/add_model/cache_control_settings.tsx @@ -1,10 +1,8 @@ import React from "react"; -import { Form, Switch, Select, Typography } from "antd"; -import { PlusOutlined, MinusCircleOutlined } from "@ant-design/icons"; +import { Form, Switch, Select } from "antd"; +import { MinusCircle, Plus } from "lucide-react"; import NumericalInput from "../shared/numerical_input"; -const { Text } = Typography; - interface CacheControlInjectionPoint { location: "message"; role?: "user" | "system" | "assistant"; @@ -12,7 +10,9 @@ interface CacheControlInjectionPoint { } interface CacheControlSettingsProps { - form: any; // Form instance from parent + // Form instance from parent (antd Form) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + form: any; showCacheControl: boolean; onCacheControlChange: (checked: boolean) => void; } @@ -50,15 +50,16 @@ const CacheControlSettings: React.FC = ({ className="mb-4" tooltip="Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index." > - + {showCacheControl && ( -

- - Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, - litellm can automatically add them for you as a cost saving feature. - +
+

+ Providers like Anthropic, Bedrock API require users to specify + where to inject cache control checkpoints, litellm can + automatically add them for you as a cost saving feature. +

{(fields, { add, remove }) => ( @@ -119,16 +120,22 @@ const CacheControlSettings: React.FC = ({ {fields.length > 1 && ( - { remove(field.name); setTimeout(() => { - const values = form.getFieldValue("cache_control_points"); + const values = form.getFieldValue( + "cache_control_points", + ); updateCacheControlPoints(values); }, 0); }} - /> + > + + )}
))} @@ -136,10 +143,10 @@ const CacheControlSettings: React.FC = ({