feat(ai): add support for Ollama AI provider configuration

* Update README with Ollama integration details
* Add Ollama configuration to example YAML files
* Implement Ollama provider in AI factory
* Add tests for Ollama provider functionality
* Enhance config validation for Ollama settings
This commit is contained in:
Hein
2026-03-25 12:26:31 +02:00
parent ad05a9e228
commit c8ca272b03
12 changed files with 182 additions and 3 deletions

View File

@@ -19,6 +19,10 @@ func validConfig() Config {
BaseURL: "http://localhost:4000/v1",
APIKey: "key",
},
Ollama: OllamaConfig{
BaseURL: "http://localhost:11434/v1",
APIKey: "ollama",
},
OpenRouter: OpenRouterAIConfig{
BaseURL: "https://openrouter.ai/api/v1",
APIKey: "key",
@@ -29,12 +33,17 @@ func validConfig() Config {
}
}
func TestValidateAcceptsLiteLLMAndOpenRouter(t *testing.T) {
func TestValidateAcceptsSupportedProviders(t *testing.T) {
cfg := validConfig()
if err := cfg.Validate(); err != nil {
t.Fatalf("Validate litellm error = %v", err)
}
cfg.AI.Provider = "ollama"
if err := cfg.Validate(); err != nil {
t.Fatalf("Validate ollama error = %v", err)
}
cfg.AI.Provider = "openrouter"
if err := cfg.Validate(); err != nil {
t.Fatalf("Validate openrouter error = %v", err)