Add Ollama support
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/provider"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/provider/anthropic"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/provider/google"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/provider/ollama"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/provider/openai"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/tools"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/util"
|
||||
@@ -113,6 +114,14 @@ func (c *Context) GetModelProvider(model string) (string, provider.ChatCompletio
|
||||
BaseURL: url,
|
||||
APIKey: *p.APIKey,
|
||||
}, nil
|
||||
case "ollama":
|
||||
url := "http://localhost:11434/api"
|
||||
if p.BaseURL != nil {
|
||||
url = *p.BaseURL
|
||||
}
|
||||
return model, &ollama.OllamaClient{
|
||||
BaseURL: url,
|
||||
}, nil
|
||||
case "openai":
|
||||
url := "https://api.openai.com/v1"
|
||||
if p.BaseURL != nil {
|
||||
|
||||
Reference in New Issue
Block a user