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 = ({