Skip to content

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]

fix(ui): drop null guardrail names from MultiSelect options

mubashir1osmanif2e3b6a5680e
diff --git a/ui/litellm-dashboard/src/components/guardrails/GuardrailSelector.tsx b/ui/litellm-dashboard/src/components/guardrails/GuardrailSelector.tsx
index b8abc484588..830dd4c9b1f 100644
--- a/ui/litellm-dashboard/src/components/guardrails/GuardrailSelector.tsx
+++ b/ui/litellm-dashboard/src/components/guardrails/GuardrailSelector.tsx
@@ -48,11 +48,12 @@ const GuardrailSelector: React.FC<GuardrailSelectorProps> = ({ onChange, value,
value={value}
loading={loading}
className={className}
- options={guardrails.map((guardrail) => {
- return {
- label: `${guardrail.guardrail_name}`,
- value: guardrail.guardrail_name,
- };
+ options={guardrails.flatMap((guardrail) => {
+ const name = guardrail.guardrail_name;
+ if (name == null || name === "") {
+ return [];
+ }
+ return [{ label: name, value: name }];
})}
/>
</div>