fix: eliminate ~5s delay when opening Switch Models panel with local provider (#8626)

Signed-off-by: jh-block <jhugo@block.xyz>
This commit is contained in:
jh-block
2026-04-17 21:08:41 +02:00
committed by GitHub
parent 3f3b519b62
commit 1a18c2748c
9 changed files with 166 additions and 62 deletions
@@ -5,6 +5,7 @@ import { useModelAndProvider } from '../../ModelAndProviderContext';
import { defineMessages, useIntl } from '../../../i18n';
import {
listLocalModels,
syncFeaturedModels,
downloadHfModel,
getLocalModelDownloadProgress,
cancelLocalModelDownload,
@@ -159,6 +160,7 @@ export const LocalInferenceSettings = () => {
const loadModels = useCallback(async (): Promise<LocalModelResponse[] | undefined> => {
try {
await syncFeaturedModels();
const response = await listLocalModels();
if (response.data) {
setModels(response.data);