From 3cc2d5e19e17cbe969edf88f51d47d3282f93df8 Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Thu, 5 Mar 2026 13:21:31 +0200 Subject: [PATCH] Set appropriate temperature and max_tokens defaults --- CHANGELOG.md | 2 ++ docs/configuration/index.md | 6 +++++- docs/configuration/processing.md | 1 + docs/configuration/providers.md | 6 +++--- docs/configuration/qa-research.md | 3 +++ haiku_rag_slim/haiku/rag/config/models.py | 6 ++++++ 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed141488..6005b82a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ### Changed +- **Default model temperatures**: Set task-appropriate temperature defaults — 0.3 for QA, research, and title generation; 0.0 for RLM and picture description. Previously unset (provider defaults, typically 0.7–1.0). +- **Default title max_tokens**: Set `max_tokens=100` for title generation model to keep titles concise - **Test suite cleanup**: Removed stale VCR cassettes, dead fixtures, orphaned directories, and redundant tests. Strengthened weak assertions across search, context enhancement, and converter tests. Relocated misplaced `SearchResult._get_primary_label` test to `test_search.py` - **Parallel test execution**: Added `pytest-xdist` and enabled parallel test runs by default (`-n auto`), reducing test suite time from ~3.5 min to ~2 min diff --git a/docs/configuration/index.md b/docs/configuration/index.md index 1754349f..917f8e1a 100644 --- a/docs/configuration/index.md +++ b/docs/configuration/index.md @@ -85,6 +85,7 @@ qa: provider: ollama name: gpt-oss enable_thinking: false + temperature: 0.3 max_iterations: 2 max_concurrency: 1 @@ -93,6 +94,7 @@ research: provider: "" # Empty to use qa settings name: "" enable_thinking: false + temperature: 0.3 max_iterations: 3 max_concurrency: 1 @@ -122,6 +124,8 @@ processing: provider: ollama name: gpt-oss enable_thinking: false + temperature: 0.3 + max_tokens: 100 conversion_options: do_ocr: true force_ocr: false @@ -156,7 +160,7 @@ custom_config = AppConfig( model=ModelConfig( provider="openai", name="gpt-4o", - temperature=0.7 + temperature=0.3 ) ), embeddings=EmbeddingsConfig( diff --git a/docs/configuration/processing.md b/docs/configuration/processing.md index 0dae70ba..a3b9bd35 100644 --- a/docs/configuration/processing.md +++ b/docs/configuration/processing.md @@ -120,6 +120,7 @@ conversion_options: model: provider: ollama # ollama, openai, or custom name: ministral-3 # VLM model name + temperature: 0.0 # Default: 0.0 (factual descriptions) timeout: 90 # Request timeout in seconds max_tokens: 200 # Maximum tokens in response ``` diff --git a/docs/configuration/providers.md b/docs/configuration/providers.md index 7f7bbded..07cbcf07 100644 --- a/docs/configuration/providers.md +++ b/docs/configuration/providers.md @@ -16,17 +16,17 @@ qa: model: provider: ollama name: gpt-oss - temperature: 0.7 + temperature: 0.3 max_tokens: 500 ``` **Available options:** -- **temperature**: Sampling temperature (0.0-1.0+) +- **temperature**: Sampling temperature (0.0-1.0+). Defaults vary by task: 0.3 for QA, research, and title generation; 0.0 for RLM and picture description. - Lower (0.0-0.3): Deterministic, focused responses - Medium (0.4-0.7): Balanced - Higher (0.8-1.0+): Creative, varied responses -- **max_tokens**: Maximum tokens in response +- **max_tokens**: Maximum tokens in response. Default: unset (provider default), except title generation (100). - **enable_thinking**: Control reasoning behavior (see below) - **base_url**: Custom endpoint for OpenAI-compatible servers (vLLM, LM Studio, etc.) diff --git a/docs/configuration/qa-research.md b/docs/configuration/qa-research.md index 0ebe931e..9a72b2bf 100644 --- a/docs/configuration/qa-research.md +++ b/docs/configuration/qa-research.md @@ -32,6 +32,7 @@ qa: provider: ollama name: gpt-oss enable_thinking: false + temperature: 0.3 # Default: 0.3 max_iterations: 2 # Maximum search iterations max_concurrency: 1 # Concurrent search operations ``` @@ -50,6 +51,7 @@ research: provider: "" # Empty to use qa settings name: "" # Empty to use qa model enable_thinking: false + temperature: 0.3 # Default: 0.3 max_iterations: 3 max_concurrency: 1 ``` @@ -69,6 +71,7 @@ rlm: model: provider: anthropic name: claude-sonnet-4-20250514 + temperature: 0.0 # Default: 0.0 (deterministic for code generation) code_timeout: 60.0 # Max seconds for code execution max_output_chars: 50000 # Truncate output after this many chars ``` diff --git a/haiku_rag_slim/haiku/rag/config/models.py b/haiku_rag_slim/haiku/rag/config/models.py index a07c857f..c621b99a 100644 --- a/haiku_rag_slim/haiku/rag/config/models.py +++ b/haiku_rag_slim/haiku/rag/config/models.py @@ -76,6 +76,7 @@ class QAConfig(BaseModel): provider="ollama", name="gpt-oss", enable_thinking=False, + temperature=0.3, ) ) max_iterations: int = 2 @@ -88,6 +89,7 @@ class ResearchConfig(BaseModel): provider="ollama", name="gpt-oss", enable_thinking=False, + temperature=0.3, ) ) max_iterations: int = 3 @@ -100,6 +102,7 @@ class RLMConfig(BaseModel): provider="ollama", name="gpt-oss", enable_thinking=False, + temperature=0.0, ) ) code_timeout: float = 60.0 @@ -114,6 +117,7 @@ class PictureDescriptionConfig(BaseModel): default_factory=lambda: ModelConfig( provider="ollama", name="ministral-3", + temperature=0.0, ) ) timeout: int = 90 @@ -162,6 +166,8 @@ class ProcessingConfig(BaseModel): provider="ollama", name="gpt-oss", enable_thinking=False, + temperature=0.3, + max_tokens=100, ) )