package cli import ( "log/slog" "net/http" "time" "github.com/thepeterstone/claudomator/internal/config" "github.com/thepeterstone/claudomator/internal/llm" ) // buildLocalLLMClient returns an *llm.Client when a local model endpoint is // configured. Returns nil when LocalModel.Endpoint is empty so callers can // gate on `if c != nil` to skip registering LocalRunner / using the LLM // classifier path. func buildLocalLLMClient(cfg config.LocalModel, logger *slog.Logger) *llm.Client { if cfg.Endpoint == "" { return nil } timeout := 60 * time.Second if cfg.TimeoutSeconds > 0 { timeout = time.Duration(cfg.TimeoutSeconds) * time.Second } return &llm.Client{ Endpoint: cfg.Endpoint, Model: cfg.Model, APIKey: cfg.APIKey, HTTPClient: &http.Client{Timeout: timeout}, Logger: logger, } }