diff --git a/ui/litellm-dashboard/src/components/create_key_button.tsx b/ui/litellm-dashboard/src/components/create_key_button.tsx index 4a31a9b0f..3bb729fe6 100644 --- a/ui/litellm-dashboard/src/components/create_key_button.tsx +++ b/ui/litellm-dashboard/src/components/create_key_button.tsx @@ -128,6 +128,7 @@ const CreateKey: React.FC = ({ label="Key Name" name="key_alias" rules={[{ required: true, message: 'Please input a key name' }]} + help="required" > @@ -136,6 +137,7 @@ const CreateKey: React.FC = ({ name="team_id" initialValue={team ? team["team_id"] : null} valuePropName="team_id" + className="mt-8" > @@ -153,25 +155,69 @@ const CreateKey: React.FC = ({ ))} - + { + if (value && team && team.max_budget !== null && value > team.max_budget) { + throw new Error(`Budget cannot exceed team max budget: $${team.max_budget}`); + } + }, + }, + ]} + > - + - + { + if (value && team && team.tpm_limit !== null && value > team.tpm_limit) { + throw new Error(`TPM limit cannot exceed team TPM limit: ${team.tpm_limit}`); + } + }, + }, + ]} + > { + if (value && team && team.rpm_limit !== null && value > team.rpm_limit) { + throw new Error(`RPM limit cannot exceed team RPM limit: ${team.rpm_limit}`); + } + }, + }, + ]} > - +