Skip to content

feat: make enable_thinking configurable per provider in ai_config.yaml#34

Merged
ellipse2v merged 1 commit into
mainfrom
enable_thinking_config
Jun 14, 2026
Merged

feat: make enable_thinking configurable per provider in ai_config.yaml#34
ellipse2v merged 1 commit into
mainfrom
enable_thinking_config

Conversation

@ellipse2v

Copy link
Copy Markdown
Owner

enable_thinking was hardcoded to False in litellm_client.py (PR #33). This moves it to a per-provider config field so Anthropic extended thinking can be enabled when a sufficient
max_tokens budget is available.

threat_analysis/ai_engine/providers/litellm_client.py

  • generate_content(): replace hardcoded False with bool(self.provider_config.get("enable_thinking", False)) — reads from ai_config.yaml, defaults to False
  • check_connection(): remove enable_thinking=False — the health ping uses max_tokens=1 and never benefits from reasoning mode

config/ai_config.yaml

  • Add enable_thinking as a commented-out field under the mistral provider block, with a note that it should only be set to true alongside a large max_tokens budget

tests/test_litellm_provider.py

  • test_enable_thinking_defaults_to_false: asserts acompletion receives enable_thinking=False when the field is absent from provider config
  • test_enable_thinking_true_from_provider_config: asserts enable_thinking=True is forwarded to acompletion when explicitly set in provider config
  • test_check_connection_does_not_pass_enable_thinking: asserts enable_thinking is absent from the health check call regardless of provider config

 enable_thinking was hardcoded to False in litellm_client.py (PR #33). This moves it to a per-provider config field so Anthropic extended thinking can be enabled when a sufficient
  max_tokens budget is available.

  threat_analysis/ai_engine/providers/litellm_client.py
  - generate_content(): replace hardcoded False with bool(self.provider_config.get("enable_thinking", False)) — reads from ai_config.yaml, defaults to False
  - check_connection(): remove enable_thinking=False — the health ping uses max_tokens=1 and never benefits from reasoning mode

  config/ai_config.yaml
  - Add enable_thinking as a commented-out field under the mistral provider block, with a note that it should only be set to true alongside a large max_tokens budget

  tests/test_litellm_provider.py
  - test_enable_thinking_defaults_to_false: asserts acompletion receives enable_thinking=False when the field is absent from provider config
  - test_enable_thinking_true_from_provider_config: asserts enable_thinking=True is forwarded to acompletion when explicitly set in provider config
  - test_check_connection_does_not_pass_enable_thinking: asserts enable_thinking is absent from the health check call regardless of provider config
@ellipse2v
ellipse2v merged commit bf3148a into main Jun 14, 2026
2 checks passed
@ellipse2v
ellipse2v deleted the enable_thinking_config branch June 14, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant