Spaces:
Paused
Paused
Commit History
-
feat(v2): execution-grounded rewards via DuckDB -- the key differentiator
Abhinav SinghTHE CORE INNOVATION: optimized SQL queries are ACTUALLY EXECUTED against a real in-memory DuckDB database. Reward is computed from measured performance, not keyword heuristics. New files: executor.py — DuckDB engine with 4 synthetic tables (users 10k, orders 500k, products 1k, events 1M). Runs both the original and optimized query 3x each, returns median timing, result correctness, and EXPLAIN plan. leaderboard.py — In-memory best-score tracker per task, surfaced via the new /leaderboard endpoint. test_env.py — Integration test confirming real speedup (3-4x on Task 1 measured on local machine). Updated reward function (graders.py): Real Execution Speedup 35% (was: not measured at all) Result Correctness 20% (NEW: both queries must return same data) Issue Detection 25% (was: 60% keyword-only) Approval Correctness 8% Summary Quality 7% …c15d346
-
feat(inference): add OpenEnv-compliant inference script
Abhinav Singhinference.py runs the agent loop against all 3 tasks in sequence. Strict stdout format (as required by hackathon spec): [START] task=<id> env=sql-optim-env model=<MODEL_NAME> [STEP] step=<n> action=suggestions=<n>,score=<f> reward=<f> done=<bool> error=<msg|null> [END] success=<bool> steps=<n> score=<f> rewards=<r1,...,rn> Agent strategy: - SYSTEM prompt instructs model to output strict JSON with suggestions, optimized_query, summary, estimated_improvement, approved fields - USER prompt includes schema_info, sql_query, dialect, step context, and issues_found_so_far from previous steps - parse_action() strips markdown fences and falls back gracefully on parse error - Episode success threshold: max reward >= 0.5 - Configurable via: API_BASE_URL, MODEL_NAME, HF_TOKEN env vars7d21a80