summaryrefslogtreecommitdiff
path: root/popups.go
diff options
context:
space:
mode:
Diffstat (limited to 'popups.go')
-rw-r--r--popups.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/popups.go b/popups.go
index b0ee4ae..e5c46a1 100644
--- a/popups.go
+++ b/popups.go
@@ -17,9 +17,13 @@ func showModelSelectionPopup() {
} else if strings.Contains(api, "openrouter.ai") {
return ORFreeModels
}
- // Assume local llama.cpp
- updateModelLists()
- return LocalModels
+ // Assume local llama.cpp - fetch with load status
+ models, err := fetchLCPModelsWithLoadStatus()
+ if err != nil {
+ logger.Error("failed to fetch models with load status", "error", err)
+ return LocalModels
+ }
+ return models
}
// Get the current model list based on the API
modelList := getModelListForAPI(cfg.CurrentAPI)
@@ -57,8 +61,10 @@ func showModelSelectionPopup() {
modelListWidget.SetCurrentItem(currentModelIndex)
}
modelListWidget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) {
+ // Strip "(loaded)" suffix if present for local llama.cpp models
+ modelName := strings.TrimSuffix(mainText, " (loaded)")
// Update the model in both chatBody and config
- chatBody.Model = mainText
+ chatBody.Model = modelName
cfg.CurrentModel = chatBody.Model
// Remove the popup page
pages.RemovePage("modelSelectionPopup")