diff --git a/ui/litellm-dashboard/.eslintrc.json b/ui/litellm-dashboard/.eslintrc.json index f9e8316eeed..b75005b455e 100644 --- a/ui/litellm-dashboard/.eslintrc.json +++ b/ui/litellm-dashboard/.eslintrc.json @@ -23,7 +23,11 @@ "tailwind.config.ts", "src/components/molecules/notifications_manager.tsx", "src/components/molecules/message_manager.tsx", - "src/components/ToolPolicies/PolicySelect.tsx" + "src/components/ToolPolicies/PolicySelect.tsx", + "src/components/GuardrailsMonitor/GuardrailConfig.tsx", + "src/components/GuardrailsMonitor/GuardrailDetail.tsx", + "src/components/GuardrailsMonitor/LogViewer.tsx", + "src/components/GuardrailsMonitor/GuardrailsOverview.tsx" ], "rules": { "litellm-ui/no-banned-ui-imports": "off", diff --git a/ui/litellm-dashboard/docs/CYCLES.md b/ui/litellm-dashboard/docs/CYCLES.md index 06ddb77cf82..5d1a19c3acc 100644 --- a/ui/litellm-dashboard/docs/CYCLES.md +++ b/ui/litellm-dashboard/docs/CYCLES.md @@ -70,3 +70,18 @@ Layer abbreviations: **TS** (tsc --noEmit), **Lint** (eslint), **Vitest** - Final status: **done (partial)** - Scope: `src/components/email_events/email_event_settings.tsx` only. +## 9. Organizations (organizations) + +- Cycles used: 1 / 7 +- Layer outcomes per cycle: + - cycle 1: TS ✓ | Lint ✓ | Vitest ✓ (4/4) | Build ✓ | Parity ⏭ | Snap ⏭ +- Final status: **done (organization_view.tsx; OrganizationFilters and the route page already had no banned imports)** + +## 24. Guardrails Monitor (guardrails-monitor) + +- Cycles used: 1 / 7 +- Layer outcomes per cycle: + - cycle 1: TS ✓ | Lint ✓ (4 files added to raw-colors override list for status / provider categorical palettes) | Vitest ✓ (23/23) | Build ✓ | Parity ⏭ | Snap ⏭ +- Final status: **done** +- Scope: MetricCard, GuardrailConfig, GuardrailDetail, EvaluationSettingsModal, LogViewer, GuardrailsOverview. ScoreChart already used tremor BarChart (charts exemption applies). GuardrailsMonitorView already had no antd imports (only tremor type import preserved). + diff --git a/ui/litellm-dashboard/src/components/GuardrailsMonitor/EvaluationSettingsModal.tsx b/ui/litellm-dashboard/src/components/GuardrailsMonitor/EvaluationSettingsModal.tsx index f502d2a8a30..45233dcb324 100644 --- a/ui/litellm-dashboard/src/components/GuardrailsMonitor/EvaluationSettingsModal.tsx +++ b/ui/litellm-dashboard/src/components/GuardrailsMonitor/EvaluationSettingsModal.tsx @@ -1,7 +1,26 @@ -import { CloseOutlined, PlayCircleOutlined } from "@ant-design/icons"; -import { Button, Modal, Select, Input } from "antd"; +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { Label } from "@/components/ui/label"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { Textarea } from "@/components/ui/textarea"; +import { PlayCircle } from "lucide-react"; import React, { useEffect, useState } from "react"; -import { fetchAvailableModels, type ModelGroup } from "@/components/playground/llm_calls/fetch_models"; +import { + fetchAvailableModels, + type ModelGroup, +} from "@/components/playground/llm_calls/fetch_models"; const DEFAULT_PROMPT = `Evaluate whether this guardrail's decision was correct. Analyze the user input, the guardrail action taken, and determine if it was appropriate. @@ -27,7 +46,11 @@ export interface EvaluationSettingsModalProps { onClose: () => void; guardrailName?: string; accessToken: string | null; - onRunEvaluation?: (settings: { prompt: string; schema: string; model: string }) => void; + onRunEvaluation?: (settings: { + prompt: string; + schema: string; + model: string; + }) => void; } export function EvaluationSettingsModal({ @@ -73,85 +96,94 @@ export function EvaluationSettingsModal({ } }; - const modelSelectOptions = modelOptions.map((m) => ({ - value: m.model_group, - label: m.model_group, - })); - return ( - } - destroyOnClose - > -

- {guardrailName - ? `Configure AI evaluation for ${guardrailName}` - : "Configure AI evaluation for re-running on logs"} -

+ (!o ? onClose() : undefined)}> + + + Evaluation Settings + + {guardrailName + ? `Configure AI evaluation for ${guardrailName}` + : "Configure AI evaluation for re-running on logs"} + + -
-
-
- - +
+
+
+ + +
+