diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_provider_fields.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_provider_fields.tsx index 2bc381c8e8..7e9568c04d 100644 --- a/ui/litellm-dashboard/src/components/guardrails/guardrail_provider_fields.tsx +++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_provider_fields.tsx @@ -157,10 +157,10 @@ const GuardrailProviderFields: React.FC = ({ ); } - const percentageInitialValue = - field.type === "percentage" && (fieldValue === undefined || fieldValue === null) - ? (field.default_value ?? 0.5) - : undefined; + const resolvedInitialValue = + fieldValue !== undefined + ? fieldValue + : (field.default_value ?? (field.type === "percentage" ? 0.5 : undefined)); return ( = ({ label={fieldKey} tooltip={field.description} rules={field.required ? [{ required: true, message: `${fieldKey} is required` }] : undefined} - initialValue={percentageInitialValue} + initialValue={resolvedInitialValue} > {field.type === "select" && field.options ? ( ) : field.type === "bool" || field.type === "boolean" ? ( - + True + False ) : field.type === "percentage" && field.min != null && field.max != null ? (