flavianv/reco-protocol-a-leaderboard
0
Reco Leaderboard
Minimal playground for recommendation benchmarking. The active HF-deployable target is SmartBench Lite Arena: a locked-tool benchmark with a shared ReAct-lite agent loop.
Submitted model support:
- OpenAI model names like
gpt-4.1-mini - Hugging Face chat models like
meta-llama/Llama-3.1-8B-Instruct - Optional explicit prefixes:
openai:gpt-4.1-minihf:meta-llama/Llama-3.1-8B-Instruct
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install .SmartBench Lite: what this repo implements
Minimal HF-only setup
- Tiny public/private holdout query files or an HF-hosted Musical Instruments benchmark pack
- Locked local tools:
semantic_searchusing the actual base E5 retrieval assets fromiaouali/hybrid-recoperf_searchusing the fine-tuned item embedding space fromiaouali/hybrid-recoget_complementary_productsadd_candidatesrm_candidatesscore_candidates- OpenAI used only for:
- deciding the next tool action inside the shared loop
- final 4-dimension judge
- The judge remains benchmark-owned and fixed via
SMARTBENCH_LITE_JUDGE_MODEL - Deterministic fallback if
OPENAI_API_KEYis absent - Repeated runs per query (
k) and aggregate leaderboard scoring
What was implemented in this iteration
- Added a separate
smartbench_litebenchmark module. - Added the smallest dataset and local tool assets needed to run a locked-tool recommendation arena.
- Added an OpenAI-backed planner/judge with deterministic fallback.
- Added a Streamlit app that can launch evaluations directly inside an HF Space.
- Added tests for the no-secret fallback path.
- Added an HF asset loader that downloads and caches Musical Instruments data from
iaouali/hybrid-reco. - Added a shared
agent_react_lite.txtprompt and a step-by-step candidate-management loop inspired by SmartBench DeepShopper.
- Dataset files:
hf_dataset/smartbench_lite_public.jsonlhf_dataset/smartbench_lite_private.jsonl- Locked tool assets:
space_assets/smartbench_lite_catalog.jsonlspace_assets/smartbench_lite_complements.json- Harness:
src/reco_leaderboard/smartbench_lite/*- Evaluation script:
scripts/evaluate_smartbench_lite.py- HF app:
app_smartbench_lite.py- Leaderboard artifact:
data/smartbench_lite_leaderboard.csv
This is the lightest coherent SmartBench-style benchmark that still keeps planning and candidate selection agentic.
Run SmartBench Lite locally
Evaluate on public split:
python scripts/evaluate_smartbench_lite.py --model-id gpt-4.1-mini --split public --runs-per-query 2 --asset-source hf-musicalEvaluate on private split:
python scripts/evaluate_smartbench_lite.py --model-id gpt-4.1-mini --split private --runs-per-query 3 --asset-source hf-musicalOpen the HF-target app locally:
streamlit run app_smartbench_lite.pyFiles to map directly to HF
- HF Space app:
app_smartbench_lite.py - Eval backend in Space:
scripts/evaluate_smartbench_lite.py - Locked tools:
src/reco_leaderboard/smartbench_lite/* - Shared loop prompt:
prompts/agent_react_lite.txt - HF-hosted Musical Instruments assets are cached under
.cache/hf_assets/musical_instruments - Local fallback mini dataset:
hf_dataset/smartbench_lite_*.jsonl - Leaderboard table:
data/smartbench_lite_leaderboard.csv
Retrieval note:
semantic_searchnow uses the real base retrieval assets from the SmartBench Light repo.perf_searchuses the fine-tuned item embedding space from the repo with a base E5 query encoder in the HF Space path.- This keeps the Space deployable on lightweight hardware without loading the full multi-GB fine-tuned query checkpoint.
Evaluation contract
- Submitter controls:
model_id,temperature - Benchmark controls: tasks, tools, prompt shape, scoring, repeated runs
- Leaderboard metrics:
overall_scoreperformance_scoreneed_fitcompletenessredundancy_controlexplanation_qualityavg_tool_callsavg_latency_ms
Notes for real HF deployment
- Keep the real hidden split out of the public repo. The included private file is only for demo deployment.
- Set
OPENAI_API_KEYfor OpenAI submissions. - Set
HF_TOKENfor Hugging Face chat-model submissions through the HF router. - Set
SMARTBENCH_LITE_JUDGE_MODELif you want to override the fixed benchmark judge model. - Without the key, the app falls back to deterministic heuristic evaluation.
- Keep
runs_per_queryand dataset size small if you want HF-only execution. - The first
hf-musicalrun downloads and converts the remote assets; later runs reuse the local cache.
Tests
python -m pytest -qDeploy as a Hugging Face Space
- Create a Streamlit Space or sync this repo to an existing one.
- Set secret
OPENAI_API_KEYif you want model-driven planning and judging. - HF will launch
app_smartbench_lite.py. - Use the sidebar in the app to run benchmark submissions directly.
