Skip to content
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
4 changes: 2 additions & 2 deletions cmd/obol/llm.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ func llmCommand(cfg *config.Config) *cli.Command {
for _, name := range providers {
s := status[name]
key := "n/a"
if s.APIKeyEnv != "" {
if s.EnvVar != "" {
if s.HasAPIKey {
key = "set"
} else {
key = "missing"
}
}
fmt.Printf(" %-12s %-8t %-10s %s\n", name, s.Enabled, key, s.APIKeyEnv)
fmt.Printf(" %-12s %-8t %-10s %s\n", name, s.Enabled, key, s.EnvVar)
}
return nil
},
Expand Down
6 changes: 3 additions & 3 deletions internal/llm/llm.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var providerEnvKeys = map[string]string{
type ProviderStatus struct {
Enabled bool
HasAPIKey bool
APIKeyEnv string
EnvVar string // environment variable name (e.g. ANTHROPIC_API_KEY)
}

// ConfigureLLMSpy enables a cloud provider in the llmspy gateway.
Expand Down Expand Up @@ -116,7 +116,7 @@ func GetProviderStatus(cfg *config.Config) (map[string]ProviderStatus, error) {
// Ollama needs no API key, so it's always considered "has key".
// Cloud providers are updated below from the actual K8s Secret.
HasAPIKey: name == "ollama",
APIKeyEnv: keyEnv,
EnvVar: keyEnv,
}
}
}
Expand All @@ -135,7 +135,7 @@ func GetProviderStatus(cfg *config.Config) (map[string]ProviderStatus, error) {

for provider, envKey := range providerEnvKeys {
st := status[provider]
st.APIKeyEnv = envKey
st.EnvVar = envKey
if v, ok := secret.Data[envKey]; ok && strings.TrimSpace(v) != "" {
st.HasAPIKey = true
}
Expand Down