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]

fixing build

yuneng-jiangee1fd1c6c2a4
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/policies/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/policies/page.tsx
index 86e063c7358..c1f6ec51d78 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/policies/page.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/policies/page.tsx
@@ -2,17 +2,6 @@
import PoliciesPanel from "@/components/policies";
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
-import {
- getPoliciesList,
- createPolicyCall,
- updatePolicyCall,
- deletePolicyCall,
- getPolicyInfo,
- getPolicyAttachmentsList,
- createPolicyAttachmentCall,
- deletePolicyAttachmentCall,
- getGuardrailsList,
-} from "@/components/networking";
const PoliciesPage = () => {
const { accessToken, userRole } = useAuthorized();
@@ -21,15 +10,6 @@ const PoliciesPage = () => {
<PoliciesPanel
accessToken={accessToken}
userRole={userRole}
- getPoliciesList={getPoliciesList}
- createPolicy={createPolicyCall}
- updatePolicy={updatePolicyCall}
- deletePolicy={deletePolicyCall}
- getPolicy={getPolicyInfo}
- getAttachmentsList={getPolicyAttachmentsList}
- createAttachment={createPolicyAttachmentCall}
- deleteAttachment={deletePolicyAttachmentCall}
- getGuardrailsList={getGuardrailsList}
/>
);
};
diff --git a/ui/litellm-dashboard/src/components/playground/compareUI/CompareUI.tsx b/ui/litellm-dashboard/src/components/playground/compareUI/CompareUI.tsx
index 92bcb21c4b5..fa68851d690 100644
--- a/ui/litellm-dashboard/src/components/playground/compareUI/CompareUI.tsx
+++ b/ui/litellm-dashboard/src/components/playground/compareUI/CompareUI.tsx
@@ -619,6 +619,7 @@ export default function CompareUI({ accessToken, disabledPersonalKeyCreation }:
guardrails,
undefined,
undefined,
+ undefined,
(searchResults) => updateSearchResultsForComparison(prepared.id, searchResults),
useAdvancedParams ? prepared.temperature : undefined,
useAdvancedParams ? prepared.maxTokens : undefined,
diff --git a/ui/litellm-dashboard/src/components/policies/add_attachment_form.tsx b/ui/litellm-dashboard/src/components/policies/add_attachment_form.tsx
index 13b3b4ca41e..cb4912b7f0b 100644
--- a/ui/litellm-dashboard/src/components/policies/add_attachment_form.tsx
+++ b/ui/litellm-dashboard/src/components/policies/add_attachment_form.tsx
@@ -4,6 +4,7 @@ import { Button } from "@tremor/react";
import { Policy, PolicyAttachmentCreateRequest } from "./types";
import { teamListCall, keyInfoCall } from "../networking";
import NotificationsManager from "../molecules/notifications_manager";
+import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
const { Text } = Typography;
@@ -31,6 +32,7 @@ const AddAttachmentForm: React.FC<AddAttachmentFormProps> = ({
const [availableKeys, setAvailableKeys] = useState<string[]>([]);
const [isLoadingTeams, setIsLoadingTeams] = useState(false);
const [isLoadingKeys, setIsLoadingKeys] = useState(false);
+ const { userId, userRole } = useAuthorized();
useEffect(() => {
if (visible && accessToken) {
@@ -45,7 +47,7 @@ const AddAttachmentForm: React.FC<AddAttachmentFormProps> = ({
// Load teams
setIsLoadingTeams(true);
try {
- const teamsResponse = await teamListCall(accessToken);
+ const teamsResponse = await teamListCall(accessToken, userId, userRole);
if (teamsResponse?.data) {
const teamAliases = teamsResponse.data
.map((t: any) => t.team_alias)
@@ -61,7 +63,7 @@ const AddAttachmentForm: React.FC<AddAttachmentFormProps> = ({
// Load keys
setIsLoadingKeys(true);
try {
- const keysResponse = await keyInfoCall(accessToken, null, null);
+ const keysResponse = await keyInfoCall(accessToken, []);
if (keysResponse?.data) {
const keyAliases = keysResponse.data
.map((k: any) => k.key_alias)
diff --git a/ui/litellm-dashboard/src/components/policies/add_policy_form.tsx b/ui/litellm-dashboard/src/components/policies/add_policy_form.tsx
index 393ab4628dd..0b4f83a1611 100644
--- a/ui/litellm-dashboard/src/components/policies/add_policy_form.tsx
+++ b/ui/litellm-dashboard/src/components/policies/add_policy_form.tsx
@@ -5,6 +5,7 @@ import { Policy, PolicyCreateRequest, PolicyUpdateRequest } from "./types";
import { Guardrail } from "../guardrails/types";
import { getResolvedGuardrails, modelAvailableCall } from "../networking";
import NotificationsManager from "../molecules/notifications_manager";
+import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
const { Text } = Typography;
const { Option } = Select;
@@ -38,6 +39,7 @@ const AddPolicyForm: React.FC<AddPolicyFormProps> = ({
const [isLoadingResolved, setIsLoadingResolved] = useState(false);
const [modelConditionType, setModelConditionType] = useState<"model" | "regex">("model");
const [availableModels, setAvailableModels] = useState<string[]>([]);
+ const { userId, userRole } = useAuthorized();
const isEditing = !!editingPolicy;
@@ -47,7 +49,7 @@ const AddPolicyForm: React.FC<AddPolicyFormProps> = ({
// Detect if it's a regex pattern (contains *, ., [, ], etc.)
const isRegex = modelCondition && /[.*+?^${}()|[\]\\]/.test(modelCondition);
setModelConditionType(isRegex ? "regex" : "model");
-
+
form.setFieldsValue({
policy_name: editingPolicy.policy_name,
description: editingPolicy.description,
@@ -77,9 +79,9 @@ const AddPolicyForm: React.FC<AddPolicyFormProps> = ({
const loadAvailableModels = async () => {
if (!accessToken) return;
-
+
try {
- const response = await modelAvailableCall(accessToken, null, null, null);
+ const response = await modelAvailableCall(accessToken, userId, userRole);
if (response?.data) {
const models = response.data.map((m: any) => m.id || m.model_name).filter(Boolean);
setAvailableModels(models);
@@ -91,7 +93,7 @@ const AddPolicyForm: React.FC<AddPolicyFormProps> = ({
const loadResolvedGuardrails = async (policyId: string) => {
if (!accessToken) return;
-
+
setIsLoadingResolved(true);
try {
const data = await getResolvedGuardrails(accessToken, policyId);
@@ -132,7 +134,7 @@ const AddPolicyForm: React.FC<AddPolicyFormProps> = ({
const resolveParentGuardrails = (policy: Policy): string[] => {
let resolved = new Set<string>();
-
+
// If parent inherits, resolve recursively
if (policy.inherit) {
const grandparent = existingPolicies.find(p => p.policy_name === policy.inherit);
diff --git a/ui/litellm-dashboard/src/components/policies/index.tsx b/ui/litellm-dashboard/src/components/policies/index.tsx
index 5a137d704ad..4a1c2424890 100644
--- a/ui/litellm-dashboard/src/components/policies/index.tsx
+++ b/ui/litellm-dashboard/src/components/policies/index.tsx
@@ -14,6 +14,10 @@ import {
getPolicyAttachmentsList,
deletePolicyAttachmentCall,
getGuardrailsList,
+ getPolicyInfo,
+ createPolicyCall,
+ updatePolicyCall,
+ createPolicyAttachmentCall,
} from "../networking";
import {
Policy,
@@ -194,6 +198,7 @@ const PoliciesPanel: React.FC<PoliciesPanelProps> = ({
}}
accessToken={accessToken}
isAdmin={isAdmin}
+ getPolicy={getPolicyInfo}
/>
) : (
<PolicyTable
@@ -217,6 +222,8 @@ const PoliciesPanel: React.FC<PoliciesPanelProps> = ({
editingPolicy={editingPolicy}
existingPolicies={policiesList}
availableGuardrails={guardrailsList}
+ createPolicy={createPolicyCall}
+ updatePolicy={updatePolicyCall}
/>
<DeleteResourceModal
@@ -259,6 +266,7 @@ const PoliciesPanel: React.FC<PoliciesPanelProps> = ({
onSuccess={handleAttachmentSuccess}
accessToken={accessToken}
policies={policiesList}
+ createAttachment={createPolicyAttachmentCall}
/>
</TabPanel>
</TabPanels>
diff --git a/ui/litellm-dashboard/src/components/public_model_hub.tsx b/ui/litellm-dashboard/src/components/public_model_hub.tsx
index 6f95904e9f8..e751f4d65b8 100644
--- a/ui/litellm-dashboard/src/components/public_model_hub.tsx
+++ b/ui/litellm-dashboard/src/components/public_model_hub.tsx
@@ -1470,6 +1470,7 @@ const PublicModelHub: React.FC<PublicModelHubProps> = ({ accessToken, isEmbedded
selectedTags: [],
selectedVectorStores: [],
selectedGuardrails: [],
+ selectedPolicies: [],
selectedMCPServers: [],
endpointType: getEndpointType(selectedModel.mode || "chat"),
selectedModel: selectedModel.model_group,
@@ -1491,6 +1492,7 @@ const PublicModelHub: React.FC<PublicModelHubProps> = ({ accessToken, isEmbedded
selectedTags: [],
selectedVectorStores: [],
selectedGuardrails: [],
+ selectedPolicies: [],
selectedMCPServers: [],
endpointType: getEndpointType(selectedModel.mode || "chat"),
selectedModel: selectedModel.model_group,