diff --git a/web/components/templates/dashboard/useDashboardPage.tsx b/web/components/templates/dashboard/useDashboardPage.tsx index 943b74f6f5..d87055771a 100644 --- a/web/components/templates/dashboard/useDashboardPage.tsx +++ b/web/components/templates/dashboard/useDashboardPage.tsx @@ -95,9 +95,20 @@ export const useDashboardPage = ({ userFilters ); const topModels = - models?.data - ?.sort((a, b) => (a.total_requests > b.total_requests ? -1 : 1)) - .slice(0, 5) ?? []; + models?.data?.sort((a, b) => + a.total_requests > b.total_requests ? -1 : 1 + ) ?? []; + + const { isLoading: isAllModelsLoading, models: allModels } = useModels( + timeFilter, + 1000, + [] + ); + + const allModelsData = allModels?.data; + allModels?.data?.sort((a, b) => + a.total_requests > b.total_requests ? -1 : 1 + ) ?? []; // replace the model filter inside of the filterMap with the text suggestion model const modelFilterIdx = filterMap.findIndex( @@ -107,7 +118,7 @@ export const useDashboardPage = ({ filterMap[modelFilterIdx] = { label: "Model", operators: textWithSuggestions( - topModels + allModelsData ?.filter((model) => model.model) .map((model) => ({ key: model.model,