diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index 1aed68b09fb..8c07d2a2e02 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -2,4 +2,16 @@ model_list: - model_name: amazon.nova-canvas-v1:0 litellm_params: model: bedrock/amazon.nova-canvas-v1:0 - aws_region_name: "us-east-1" \ No newline at end of file + aws_region_name: "us-east-1" + +credential_list: + - credential_name: azure + credential_values: + api_key: os.environ/AZURE_API_KEY + api_base: os.environ/AZURE_API_BASE + credential_info: + description: "Azure API Key and Base URL" + type: "azure" + required: true + default: "azure" + diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index e7964445146..b417cf5d164 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -28,6 +28,7 @@ import CacheDashboard from "@/components/cache_dashboard"; import { setGlobalLitellmHeaderName } from "@/components/networking"; import { Organization } from "@/components/networking"; import GuardrailsPanel from "@/components/guardrails"; +import CredentialsPanel from "@/components/credentials"; import TransformRequestPanel from "@/components/transform_request"; import { fetchUserModels } from "@/components/create_key_button"; import { fetchTeams } from "@/components/common_components/fetch_teams"; @@ -312,6 +313,8 @@ export default function CreateKeyPage() { ) : page == "transform-request" ? ( + ) : page == "credentials" ? ( + ) : page == "general-settings" ? ( = ({ accessToken }) => { + const [credentialsList, setCredentialsList] = useState([]); + const [isAddModalOpen, setIsAddModalOpen] = useState(false); + + useEffect(() => { + if (!accessToken) { + return; + } + + const fetchCredentials = async () => { + try { + const response: CredentialsResponse = await getCredentialsList(accessToken); + console.log(`credentials: ${JSON.stringify(response)}`); + setCredentialsList(response.credentials); + } catch (error) { + console.error('Error fetching credentials:', error); + } + }; + fetchCredentials(); + }, [accessToken]); + + const renderProviderBadge = (provider: string) => { + const providerColors: Record = { + 'openai': 'blue', + 'azure': 'indigo', + 'anthropic': 'purple', + 'default': 'gray' + }; + + const color = providerColors[provider.toLowerCase()] || providerColors['default']; + return ( + + {provider} + + ); + }; + + return ( +
+
+ + Configured credentials for different AI providers. Add and manage your API credentials.{" "} + + Docs + + + +
+ + + + + + Credential Name + Provider + Description + Required + + + + {(!credentialsList || credentialsList.length === 0) ? ( + + + No credentials configured + + + ) : ( + credentialsList.map((credential: CredentialItem, index: number) => ( + + {credential.credential_name} + + {renderProviderBadge(credential.provider)} + + {credential.credential_info.description || '-'} + +
+ {credential.credential_info.required ? 'Required' : 'Optional'} +
+
+
+ )) + )} +
+
+
+ + {/* TODO: Implement Add Credential Modal */} + {isAddModalOpen && ( +
+ {/* Modal content for adding credentials */} +
+ )} +
+ ); +}; + +export default CredentialsPanel; \ No newline at end of file diff --git a/ui/litellm-dashboard/src/components/leftnav.tsx b/ui/litellm-dashboard/src/components/leftnav.tsx index 5990a50f9e5..46540401a94 100644 --- a/ui/litellm-dashboard/src/components/leftnav.tsx +++ b/ui/litellm-dashboard/src/components/leftnav.tsx @@ -20,6 +20,7 @@ import { SafetyOutlined, ExperimentOutlined, ThunderboltOutlined, + LockOutlined } from '@ant-design/icons'; import { old_admin_roles, v2_admin_role_names, all_admin_roles, rolesAllowedToSeeUsage, rolesWithWriteAccess } from '../utils/roles'; @@ -68,6 +69,7 @@ const menuItems: MenuItem[] = [ { key: "10", page: "budgets", label: "Budgets", icon: , roles: all_admin_roles }, { key: "11", page: "guardrails", label: "Guardrails", icon: , roles: all_admin_roles }, { key: "18", page: "transform-request", label: "Playground", icon: , roles: all_admin_roles }, + { key: "19", page: "credentials", label: "Credentials", icon: , roles: all_admin_roles }, ] }, {