Skip to content

Commit 2e56c4f

Browse files
AliciawqueAlicia Lustefyi-4355
authored
Fix: propagate custom endpoint to judge in self-eval mode (#17)
- Add endpoint field to JudgeConfig (#14) - Forward sut_endpoint in _build_judge_config for self-judge (#15) - Pass endpoint from run.py to _build_judge_config - Wire endpoint through JudgeEvaluator to ProviderConfig - Allow HTTP default endpoint override via IFIXAI_HTTP_ENDPOINT env (#16) Fixes #14, #15, #16 Co-authored-by: Alicia Lu <rk900nines@claw.163.com> Co-authored-by: stefyi-4355 <as.peter@ime.life>
1 parent febe8e4 commit 2e56c4f

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎ifixai/cli/orchestrator.py‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,12 @@ def _build_judge_config(
158158
sut_provider: str | None,
159159
sut_api_key: str,
160160
sut_model: str | None,
161-
judge_providers: tuple[str, ...],
162-
judge_api_keys: tuple[str, ...],
163-
judge_models: tuple[str, ...],
164-
max_calls: int,
165-
timeout: int,
161+
sut_endpoint: str | None = None,
162+
judge_providers: tuple[str, ...] = (),
163+
judge_api_keys: tuple[str, ...] = (),
164+
judge_models: tuple[str, ...] = (),
165+
max_calls: int = 200,
166+
timeout: int = 30,
166167
) -> JudgeConfig | None:
167168
if eval_mode == "deterministic":
168169
return None
@@ -171,6 +172,7 @@ def _build_judge_config(
171172
provider=sut_provider or "",
172173
api_key=sut_api_key,
173174
model=sut_model,
175+
endpoint=sut_endpoint,
174176
max_calls_per_run=max_calls,
175177
timeout=timeout,
176178
)

‎ifixai/cli/run.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ def run(
899899
sut_provider=provider,
900900
sut_api_key=api_key or "",
901901
sut_model=model,
902+
sut_endpoint=endpoint,
902903
judge_providers=judge_provider,
903904
judge_api_keys=judge_api_key,
904905
judge_models=judge_model,

‎ifixai/judge/config.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class JudgeConfig(BaseModel):
1515
provider: str = ""
1616
model: Optional[str] = None
1717
api_key: str = ""
18+
endpoint: Optional[str] = None
1819

1920
providers: Optional[list[JudgeProviderSpec]] = None
2021

‎ifixai/judge/evaluator.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def __init__(self, config: JudgeConfig) -> None:
1212
provider=config.provider,
1313
api_key=config.api_key,
1414
model=config.model,
15+
endpoint=config.endpoint,
1516
timeout=config.timeout,
1617
)
1718
self._call_count = 0

‎ifixai/providers/http.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from ifixai.providers.secrets import scrub_secrets
2020
from ifixai.core.types import ChatMessage, ProviderConfig, RetrievedSource
2121

22-
DEFAULT_ENDPOINT = "http://localhost:8000/v1"
22+
DEFAULT_ENDPOINT = os.environ.get("IFIXAI_HTTP_ENDPOINT", "http://localhost:8000/v1")
2323
EXTRA_HEADERS_ENV_VAR = "IFIXAI_EXTRA_HEADERS"
2424

2525

0 commit comments

Comments
 (0)