Files
Multi_Swarm_Coevolutive/src/multi_swarm/config.py
T
Adriano 8ec45c5c1b revert(config): rollback tier C a qwen-2.5-72b-instruct (qwen3-235b inferiore)
Run controllo phase2-qwen25-control-001 (seed 42, stessa pipeline Phase 2,
solo tier C switched) ha dimostrato che qwen-2.5-72b è qualitativamente
SUPERIORE a qwen3-235b sul nostro workload:

| metrica           | qwen3-235b | qwen-2.5-72b | delta |
| ----------------- | ---------- | ------------ | ----- |
| max fitness       | 0.0238     | 0.0311       | +30%  |
| median > 0 in gen | mai        | 4 gen su 10  | --    |
| entropy media     | 0.199      | 0.85         | 4.3x  |
| genomi fit > 0    | 5          | 10           | 2x    |
| parse success     | 97.7%      | 100%         | +     |
| durata            | 50 min     | 28 min       | 0.56x |
| LLM calls         | 148        | 90           | 0.61x |
| cost USD          | 0.0223     | 0.0122       | 0.55x |

Controintuitivo: 235B con context 262k era atteso superiore al 72B legacy.
In pratica qwen3-235b in tier C produce strategie meno diverse,
meno parsabili e meno ottimizzabili dal GA.

Ripristinati prezzi cost_tracker tier C a 0.40/0.40 (qwen-2.5-72b).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 23:45:52 +02:00

44 lines
1.4 KiB
Python

"""Pydantic settings loader for Multi_Swarm_Coevolutive.
Loads configuration from environment variables and an optional ``.env`` file
in the project root. Required secrets are validated at instantiation time.
"""
from pathlib import Path
from pydantic import Field, SecretStr
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="ignore",
case_sensitive=False,
)
cerbero_base_url: str = "http://localhost:9000"
cerbero_testnet_token: SecretStr
cerbero_mainnet_token: SecretStr | None = None
cerbero_bot_tag: str = "swarm-poc-phase1"
openrouter_api_key: SecretStr
llm_model_tier_s: str = "google/gemini-3-flash-preview"
llm_model_tier_a: str = "deepseek/deepseek-v4-flash"
llm_model_tier_b: str = "deepseek/deepseek-v4-flash"
llm_model_tier_c: str = "qwen/qwen-2.5-72b-instruct"
llm_model_tier_d: str = "openai/gpt-oss-20b"
openrouter_base_url: str = "https://openrouter.ai/api/v1"
run_name: str = "phase1-spike-001"
data_dir: Path = Field(default=Path("./data"))
series_dir: Path = Field(default=Path("./series"))
db_path: Path = Field(default=Path("./runs.db"))
def load_settings() -> Settings:
# Required fields are populated from environment / .env, not init kwargs.
return Settings() # type: ignore[call-arg]