From c39e1c267deed0480ee360ba942fe881772891c1 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Tue, 24 Feb 2026 10:31:01 +0300 Subject: Enha: loaded model on top --- bot.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bot.go') diff --git a/bot.go b/bot.go index 04dadb4..1c24f9a 100644 --- a/bot.go +++ b/bot.go @@ -411,14 +411,21 @@ func fetchLCPModelsWithLoadStatus() ([]string, error) { return nil, err } result := make([]string, 0, len(models.Data)) - for _, m := range models.Data { + li := 0 // loaded index + for i, m := range models.Data { modelName := m.ID if m.Status.Value == "loaded" { modelName = "(loaded) " + modelName + li = i } result = append(result, modelName) } - return result, nil + if li == 0 { + return result, nil // no loaded models + } + loadedModel := result[li] + result = append(result[:li], result[li+1:]...) + return slices.Concat([]string{loadedModel}, result), nil } // fetchLCPModelsWithStatus returns the full LCPModels struct including status information. -- cgit v1.2.3