Config & protocol¶
An AutoJudge implements the AutoJudge protocol (judge, create_nuggets, create_qrels) and receives its LLM endpoint through the injected LlmConfigBase. The framework builds the config from environment variables (OPENAI_BASE_URL/OPENAI_MODEL/OPENAI_API_KEY/CACHE_DIR) — see Configure your LLM endpoint.
AutoJudge protocol¶
autojudge_base.AutoJudge ¶
Bases: LeaderboardJudgeProtocol, QrelsCreatorProtocol, NuggetCreatorProtocol, Protocol
Combined protocol for judges that implement all three phases.
This is a convenience protocol for the common case where a single class handles nugget creation, qrels creation, and leaderboard generation.
For modular configurations, use the individual protocols: - LeaderboardJudgeProtocol - QrelsCreatorProtocol - NuggetCreatorProtocol
LLM config¶
autojudge_base.llm_config.LlmConfigBase
dataclass
¶
LlmConfigBase(model: str = 'gpt-4o-mini', cache_dir: Optional[Path] = None, api_key: Optional[str] = None, base_url: Optional[str] = None, raw: dict = dict())
Minimal LLM configuration implementation.
For full features (batching, transport, retries), judges can use the raw config dict to instantiate MinimaLlmConfig from the minima-llm package:
from minima_llm import MinimaLlmConfig, OpenAIMinimaLlm
full_config = MinimaLlmConfig.from_dict(llm_config.raw)
backend = OpenAIMinimaLlm(full_config)
from_env
classmethod
¶
from_env() -> LlmConfigBase
Load from environment variables.
Source code in src/autojudge_base/llm_config.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
autojudge_base.llm_config.LlmConfigProtocol ¶
Bases: Protocol
Protocol for LLM configuration classes.
from_env
classmethod
¶
from_env() -> LlmConfigProtocol
Load configuration from environment variables.
Source code in src/autojudge_base/llm_config.py
23 24 25 26 | |