mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(ui): require TPM or RPM when adding a per-model team rate limit
Previously, a row with a model selected but both limits blank was silently dropped on save (neither model_tpm_limit nor model_rpm_limit got the key), so the row disappeared on reload with no feedback. Now the TPM field's validator blocks submission with "Set at least one of TPM or RPM" when a row has a model but neither limit filled.
This commit is contained in:
parent
89f32e1d75
commit
8a3dabb09f
1 changed files with 15 additions and 1 deletions
|
|
@ -1026,7 +1026,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"]}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue