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): pre-select backend default for boolean guardrail provider fields
Ryan Crabbe6da4e0b9018f
diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_provider_fields.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_provider_fields.tsxindex 2bc381c8e8f..7e9568c04d5 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<GuardrailProviderFieldsProps> = ({);}- 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 (<Form.Item@@ -169,7 +169,7 @@ const GuardrailProviderFields: React.FC<GuardrailProviderFieldsProps> = ({label={fieldKey}tooltip={field.description}rules={field.required ? [{ required: true, message: `${fieldKey} is required` }] : undefined}- initialValue={percentageInitialValue}+ initialValue={resolvedInitialValue}>{field.type === "select" && field.options ? (<Select placeholder={field.description} defaultValue={fieldValue || field.default_value}>@@ -188,12 +188,9 @@ const GuardrailProviderFields: React.FC<GuardrailProviderFieldsProps> = ({))}</Select>) : field.type === "bool" || field.type === "boolean" ? (- <Select- placeholder={field.description}- defaultValue={fieldValue !== undefined ? String(fieldValue) : field.default_value}- >- <Select.Option value="true">True</Select.Option>- <Select.Option value="false">False</Select.Option>+ <Select placeholder={field.description}>+ <Select.Option value={true}>True</Select.Option>+ <Select.Option value={false}>False</Select.Option></Select>) : field.type === "percentage" && field.min != null && field.max != null ? (<Slider