File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 5353 },
5454 "ai-lab.inferenceRuntime" : {
5555 "type" : " string" ,
56- "default" : " llama-cpp" ,
5756 "enum" : [
5857 " llama-cpp" ,
59- " whisper-cpp " ,
60- " none "
58+ " openvino " ,
59+ " vllm "
6160 ],
6261 "description" : " Choose the default inferencing runtime for AI Lab"
6362 },
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ function handleOnChange(nValue: (ModelInfo & { label: string; value: string }) |
4747 value = nValue ;
4848}
4949
50- let defaultRuntime: string = ' llama-cpp ' ;
50+ let defaultRuntime: string | undefined = $state () ;
5151
5252onMount (() => {
5353 return configuration .subscribe (values => {
@@ -56,6 +56,13 @@ onMount(() => {
5656 }
5757 });
5858});
59+
60+ function filterModel(model : ModelInfo ): boolean {
61+ // If the defaultRuntime is undefined we should not filter any model
62+ if (! defaultRuntime ) return true ;
63+
64+ return model .backend === defaultRuntime ;
65+ }
5966 </script >
6067
6168<Select
@@ -66,7 +73,7 @@ onMount(() => {
6673 onchange ={handleOnChange }
6774 placeholder =" Select model to use"
6875 items ={models
69- .filter (model => model . backend === defaultRuntime )
76+ .filter (filterModel )
7077 .toSorted ((a , b ) => getModelSortingScore (a ) - getModelSortingScore (b ))
7178 .map (model => ({ ... model , value: model .id , label: model .name }))}>
7279 <div slot =" item" let:item >
Original file line number Diff line number Diff line change @@ -103,12 +103,12 @@ function openContribution(): void {
103103 studioClient .openURL (' https://github.com/containers/ai-lab-recipes/blob/main/CONTRIBUTING.md' ).catch (console .error );
104104}
105105
106- let defaultRuntime: string = $state (' llama-cpp ' );
106+ let defaultRuntime: string | undefined = $state ();
107107
108108onMount (() => {
109109 const inferenceRuntime = $configuration ?.inferenceRuntime ;
110110 if (inferenceRuntime ) defaultRuntime = inferenceRuntime ;
111- onFilterChange (' tools' , defaultRuntime );
111+ onFilterChange (' tools' , defaultRuntime ?? ' all ' );
112112});
113113 </script >
114114
You can’t perform that action at this time.
0 commit comments