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(ui): require TPM or RPM when adding a per-model team rate limit

Ryan Crabbef0bbd415c8ca
diff --git a/ui/litellm-dashboard/src/components/team/TeamInfo.tsx b/ui/litellm-dashboard/src/components/team/TeamInfo.tsx
index 346686d0193..bc54cac9cc7 100644
--- a/ui/litellm-dashboard/src/components/team/TeamInfo.tsx
+++ b/ui/litellm-dashboard/src/components/team/TeamInfo.tsx
@@ -1027,7 +1027,21 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
}))}
/>
</Form.Item>
- <Form.Item {...restField} name={[name, "tpm"]}>
+ <Form.Item
+ {...restField}
+ name={[name, "tpm"]}
+ rules={[
+ {
+ validator: async (_, value) => {
+ const row = (form.getFieldValue("modelLimits") ?? [])[name] ?? {};
+ if (row.model && value == null && row.rpm == null) {
+ return Promise.reject(new Error("Set at least one of TPM or RPM"));
+ }
+ return Promise.resolve();
+ },
+ },
+ ]}
+ >
<InputNumber placeholder="TPM Limit" min={0} />
</Form.Item>
<Form.Item {...restField} name={[name, "rpm"]}>