From 85a2abbbf3bbf060675496845f6dcfd4dcb305ad Mon Sep 17 00:00:00 2001 From: Matt Low Date: Thu, 20 Jun 2024 23:37:11 +0000 Subject: [PATCH] Use @ as the separator between model and provider Also put the provider after the model (e.g. `gpt-4o@openai`, `openai/gpt-4o@openrouter`. The aim here was to reduce clashing and confusion with existing model naming conventions. --- pkg/lmcli/lmcli.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/lmcli/lmcli.go b/pkg/lmcli/lmcli.go index b5389c1..a841d84 100644 --- a/pkg/lmcli/lmcli.go +++ b/pkg/lmcli/lmcli.go @@ -66,7 +66,7 @@ func (c *Context) GetModels() (models []string) { for _, p := range c.Config.Providers { for _, m := range *p.Models { modelCounts[m]++ - models = append(models, *p.Name+"/"+m) + models = append(models, fmt.Sprintf("%s@%s", m, *p.Name)) } } @@ -80,12 +80,12 @@ func (c *Context) GetModels() (models []string) { } func (c *Context) GetModelProvider(model string) (string, api.ChatCompletionClient, error) { - parts := strings.Split(model, "/") + parts := strings.Split(model, "@") var provider string if len(parts) > 1 { - provider = parts[0] - model = parts[1] + model = parts[0] + provider = parts[1] } for _, p := range c.Config.Providers {