feat: add STRIX_REASONING_EFFORT env var to control thinking effort
- Add configurable reasoning effort via environment variable - Default to "high", but use "medium" for quick scan mode - Document in README and interface error panel Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -213,6 +213,7 @@ export LLM_API_KEY="your-api-key"
|
|||||||
# Optional
|
# Optional
|
||||||
export LLM_API_BASE="your-api-base-url" # if using a local model, e.g. Ollama, LMStudio
|
export LLM_API_BASE="your-api-base-url" # if using a local model, e.g. Ollama, LMStudio
|
||||||
export PERPLEXITY_API_KEY="your-api-key" # for search capabilities
|
export PERPLEXITY_API_KEY="your-api-key" # for search capabilities
|
||||||
|
export STRIX_REASONING_EFFORT="high" # control thinking effort (default: high, quick scan: medium)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Recommended models for best results:**
|
**Recommended models for best results:**
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ def validate_environment() -> None: # noqa: PLR0912, PLR0915
|
|||||||
if not os.getenv("PERPLEXITY_API_KEY"):
|
if not os.getenv("PERPLEXITY_API_KEY"):
|
||||||
missing_optional_vars.append("PERPLEXITY_API_KEY")
|
missing_optional_vars.append("PERPLEXITY_API_KEY")
|
||||||
|
|
||||||
|
if not os.getenv("STRIX_REASONING_EFFORT"):
|
||||||
|
missing_optional_vars.append("STRIX_REASONING_EFFORT")
|
||||||
|
|
||||||
if missing_required_vars:
|
if missing_required_vars:
|
||||||
error_text = Text()
|
error_text = Text()
|
||||||
error_text.append("❌ ", style="bold red")
|
error_text.append("❌ ", style="bold red")
|
||||||
@@ -118,6 +121,13 @@ def validate_environment() -> None: # noqa: PLR0912, PLR0915
|
|||||||
" - API key for Perplexity AI web search (enables real-time research)\n",
|
" - API key for Perplexity AI web search (enables real-time research)\n",
|
||||||
style="white",
|
style="white",
|
||||||
)
|
)
|
||||||
|
elif var == "STRIX_REASONING_EFFORT":
|
||||||
|
error_text.append("• ", style="white")
|
||||||
|
error_text.append("STRIX_REASONING_EFFORT", style="bold cyan")
|
||||||
|
error_text.append(
|
||||||
|
" - Reasoning effort level (default: high)\n",
|
||||||
|
style="white",
|
||||||
|
)
|
||||||
|
|
||||||
error_text.append("\nExample setup:\n", style="white")
|
error_text.append("\nExample setup:\n", style="white")
|
||||||
error_text.append("export STRIX_LLM='openai/gpt-5'\n", style="dim white")
|
error_text.append("export STRIX_LLM='openai/gpt-5'\n", style="dim white")
|
||||||
@@ -140,6 +150,11 @@ def validate_environment() -> None: # noqa: PLR0912, PLR0915
|
|||||||
error_text.append(
|
error_text.append(
|
||||||
"export PERPLEXITY_API_KEY='your-perplexity-key-here'\n", style="dim white"
|
"export PERPLEXITY_API_KEY='your-perplexity-key-here'\n", style="dim white"
|
||||||
)
|
)
|
||||||
|
elif var == "STRIX_REASONING_EFFORT":
|
||||||
|
error_text.append(
|
||||||
|
"export STRIX_REASONING_EFFORT='high'\n",
|
||||||
|
style="dim white",
|
||||||
|
)
|
||||||
|
|
||||||
panel = Panel(
|
panel = Panel(
|
||||||
error_text,
|
error_text,
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ _LLM_API_BASE = (
|
|||||||
or os.getenv("LITELLM_BASE_URL")
|
or os.getenv("LITELLM_BASE_URL")
|
||||||
or os.getenv("OLLAMA_API_BASE")
|
or os.getenv("OLLAMA_API_BASE")
|
||||||
)
|
)
|
||||||
|
_STRIX_REASONING_EFFORT = os.getenv(
|
||||||
|
"STRIX_REASONING_EFFORT"
|
||||||
|
) # "none", "minimal", "medium", "high", or "xhigh"
|
||||||
|
|
||||||
|
|
||||||
class LLMRequestFailedError(Exception):
|
class LLMRequestFailedError(Exception):
|
||||||
@@ -110,6 +113,13 @@ class LLM:
|
|||||||
self._total_stats = RequestStats()
|
self._total_stats = RequestStats()
|
||||||
self._last_request_stats = RequestStats()
|
self._last_request_stats = RequestStats()
|
||||||
|
|
||||||
|
if _STRIX_REASONING_EFFORT:
|
||||||
|
self._reasoning_effort = _STRIX_REASONING_EFFORT
|
||||||
|
elif self.config.scan_mode == "quick":
|
||||||
|
self._reasoning_effort = "medium"
|
||||||
|
else:
|
||||||
|
self._reasoning_effort = "high"
|
||||||
|
|
||||||
self.memory_compressor = MemoryCompressor(
|
self.memory_compressor = MemoryCompressor(
|
||||||
model_name=self.config.model_name,
|
model_name=self.config.model_name,
|
||||||
timeout=self.config.timeout,
|
timeout=self.config.timeout,
|
||||||
@@ -467,7 +477,7 @@ class LLM:
|
|||||||
completion_args["stop"] = ["</function>"]
|
completion_args["stop"] = ["</function>"]
|
||||||
|
|
||||||
if self._should_include_reasoning_effort():
|
if self._should_include_reasoning_effort():
|
||||||
completion_args["reasoning_effort"] = "high"
|
completion_args["reasoning_effort"] = self._reasoning_effort
|
||||||
|
|
||||||
queue = get_global_queue()
|
queue = get_global_queue()
|
||||||
self._total_stats.requests += 1
|
self._total_stats.requests += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user