diff --git a/web/src/hooks/llm-hooks.ts b/web/src/hooks/llm-hooks.ts index 4c8eec6c5..a270c151a 100644 --- a/web/src/hooks/llm-hooks.ts +++ b/web/src/hooks/llm-hooks.ts @@ -64,8 +64,10 @@ export const useSelectLlmOptionsByModelType = () => { return { label: key, options: value - .filter((x) => - modelType ? x.model_type.includes(modelType) : true, + .filter( + (x) => + (modelType ? x.model_type.includes(modelType) : true) && + x.available, ) .map((x) => ({ label: x.llm_name, @@ -73,7 +75,8 @@ export const useSelectLlmOptionsByModelType = () => { disabled: !x.available, })), }; - }); + }) + .filter((x) => x.options.length > 0); }; return {