Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ollama provider #866

Merged
merged 5 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:/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