Skip to content

Commit 4fcf092

Browse files
committed
fix(model-selector): always update model list for Ollama and LMStudio backends
1 parent ca8691b commit 4fcf092

File tree

2 files changed

+6
-28
lines changed

2 files changed

+6
-28
lines changed

components/ModelSelector.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,7 @@ watch([endpointType, selectedModel], async (newVal) => {
293293
294294
watch([ollamaBaseUrl, lmStudioBaseUrl], async () => updateModelList())
295295
296-
onMounted(async () => {
297-
// Skip update for web-llm as it uses static SUPPORTED_MODELS
298-
if (endpointType.value !== 'web-llm') {
299-
updateModelList()
300-
}
296+
onMounted(() => {
297+
updateModelList()
301298
})
302299
</script>

utils/pinia-store/store.ts

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -208,29 +208,10 @@ export const useLLMBackendStatusStore = defineStore('llm-backend-status', () =>
208208

209209
const updateModelList = async () => {
210210
logger.debug('Updating model list...')
211-
const userConfig = await getUserConfig()
212-
const endpointType = userConfig.llm.endpointType.get()
213-
214-
// Skip backend requests for web-llm as it uses static models
215-
if (endpointType === 'web-llm') {
216-
logger.debug('Skipping model list update for web-llm')
217-
return modelList.value
218-
}
219-
220-
// Only update the backend that is currently in use
221-
const updates = []
222-
if (endpointType === 'ollama') {
223-
updates.push(updateOllamaModelList())
224-
}
225-
else if (endpointType === 'lm-studio') {
226-
updates.push(updateLMStudioModelList())
227-
}
228-
else {
229-
// Fallback: update both if endpoint type is unknown
230-
updates.push(updateOllamaModelList(), updateLMStudioModelList())
231-
}
232-
233-
await Promise.allSettled(updates)
211+
// Always update both Ollama and LMStudio backends so users can see
212+
// all available models when switching between backends in ModelSelector
213+
// WebLLM doesn't need updating as it uses static SUPPORTED_MODELS
214+
await Promise.allSettled([updateOllamaModelList(), updateLMStudioModelList()])
234215
return modelList.value
235216
}
236217

0 commit comments

Comments
 (0)