From c1a215b955d8f4fa342aa72bc691ea21db51d85e Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 4 May 2024 21:00:03 -0700 Subject: [PATCH] fix set router retry policy on ui --- .../src/components/model_dashboard.tsx | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/model_dashboard.tsx b/ui/litellm-dashboard/src/components/model_dashboard.tsx index b223e91281..722f2f8b46 100644 --- a/ui/litellm-dashboard/src/components/model_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/model_dashboard.tsx @@ -83,6 +83,17 @@ const provider_map: Record = { }; + +const retry_policy_map: Record = { + "BadRequestError (400)": "BadRequestErrorRetries", + "AuthenticationError (401)": "AuthenticationErrorRetries", + "TimeoutError (408)": "TimeoutErrorRetries", + "RateLimitError (429)": "RateLimitErrorRetries", + "ContentPolicyViolationError (400)": "ContentPolicyViolationErrorRetries" +}; + + + const handleSubmit = async (formValues: Record, accessToken: string, form: any) => { try { /** @@ -795,6 +806,7 @@ const handleEditSubmit = async (formValues: Record) => { Add Model
/health Models
Model Analytics + Model Retry Settings
@@ -816,7 +828,7 @@ const handleEditSubmit = async (formValues: Record) => {
- Filter by Public Model Name + Filter by Public Model Name setSelectedModelGroup(value)} + > + {availableModelGroups.map((group, idx) => ( + setSelectedModelGroup(group)} + > + {group} + + ))} + +
+ + + Retry Policy for {selectedModelGroup} + + { + retry_policy_map && Object.keys(retry_policy_map).map((key, idx) => ( +
+ + {key} + + + + +
+ )) + } +
+