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
switch off prod logs on ui
Ishaan Jaff896026c46819
diff --git a/ui/litellm-dashboard/src/components/admins.tsx b/ui/litellm-dashboard/src/components/admins.tsxindex af4a3bdd65c..5388393ba1e 100644--- a/ui/litellm-dashboard/src/components/admins.tsx+++ b/ui/litellm-dashboard/src/components/admins.tsx@@ -91,7 +91,7 @@ const AdminPanel: React.FC<AdminPanelProps> = ({>>(null);const isLocal = process.env.NODE_ENV === "development";- if (isLocal === true) {+ if (isLocal != true) {console.log = function() {};}const [baseUrl, setBaseUrl] = useState(diff --git a/ui/litellm-dashboard/src/components/chat_ui.tsx b/ui/litellm-dashboard/src/components/chat_ui.tsxindex e38c005c4be..8764dbb8c4b 100644--- a/ui/litellm-dashboard/src/components/chat_ui.tsx+++ b/ui/litellm-dashboard/src/components/chat_ui.tsx@@ -45,7 +45,7 @@ async function generateModelResponse() {// base url should be the current base_urlconst isLocal = process.env.NODE_ENV === "development";- if (isLocal === true) {+ if (isLocal != true) {console.log = function() {};}console.log("isLocal:", isLocal);diff --git a/ui/litellm-dashboard/src/components/create_user_button.tsx b/ui/litellm-dashboard/src/components/create_user_button.tsxindex 498d032f57c..dc8298d3801 100644--- a/ui/litellm-dashboard/src/components/create_user_button.tsx+++ b/ui/litellm-dashboard/src/components/create_user_button.tsx@@ -43,7 +43,7 @@ const Createuser: React.FC<CreateuserProps> = ({useState<InvitationLink | null>(null);const router = useRouter();const isLocal = process.env.NODE_ENV === "development";- if (isLocal === true) {+ if (isLocal != true) {console.log = function() {};}const [baseUrl, setBaseUrl] = useState(diff --git a/ui/litellm-dashboard/src/components/general_settings.tsx b/ui/litellm-dashboard/src/components/general_settings.tsxindex 1f7037b4985..f80ca203bae 100644--- a/ui/litellm-dashboard/src/components/general_settings.tsx+++ b/ui/litellm-dashboard/src/components/general_settings.tsx@@ -76,7 +76,7 @@ async function testFallbackModelResponse() {// base url should be the current base_urlconst isLocal = process.env.NODE_ENV === "development";- if (isLocal === true) {+ if (isLocal != true) {console.log = function() {};}console.log("isLocal:", isLocal);diff --git a/ui/litellm-dashboard/src/components/navbar.tsx b/ui/litellm-dashboard/src/components/navbar.tsxindex eba5cad78c5..4d1e387717c 100644--- a/ui/litellm-dashboard/src/components/navbar.tsx+++ b/ui/litellm-dashboard/src/components/navbar.tsx@@ -43,7 +43,7 @@ const Navbar: React.FC<NavbarProps> = ({// const userColors = require('./ui_colors.json') || {};const isLocal = process.env.NODE_ENV === "development";- if (isLocal === true) {+ if (isLocal != true) {console.log = function() {};}const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsxindex 7d68e7a9deb..d85f73c3af8 100644--- a/ui/litellm-dashboard/src/components/networking.tsx+++ b/ui/litellm-dashboard/src/components/networking.tsx@@ -5,7 +5,7 @@ import { message } from "antd";const isLocal = process.env.NODE_ENV === "development";const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;-if (isLocal === true) {+if (isLocal != true) {console.log = function() {};}diff --git a/ui/litellm-dashboard/src/components/request_model_access.tsx b/ui/litellm-dashboard/src/components/request_model_access.tsxindex c884d03b2c6..22fcafa4e41 100644--- a/ui/litellm-dashboard/src/components/request_model_access.tsx+++ b/ui/litellm-dashboard/src/components/request_model_access.tsx@@ -12,7 +12,11 @@ interface RequestAccessProps {accessToken: string;userID: string;}-+const isLocal = process.env.NODE_ENV === "development";+const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;+if (isLocal != true) {+ console.log = function() {};+}function onRequestAccess(formData: Record<string, any>): void {// This function does nothing for now}diff --git a/ui/litellm-dashboard/src/components/settings.tsx b/ui/litellm-dashboard/src/components/settings.tsxindex fe2735d4aa1..482cfdd735d 100644--- a/ui/litellm-dashboard/src/components/settings.tsx+++ b/ui/litellm-dashboard/src/components/settings.tsx@@ -34,6 +34,11 @@ import {import { Modal, Typography, Form, Input, Select, Button as Button2, message } from "antd";const { Title, Paragraph } = Typography;+const isLocal = process.env.NODE_ENV === "development";+const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;+if (isLocal != true) {+ console.log = function() {};+}import {getCallbacksCall,setCallbacksCall,diff --git a/ui/litellm-dashboard/src/components/teams.tsx b/ui/litellm-dashboard/src/components/teams.tsxindex 8b4b803b563..bd8a8d095f4 100644--- a/ui/litellm-dashboard/src/components/teams.tsx+++ b/ui/litellm-dashboard/src/components/teams.tsx@@ -36,6 +36,11 @@ import {Grid,} from "@tremor/react";import { CogIcon } from "@heroicons/react/outline";+const isLocal = process.env.NODE_ENV === "development";+const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;+if (isLocal != true) {+ console.log = function() {};+}interface TeamProps {teams: any[] | null;searchParams: any;diff --git a/ui/litellm-dashboard/src/components/usage.tsx b/ui/litellm-dashboard/src/components/usage.tsxindex 451eaefe674..15c991d80e1 100644--- a/ui/litellm-dashboard/src/components/usage.tsx+++ b/ui/litellm-dashboard/src/components/usage.tsx@@ -37,6 +37,12 @@ import {adminGlobalActivityPerModel,} from "./networking";import { start } from "repl";+console.log("process.env.NODE_ENV", process.env.NODE_ENV);+const isLocal = process.env.NODE_ENV === "development";+const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;+if (isLocal !== true) {+ console.log = function() {};+}interface UsagePageProps {accessToken: string | null;diff --git a/ui/litellm-dashboard/src/components/user_dashboard.tsx b/ui/litellm-dashboard/src/components/user_dashboard.tsxindex f8326054c11..61ec058475a 100644--- a/ui/litellm-dashboard/src/components/user_dashboard.tsx+++ b/ui/litellm-dashboard/src/components/user_dashboard.tsx@@ -17,7 +17,7 @@ import { useSearchParams, useRouter } from "next/navigation";import { jwtDecode } from "jwt-decode";import { Typography } from "antd";const isLocal = process.env.NODE_ENV === "development";-if (isLocal === true) {+if (isLocal != true) {console.log = function() {};}console.log("isLocal:", isLocal);diff --git a/ui/litellm-dashboard/src/components/view_key_table.tsx b/ui/litellm-dashboard/src/components/view_key_table.tsxindex 3add65503b3..93395c7ff11 100644--- a/ui/litellm-dashboard/src/components/view_key_table.tsx+++ b/ui/litellm-dashboard/src/components/view_key_table.tsx@@ -34,7 +34,11 @@ import {} from "antd";const { Option } = Select;-+const isLocal = process.env.NODE_ENV === "development";+const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;+if (isLocal != true) {+ console.log = function() {};+}interface EditKeyModalProps {visible: boolean;diff --git a/ui/litellm-dashboard/src/components/view_user_spend.tsx b/ui/litellm-dashboard/src/components/view_user_spend.tsxindex 326dedee958..7879dfdb570 100644--- a/ui/litellm-dashboard/src/components/view_user_spend.tsx+++ b/ui/litellm-dashboard/src/components/view_user_spend.tsx@@ -23,7 +23,11 @@ import {} from "@tremor/react";import { Statistic } from "antd"import { spendUsersCall, modelAvailableCall } from "./networking";-+const isLocal = process.env.NODE_ENV === "development";+const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;+if (isLocal != true) {+ console.log = function() {};+}// Define the props typeinterface UserSpendData {diff --git a/ui/litellm-dashboard/src/components/view_user_team.tsx b/ui/litellm-dashboard/src/components/view_user_team.tsxindex cbc58e5f709..483420ccc02 100644--- a/ui/litellm-dashboard/src/components/view_user_team.tsx+++ b/ui/litellm-dashboard/src/components/view_user_team.tsx@@ -21,7 +21,11 @@ import {} from "@tremor/react";import { Statistic } from "antd"import { modelAvailableCall } from "./networking";-+const isLocal = process.env.NODE_ENV === "development";+const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;+if (isLocal != true) {+ console.log = function() {};+}interface ViewUserTeamProps {userID: string | null;diff --git a/ui/litellm-dashboard/src/components/view_users.tsx b/ui/litellm-dashboard/src/components/view_users.tsxindex 6b1deee6efd..75d2b2656ae 100644--- a/ui/litellm-dashboard/src/components/view_users.tsx+++ b/ui/litellm-dashboard/src/components/view_users.tsx@@ -52,6 +52,11 @@ interface ViewUserDashboardProps {teams: any[] | null;setKeys: React.Dispatch<React.SetStateAction<Object[] | null>>;}+const isLocal = process.env.NODE_ENV === "development";+const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;+if (isLocal != true) {+ console.log = function() {};+}const ViewUserDashboard: React.FC<ViewUserDashboardProps> = ({accessToken,