Configuration for a single LLM model within an ensemble.
| 80 | |
| 81 | @dataclass |
| 82 | class LLMModelConfig: |
| 83 | """Configuration for a single LLM model within an ensemble.""" |
| 84 | |
| 85 | # API configuration |
| 86 | api_base: str = None |
| 87 | api_key: Optional[str] = None |
| 88 | name: str = None |
| 89 | |
| 90 | # Custom LLM client initialization function (optional) |
| 91 | init_client: Optional[Callable] = None |
| 92 | |
| 93 | # Weight for this model in the ensemble (used for sampling) |
| 94 | weight: float = 1.0 |
| 95 | |
| 96 | # Generation parameters |
| 97 | system_message: Optional[str] = None |
| 98 | temperature: float = None |
| 99 | top_p: float = None |
| 100 | max_tokens: int = None |
| 101 | |
| 102 | # Request parameters |
| 103 | timeout: int = None |
| 104 | retries: int = None |
| 105 | retry_delay: int = None |
| 106 | |
| 107 | # Reproducibility |
| 108 | random_seed: Optional[int] = None |
| 109 | |
| 110 | # Reasoning parameters (for specific models) |
| 111 | reasoning_effort: Optional[str] = None |
| 112 | |
| 113 | def __post_init__(self): |
| 114 | """Post-initialization to resolve ${VAR} env var references in api_key.""" |
| 115 | self.api_key = _resolve_env_var(self.api_key) |
| 116 | |
| 117 | |
| 118 | @dataclass |
no outgoing calls
no test coverage detected