summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go33
1 files changed, 25 insertions, 8 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 7f87391..5801239 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -16,15 +16,32 @@ type Project struct {
}
// LocalModel configures an OpenAI-compatible local LLM endpoint used for
-// internal helpers (classifier, future elaboration/summarization) and as the
-// backend for the "local" runner. If Endpoint is empty, the LocalRunner is
-// not registered and the classifier falls back to the Gemini CLI.
+// internal helpers (classifier, elaboration, future summarization) and as
+// the backend for the "local" runner. If Endpoint is empty, the LocalRunner
+// is not registered and the classifier falls back to the Gemini CLI.
+//
+// PreferForElaborate gates whether the API server's elaboration handler
+// uses this client. It defaults to true when Endpoint is set; users with a
+// slow or low-quality local model can disable it.
type LocalModel struct {
- Endpoint string `toml:"endpoint"` // e.g. "http://localhost:11434/v1"
- Model string `toml:"model"` // e.g. "llama3.1:8b"
- TimeoutSeconds int `toml:"timeout_seconds"` // default 60
- DefaultTemperature float64 `toml:"default_temperature"` // default 0.2
- APIKey string `toml:"api_key"` // optional bearer token
+ Endpoint string `toml:"endpoint"` // e.g. "http://localhost:11434/v1"
+ Model string `toml:"model"` // e.g. "llama3.1:8b"
+ TimeoutSeconds int `toml:"timeout_seconds"` // default 60
+ DefaultTemperature float64 `toml:"default_temperature"` // default 0.2
+ APIKey string `toml:"api_key"` // optional bearer token
+ PreferForElaborate *bool `toml:"prefer_for_elaborate"` // pointer so default-true survives parse
+}
+
+// UseForElaborate returns true when elaboration should try this local model
+// before falling back to Claude/Gemini. Default is true when Endpoint is set.
+func (m LocalModel) UseForElaborate() bool {
+ if m.Endpoint == "" {
+ return false
+ }
+ if m.PreferForElaborate == nil {
+ return true
+ }
+ return *m.PreferForElaborate
}
type Config struct {