Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix(ai): use configured provider's default model when no model set

rcourtmanf18bf62bd356
diff --git a/internal/config/ai.go b/internal/config/ai.go
index 3698973a7f..7f5bd70ef9 100644
--- a/internal/config/ai.go
+++ b/internal/config/ai.go
@@ -286,6 +286,24 @@ func (c *AIConfig) GetModel() string {
if c.Model != "" {
return c.Model
}
+
+ // If only one provider is configured, use its default model
+ // This handles the case where user configures Ollama but doesn't explicitly select a model
+ configured := c.GetConfiguredProviders()
+ if len(configured) == 1 {
+ switch configured[0] {
+ case AIProviderAnthropic:
+ return DefaultAIModelAnthropic
+ case AIProviderOpenAI:
+ return DefaultAIModelOpenAI
+ case AIProviderOllama:
+ return DefaultAIModelOllama
+ case AIProviderDeepSeek:
+ return DefaultAIModelDeepSeek
+ }
+ }
+
+ // Fall back to legacy Provider field for backwards compatibility
switch c.Provider {
case AIProviderAnthropic:
return DefaultAIModelAnthropic