Skip to content

Commit

Permalink
refactor: ollama provider (#866)
Browse files Browse the repository at this point in the history
  • Loading branch information
venjiang committed Sep 6, 2024
1 parent c91a388 commit 02356ec
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 338 deletions.
2 changes: 1 addition & 1 deletion cli/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func registerAIProvider(aiConfig *ai.Config) error {
provider["model"],
))
case "ollama":
providerpkg.RegisterProvider(ollama.NewProvider(provider["api_endpoint"]))
providerpkg.RegisterProvider(ollama.NewProvider(provider["api_endpoint"], provider["model"]))
case "gemini":
providerpkg.RegisterProvider(gemini.NewProvider(provider["api_key"]))
case "githubmodels":
Expand Down
12 changes: 8 additions & 4 deletions example/10-ai/zipper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: ai-zipper
host: 0.0.0.0
port: 9000

auth:
type: token
token: Happy New Year
# auth:
# type: token
# token: Happy New Year

bridge:
ai:
server:
addr: localhost:8000
provider: anthropic
provider: ollama

providers:
azopenai:
Expand All @@ -33,6 +33,10 @@ bridge:
deployment_id:
api_version:

ollama:
api_endpoint: http://localhost:11434/v1
model: llama3.1

cerebras:
api_key:
model:
Expand Down
8 changes: 3 additions & 5 deletions pkg/bridge/ai/provider/ollama/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ Follow the Ollama doc:

<https://github.com/ollama/ollama?tab=readme-ov-file#ollama>

## 2. Run the Mistral model

Notice that only the Mistral v0.3+ models are supported currently.
## 2. Run the model

```sh
ollama run mistral:7b
ollama run llama3.1
```

## 3. Start YoMo Zipper
Expand All @@ -34,7 +32,7 @@ bridge:
provider: ollama
providers:
ollama:
api_endpoint: "http://localhost:11434/"
api_endpoint: "http://localhost:11434/v1"
```
```sh
Expand Down
Loading

0 comments on commit 02356ec

Please sign in to comment.