mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix: skip model budget rows with null max_budget to avoid silently blocking all traffic
This commit is contained in:
parent
39207405d7
commit
fe7ca53950
1 changed files with 2 additions and 2 deletions
|
|
@ -200,14 +200,14 @@ const ModelBudgetEditor: React.FC<ModelBudgetEditorProps> = ({ value, onChange,
|
|||
|
||||
const notifyChange = (newRows: ModelBudgetRow[]) => {
|
||||
if (!onChange) return;
|
||||
const filled = newRows.filter((r) => r.model);
|
||||
const filled = newRows.filter((r) => r.model && r.max_budget !== null);
|
||||
if (filled.length === 0) {
|
||||
onChange(undefined);
|
||||
return;
|
||||
}
|
||||
const obj: ModelBudgetValue = {};
|
||||
for (const r of filled) {
|
||||
obj[r.model] = { max_budget: r.max_budget ?? 0 };
|
||||
obj[r.model] = { max_budget: r.max_budget as number };
|
||||
}
|
||||
onChange(obj);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue