diff --git a/ui/litellm-dashboard/src/components/add_model/advanced_settings.tsx b/ui/litellm-dashboard/src/components/add_model/advanced_settings.tsx new file mode 100644 index 00000000000..f92b146b484 --- /dev/null +++ b/ui/litellm-dashboard/src/components/add_model/advanced_settings.tsx @@ -0,0 +1,123 @@ +import React from "react"; +import { Form, Switch } from "antd"; +import { Text, Button, Accordion, AccordionHeader, AccordionBody } from "@tremor/react"; +import { Row, Col, Typography, Card } from "antd"; +import TextArea from "antd/es/input/TextArea"; +const { Link } = Typography; + +interface AdvancedSettingsProps { + showAdvancedSettings: boolean; + setShowAdvancedSettings: (show: boolean) => void; +} + +const AdvancedSettings: React.FC = ({ + showAdvancedSettings, + setShowAdvancedSettings, +}) => { + const [form] = Form.useForm(); + + const handlePassThroughChange = (checked: boolean) => { + const currentParams = form.getFieldValue('litellm_extra_params'); + try { + let paramsObj = currentParams ? JSON.parse(currentParams) : {}; + if (checked) { + paramsObj.use_in_pass_through = true; + } else { + delete paramsObj.use_in_pass_through; + } + // Only set the field value if there are remaining parameters + if (Object.keys(paramsObj).length > 0) { + form.setFieldValue('litellm_extra_params', JSON.stringify(paramsObj, null, 2)); + } else { + form.setFieldValue('litellm_extra_params', ''); + } + } catch (error) { + // If JSON parsing fails, only create new object if checked is true + if (checked) { + form.setFieldValue('litellm_extra_params', JSON.stringify({ use_in_pass_through: true }, null, 2)); + } else { + form.setFieldValue('litellm_extra_params', ''); + } + } + }; + + return ( + <> + + + + + Advanced Settings + + +
+ + Allow using these credentials in pass through routes.{" "} + + Learn more + + + } + > + + + +