Skip to content

Commit

Permalink
feat: add Ollama backend
Browse files Browse the repository at this point in the history
Signed-off-by: Kay Yan <[email protected]>
  • Loading branch information
yankay committed Apr 14, 2024
1 parent 9dfcce8 commit f82145d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ Active:
Unused:
> openai
> localai
> ollama
> azureopenai
> cohere
> amazonbedrock
Expand Down
4 changes: 3 additions & 1 deletion pkg/ai/iai.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var (
&OpenAIClient{},
&AzureAIClient{},
&LocalAIClient{},
&OllamaClient{},
&NoOpAIClient{},
&CohereClient{},
&AmazonBedRockClient{},
Expand All @@ -33,6 +34,7 @@ var (
Backends = []string{
openAIClientName,
localAIClientName,
ollamaClientName,
azureAIClientName,
cohereAIClientName,
amazonbedrockAIClientName,
Expand Down Expand Up @@ -150,7 +152,7 @@ func (p *AIProvider) GetProviderId() string {
return p.ProviderId
}

var passwordlessProviders = []string{"localai", "amazonsagemaker", "amazonbedrock", "googlevertexai"}
var passwordlessProviders = []string{"localai", "ollama", "amazonsagemaker", "amazonbedrock", "googlevertexai"}

func NeedPassword(backend string) bool {
for _, b := range passwordlessProviders {
Expand Down
11 changes: 11 additions & 0 deletions pkg/ai/ollama.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package ai

const ollamaClientName = "ollama"

type OllamaClient struct {
OpenAIClient
}

func (a *OllamaClient) GetName() string {
return ollamaClientName
}

0 comments on commit f82145d

Please sign in to comment.