Skip to content

Commit 5a5c5fb

Browse files
feat: add reproducibility controls and deterministic search RNG (#179)
* feat: add reproducibility controls and deterministic search RNG * chore: bump package version to 1.3.2
1 parent d2937ea commit 5a5c5fb

25 files changed

Lines changed: 275 additions & 28 deletions

config.yaml.template

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,18 @@
9393

9494
# LLM for hypothesiser agent
9595
# Type: string
96-
# Default: "openai/gpt-5-mini"
97-
# hypothesiser_llm: "openai/gpt-5-mini"
96+
# Default: "anthropic/claude-sonnet-4-5-20250929"
97+
# hypothesiser_llm: "anthropic/claude-sonnet-4-5-20250929"
9898

9999
# LLM for planner agent
100100
# Type: string
101-
# Default: "openai/gpt-5-mini"
102-
# planner_llm: "openai/gpt-5-mini"
101+
# Default: "anthropic/claude-sonnet-4-5-20250929"
102+
# planner_llm: "anthropic/claude-sonnet-4-5-20250929"
103103

104104
# LLM for insight extractor agent
105105
# Type: string
106-
# Default: "openai/gpt-5-mini"
107-
# insight_extractor_llm: "openai/gpt-5-mini"
106+
# Default: "anthropic/claude-sonnet-4-5-20250929"
107+
# insight_extractor_llm: "anthropic/claude-sonnet-4-5-20250929"
108108

109109
# ------------------------------------------------------------
110110
# Logging & Agent Settings

plexe/CODE_INDEX.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Code Index: plexe
22

3-
> Generated on 2026-02-26 19:02:04
3+
> Generated on 2026-02-27 14:59:37
44
55
Code structure and public interface documentation for the **plexe** package.
66

@@ -149,11 +149,13 @@ Configuration for plexe.
149149
- `validate_model_providers(cls, v: dict[str, str], info) -> dict[str, str]` - Validate that all model provider references exist.
150150

151151
**`Config`** - Configuration for model building workflow.
152+
- `get_temperature(self, agent_name: str) -> float` - Resolve temperature for a given agent, falling back to default_temperature.
152153
- `settings_customise_sources(cls, settings_cls, init_settings, env_settings, dotenv_settings, file_secret_settings)` - Customize settings source priority.
153154
- `validate_nn_training_settings(self) -> 'Config'` - Ensure neural network defaults do not exceed the configured cap.
154155
- `parse_otel_headers_from_env(self) -> 'Config'` - Parse OTEL_EXPORTER_OTLP_HEADERS (comma-separated key=value pairs).
155156

156157
**Functions:**
158+
- `detect_installed_frameworks() -> list[str]` - Detect which ML frameworks are installed and importable.
157159
- `get_routing_for_model(config: RoutingConfig | None, model_id: str) -> tuple[str | None, dict[str, str]]` - Get routing configuration for a specific model ID.
158160
- `setup_logging(config: Config) -> logging.Logger` - Configure logging for the plexe package.
159161
- `setup_litellm(config: Config) -> None` - Configure LiteLLM global settings.
@@ -302,7 +304,7 @@ Amazon S3 storage helper.
302304
Universal entry point for plexe.
303305

304306
**Functions:**
305-
- `main(intent: str, data_refs: list[str], integration: WorkflowIntegration | None, spark_mode: str, user_id: str, experiment_id: str, max_iterations: int, work_dir: Path, test_dataset_uri: str | None, enable_final_evaluation: bool, max_epochs: int | None, allowed_model_types: list[str] | None, is_retrain: bool, original_model_uri: str | None, original_experiment_id: str | None, auto_mode: bool, user_feedback: dict | None, enable_otel: bool, otel_endpoint: str | None, otel_headers: dict[str, str] | None, external_storage_uri: str | None, csv_delimiter: str, csv_header: bool)` - Main model building function.
307+
- `main(intent: str, data_refs: list[str], integration: WorkflowIntegration | None, spark_mode: str, user_id: str, experiment_id: str, max_iterations: int, global_seed: int | None, work_dir: Path, test_dataset_uri: str | None, enable_final_evaluation: bool, max_epochs: int | None, allowed_model_types: list[str] | None, is_retrain: bool, original_model_uri: str | None, original_experiment_id: str | None, auto_mode: bool, user_feedback: dict | None, enable_otel: bool, otel_endpoint: str | None, otel_headers: dict[str, str] | None, external_storage_uri: str | None, csv_delimiter: str, csv_header: bool)` - Main model building function.
306308

307309
---
308310
## `models.py`
@@ -367,7 +369,7 @@ Model retraining functionality.
367369
PiEvolve-inspired evolutionary search policy with adaptive state analysis.
368370

369371
**`EvolutionarySearchPolicy`** - PiEvolve-inspired probabilistic action selection with adaptive search state analysis.
370-
- `__init__(self, num_drafts: int, debug_prob: float, max_debug_depth: int)`
372+
- `__init__(self, num_drafts: int, debug_prob: float, max_debug_depth: int, seed: int | None)`
371373
- `decide_next_solution(self, journal: SearchJournal, context: BuildContext, iteration: int, max_iterations: int) -> Solution | None` - PiEvolve-style probabilistic action selection based on search state.
372374
- `should_stop(self, journal: SearchJournal, iteration: int, max_iterations: int) -> bool` - Enhanced stopping criteria with intelligent early stopping.
373375

@@ -417,7 +419,7 @@ Search policy abstract base class.
417419
Tree-search policy inspired by AIDE.
418420

419421
**`TreeSearchPolicy`** - AIDE-inspired tree-search with draft/debug/improve stages.
420-
- `__init__(self, num_drafts: int, debug_prob: float, max_debug_depth: int)`
422+
- `__init__(self, num_drafts: int, debug_prob: float, max_debug_depth: int, seed: int | None)`
421423
- `decide_next_solution(self, journal: SearchJournal, context: BuildContext, iteration: int, max_iterations: int) -> Solution | None` - Decide which solution node to expand next.
422424
- `should_stop(self, journal: SearchJournal, iteration: int, max_iterations: int) -> bool` - Decide if search should terminate early.
423425

plexe/agents/baseline_builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def _build_agent(self, val_sample_df) -> CodeAgent:
131131
),
132132
model=PlexeLiteLLMModel(
133133
model_id=self.llm_model,
134+
temperature=self.config.get_temperature("baseline_builder"),
134135
api_base=api_base,
135136
extra_headers=headers,
136137
),

plexe/agents/dataset_splitter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def _build_agent(self) -> CodeAgent:
137137
),
138138
model=PlexeLiteLLMModel(
139139
model_id=self.llm_model,
140+
temperature=self.config.get_temperature("dataset_splitter"),
140141
api_base=api_base,
141142
extra_headers=headers,
142143
),

plexe/agents/feature_processor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def _build_agent(self, train_sample_df, val_sample_df) -> CodeAgent:
7272
instructions=instructions,
7373
model=PlexeLiteLLMModel(
7474
model_id=self.llm_model,
75+
temperature=self.config.get_temperature("feature_processor"),
7576
api_base=api_base,
7677
extra_headers=headers,
7778
),

plexe/agents/hypothesiser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ def _build_agent(self) -> CodeAgent:
127127
instructions=instructions,
128128
model=PlexeLiteLLMModel(
129129
model_id=self.llm_model,
130+
temperature=self.config.get_temperature("hypothesiser"),
130131
api_base=api_base,
131132
extra_headers=headers,
132-
reasoning_effort="minimal",
133133
),
134134
verbosity_level=self.config.agent_verbosity_level,
135135
tools=[get_save_hypothesis_tool(self.context, self.expand_solution_id)],

plexe/agents/insight_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ def _build_agent(self) -> CodeAgent:
127127
instructions=instructions,
128128
model=PlexeLiteLLMModel(
129129
model_id=self.llm_model,
130+
temperature=self.config.get_temperature("insight_extractor"),
130131
api_base=api_base,
131132
extra_headers=headers,
132-
reasoning_effort="minimal",
133133
),
134134
verbosity_level=self.config.agent_verbosity_level,
135135
tools=[get_save_insight_tool(self.insight_store)],

plexe/agents/layout_detector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def _build_agent(self) -> CodeAgent:
123123
),
124124
model=PlexeLiteLLMModel(
125125
model_id=self.llm_model,
126+
temperature=self.config.get_temperature("layout_detector"),
126127
api_base=api_base,
127128
extra_headers=headers,
128129
),

plexe/agents/metric_implementer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def _build_agent(self) -> CodeAgent:
9090
),
9191
model=PlexeLiteLLMModel(
9292
model_id=self.llm_model,
93+
temperature=self.config.get_temperature("metric_implementer"),
9394
api_base=api_base,
9495
extra_headers=headers,
9596
),

plexe/agents/metric_selector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def _build_agent(self) -> CodeAgent:
7474
),
7575
model=PlexeLiteLLMModel(
7676
model_id=self.llm_model,
77+
temperature=self.config.get_temperature("metric_selector"),
7778
api_base=api_base,
7879
extra_headers=headers,
7980
),

0 commit comments

Comments
 (0)