chore(core): remove legacy benchmark judge - #1308
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91b2299d96
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| f"openai-compat spec must be 'openai-compat:<model>@<base_url>', got: {spec}" | ||
| ) | ||
| return OpenAICompatRunner(model=model, base_url=base_url, api_key=api_key) | ||
| resolved_api_key = api_key if api_key is not None else os.getenv("OPENAI_API_KEY") |
There was a problem hiding this comment.
Restrict the implicit API key to OpenAI endpoints
When OPENAI_API_KEY is set—for example, to run the mem0-local provider—and an answerer or judge uses Ollama, LM Studio, vLLM, or another custom openai-compat URL, this fallback sends the reusable OpenAI credential to that arbitrary server as a Bearer token, potentially even over plain HTTP. Only infer this key for a verified OpenAI API URL, or require an endpoint-specific explicit credential for other hosts.
AGENTS.md reference: benchmarks/AGENTS.md:L102-L106
Useful? React with 👍 / 👎.
Signed-off-by: phernandez <paul@basicmachines.co> Signed-off-by: mikemikimike <13286568797@163.com>
Signed-off-by: phernandez <paul@basicmachines.co> Signed-off-by: mikemikimike <13286568797@163.com>
Signed-off-by: phernandez <paul@basicmachines.co> Signed-off-by: mikemikimike <13286568797@163.com>
Why
The benchmark package had two overlapping LLM evaluation paths. The legacy
run judgepath depended on Pydantic Evals internals and silently converted anupstream API change into bogus all-zero results. The newer end-to-end QA path
already covers answer generation, judging, re-judging, diagnosis, and manual
review, so retaining the legacy path made benchmark output less trustworthy.
While validating the replacement path live, the documented
OPENAI_API_KEYconfiguration was also found to be disconnected from theOpenAI-compatible runner. That made every CLI-driven OpenAI QA case fail with
401 responses even though the key itself was valid.
What Changed
fields, artifact writers, optional dependency, lockfile packages, and
justrecipes.
run qathe documented benchmark evaluation workflow and added abench-qaconvenience recipe.OPENAI_API_KEYwhen no explicit key issupplied.
Implementation Details
The modern QA path remains separate from retrieval:
run fullproduces thedeterministic retrieval artifacts, then
run qagenerates and judges answersfrom those stored results. This preserves the ability to inspect or re-score a
retrieval run without repeating provider ingestion and search.
The OpenAI-compatible runner only consults
OPENAI_API_KEYwhen its caller didnot supply an API key explicitly, preserving explicit configuration precedence.
Testing
Automated
uv sync --group dev: passed; removed the legacy Pydantic Evals dependency tree.uv run pytest -q: 171 passed.uv run ruff check .: passed.uv run ruff format --check src/basic_memory_benchmarks tests/llm/test_runners.py tests/test_cli_surface.py tests/test_manifest_schema.py: passed (42 files checked).uv run pyright src/basic_memory_benchmarks/llm/runners.py src/basic_memory_benchmarks/cli.py src/basic_memory_benchmarks/runner.py src/basic_memory_benchmarks/models.py src/basic_memory_benchmarks/reporting/artifacts.py tests/llm/test_runners.py tests/test_cli_surface.py tests/test_manifest_schema.py: passed with 0 errors.uv lock --check: passed.Manual / Live Benchmark
gpt-4o-mini: 50/50 answers generated and judged, 0 errors.91b2299d96a3c97809735c7f620c12d79098d196: 1,986 rows/provider, 0 errors, 0 fairness warnings.validate-artifacts,run diagnose, andrun review: passed on the complete run.Risks / Follow-ups
uv run pyrightstill reports two pre-existing errors in untouched provider tests (test_baseline_providers.pyandtest_mem0_normalization.py); all changed Python surfaces type-check cleanly.gpt-4o-minimodel as answerer and judge for both providers.