diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_card.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_card.tsx index dd142a96d8..1b9e163804 100644 --- a/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_card.tsx +++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_card.tsx @@ -2,6 +2,41 @@ import React, { useState } from "react"; import { CheckCircleFilled } from "@ant-design/icons"; import { GuardrailCardInfo } from "./guardrail_garden_data"; +const LogoWithFallback: React.FC<{ src: string; name: string }> = ({ src, name }) => { + const [hasError, setHasError] = useState(false); + + if (hasError || !src) { + return ( +
+ {name?.charAt(0) || "?"} +
+ ); + } + + return ( + setHasError(true)} + /> + ); +}; + const GuardrailCard: React.FC<{ card: GuardrailCardInfo; onClick: () => void }> = ({ card, onClick }) => { const [hovered, setHovered] = useState(false); @@ -25,12 +60,7 @@ const GuardrailCard: React.FC<{ card: GuardrailCardInfo; onClick: () => void }> > {/* Icon + Name row */}
- { (e.target as HTMLImageElement).style.display = "none"; }} - /> + {card.name}
diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_data.ts b/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_data.ts index 372d5b259b..2535bd1950 100644 --- a/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_data.ts +++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_data.ts @@ -16,7 +16,7 @@ export interface GuardrailCardInfo { providerKey?: string; } -const ASSET_PREFIX = "../assets/logos/"; +const ASSET_PREFIX = "../ui/assets/logos/"; export const LITELLM_CONTENT_FILTER_CARDS: GuardrailCardInfo[] = [ { @@ -35,6 +35,22 @@ export const LITELLM_CONTENT_FILTER_CARDS: GuardrailCardInfo[] = [ latency: "<0.1ms", }, }, + { + id: "cf_denied_insults", + name: "Insults & Personal Attacks", + description: "Detects insults, name-calling, and personal attacks directed at the chatbot, staff, or other people.", + category: "litellm", + subcategory: "Content Category", + logo: `${ASSET_PREFIX}litellm_logo.jpg`, + tags: ["Content Category", "Topic Blocker"], + eval: { + f1: 100.0, + precision: 100.0, + recall: 100.0, + testCases: 299, + latency: "<0.1ms", + }, + }, { id: "cf_denied_legal", name: "Denied Legal Advice", @@ -170,22 +186,6 @@ export const LITELLM_CONTENT_FILTER_CARDS: GuardrailCardInfo[] = [ logo: `${ASSET_PREFIX}litellm_logo.jpg`, tags: ["Content Category", "Prompt Injection"], }, - { - id: "cf_denied_insults", - name: "Insults & Personal Attacks", - description: "Detects insults, name-calling, and personal attacks directed at the chatbot, staff, or other people.", - category: "litellm", - subcategory: "Content Category", - logo: `${ASSET_PREFIX}litellm_logo.jpg`, - tags: ["Content Category", "Topic Blocker"], - eval: { - f1: 100.0, - precision: 100.0, - recall: 100.0, - testCases: 299, - latency: "<0.1ms", - }, - }, { id: "cf_toxic_abuse", name: "Toxic & Abusive Language", @@ -221,7 +221,7 @@ export const PARTNER_GUARDRAIL_CARDS: GuardrailCardInfo[] = [ name: "Presidio PII", description: "Microsoft Presidio for PII detection and anonymization. Supports 30+ entity types with configurable actions.", category: "partner", - logo: `${ASSET_PREFIX}presidio.png`, + logo: `${ASSET_PREFIX}microsoft_azure.svg`, tags: ["PII", "Microsoft"], providerKey: "PresidioPII", }, diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx index bde21661d8..040ef518e5 100644 --- a/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx +++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx @@ -105,11 +105,11 @@ const asset_logos_folder = "../ui/assets/logos/"; export const guardrailLogoMap: Record = { "Zscaler AI Guard": `${asset_logos_folder}zscaler.svg`, - "Presidio PII": `${asset_logos_folder}presidio.png`, + "Presidio PII": `${asset_logos_folder}microsoft_azure.svg`, "Bedrock Guardrail": `${asset_logos_folder}bedrock.svg`, Lakera: `${asset_logos_folder}lakeraai.jpeg`, - "Azure Content Safety Prompt Shield": `${asset_logos_folder}presidio.png`, - "Azure Content Safety Text Moderation": `${asset_logos_folder}presidio.png`, + "Azure Content Safety Prompt Shield": `${asset_logos_folder}microsoft_azure.svg`, + "Azure Content Safety Text Moderation": `${asset_logos_folder}microsoft_azure.svg`, "Aporia AI": `${asset_logos_folder}aporia.png`, "PANW Prisma AIRS": `${asset_logos_folder}palo_alto_networks.jpeg`, "Noma Security": `${asset_logos_folder}noma_security.png`,