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: ensure Ant Design notification instance is initialized only once using `useRef`.

Swayambhueee37c569dda
diff --git a/ui/litellm-dashboard/src/contexts/AntdGlobalProvider.tsx b/ui/litellm-dashboard/src/contexts/AntdGlobalProvider.tsx
index b10aa715ed5..c5adbff86b2 100644
--- a/ui/litellm-dashboard/src/contexts/AntdGlobalProvider.tsx
+++ b/ui/litellm-dashboard/src/contexts/AntdGlobalProvider.tsx
@@ -1,15 +1,19 @@
"use client";
-import React, { useEffect } from "react";
+import React, { useEffect, useRef } from "react";
import { App } from "antd";
import { setNotificationInstance } from "@/components/molecules/notifications_manager";
// Inner component to use the hook
const AntdAppInit = () => {
const { notification } = App.useApp();
+ const initialized = useRef(false);
useEffect(() => {
- setNotificationInstance(notification);
+ if (!initialized.current) {
+ setNotificationInstance(notification);
+ initialized.current = true;
+ }
}, [notification]);
return null;