{#if loading && options.length === 0 && isRouter}
Loading models…
{:else if options.length === 0 && isRouter}

No models available.

{:else} {@const selectedOption = getDisplayOption()} {#if isRouter} {selectedOption?.model || 'Select model'} {#if updating} {:else} {/if}
handleOpenChange(false)} onKeyDown={handleSearchKeyDown} />
{#if !isCurrentModelInCache() && currentModel}
{/if} {#if filteredOptions.length === 0}

No models found.

{/if} {#each filteredOptions as option, index (option.id)} {@const status = getModelStatus(option.model)} {@const isLoaded = status === ServerModelStatus.LOADED} {@const isLoading = status === ServerModelStatus.LOADING} {@const isSelected = currentModel === option.model || activeId === option.id} {@const isCompatible = isModelCompatible(option)} {@const isHighlighted = index === highlightedIndex} {@const missingModalities = getMissingModalities(option)}
isCompatible && handleSelect(option.id)} onmouseenter={() => (highlightedIndex = index)} onkeydown={(e) => { if (isCompatible && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); handleSelect(option.id); } }} > {option.model} {#if missingModalities} {#if missingModalities.vision}

No vision support

{/if} {#if missingModalities.audio}

No audio support

{/if}
{/if} {#if isLoading}

Loading model...

{:else if isLoaded}

Unload model

{:else} {/if}
{/each}
{:else} {/if} {/if}
{#if showModelDialog && !isRouter} {/if}