don't filter out configured providers that have no available models

This commit is contained in:
Cole Goldsmith 2025-11-20 14:27:26 -06:00
parent dee77f4890
commit abf09fc070
2 changed files with 31 additions and 26 deletions

View file

@ -89,7 +89,6 @@ export function ModelSelector({
return (
<Popover open={open} onOpenChange={setOpen} modal={false}>
<PopoverTrigger asChild>
{/** biome-ignore lint/a11y/useSemanticElements: has to be a Button */}
<Button
variant="outline"
role="combobox"
@ -150,28 +149,36 @@ export function ModelSelector({
</div>
}
>
{group.options.map((option) => (
<CommandItem
key={option.value}
value={option.value}
onSelect={(currentValue) => {
if (currentValue !== value) {
onValueChange(currentValue, option.provider);
}
setOpen(false);
}}
>
<CheckIcon
className={cn(
"mr-2 h-4 w-4",
value === option.value ? "opacity-100" : "opacity-0",
)}
/>
<div className="flex items-center gap-2">
{option.label}
</div>
{group.options.length === 0 ? (
<CommandItem disabled className="text-muted-foreground ml-6">
No models available
</CommandItem>
))}
) : (
group.options.map((option) => (
<CommandItem
key={option.value}
value={option.value}
onSelect={(currentValue) => {
if (currentValue !== value) {
onValueChange(currentValue, option.provider);
}
setOpen(false);
}}
>
<CheckIcon
className={cn(
"mr-2 h-4 w-4",
value === option.value
? "opacity-100"
: "opacity-0",
)}
/>
<div className="flex items-center gap-2">
{option.label}
</div>
</CommandItem>
))
)}
</CommandGroup>
))
) : (

View file

@ -204,8 +204,7 @@ function KnowledgeSourcesPage() {
...model,
provider: provider.provider,
})),
}))
.filter((provider) => provider.options.length > 0);
}));
// Build grouped embedding model options from all configured providers (excluding Anthropic)
const groupedEmbeddingModels = [
@ -239,8 +238,7 @@ function KnowledgeSourcesPage() {
...model,
provider: provider.provider,
})),
}))
.filter((provider) => provider.options.length > 0);
}));
const isLoadingAnyLlmModels =
openaiLoading || anthropicLoading || ollamaLoading || watsonxLoading;