From 528ff4c7915be58ea0f106d6efc4f7fa1ec0e008 Mon Sep 17 00:00:00 2001 From: Kris Hansen Date: Thu, 20 Feb 2025 13:04:18 -0700 Subject: [PATCH] fix: allow local only models --- utils/models/ollama.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/models/ollama.go b/utils/models/ollama.go index 21756c3..8ae943a 100644 --- a/utils/models/ollama.go +++ b/utils/models/ollama.go @@ -87,9 +87,13 @@ func (o *OllamaProvider) SupportsModel(modelName string) bool { return false } -// Configure sets up the provider (no API key needed for Ollama) +// Configure sets up the provider. Since Ollama is a local service that doesn't use API keys, +// we accept "LOCAL" as a special API key value to indicate it's properly configured. func (o *OllamaProvider) Configure(apiKey string) error { o.debugf("Configuring Ollama provider") + if apiKey != "LOCAL" { + return fmt.Errorf("invalid API key for Ollama: must be 'LOCAL' to indicate local service") + } return nil }