KingHero121/dataforge-env
0
DataForge-Env ๐ง
A production-grade OpenEnv environment for evaluating LLM-based agents on real-world data cleaning, validation, and multi-table reconciliation tasks.
Overview
DataForge-Env wraps a stateful data-cleaning sandbox. Agents interact via structured actions to fix dirty datasets โ filling nulls, casting types, normalising values, joining tables, and satisfying business rules.
Rewards are dense and deterministic: agents receive granular feedback after every step, enabling RL-style training and scientific benchmarking.
Tasks
Quick Start
Local
pip install -r requirements.txt
python -m server.app
# Server runs on http://localhost:7860Docker
docker build -t dataforge-env .
docker run -p 7860:7860 dataforge-envAPI Usage
Reset (start an episode):
curl -X POST http://localhost:7860/reset \
-H "Content-Type: application/json" \
-d '{"task_id": "easy"}'Step (apply an action):
curl -X POST http://localhost:7860/step \
-H "Content-Type: application/json" \
-d '{"action": {"action_type": "fill_missing", "params": {"column": "email", "strategy": "constant", "fill_value": "unknown@example.com"}}}'Action Space
Reward Formula
R = 0.3 ร C_schema + 0.2 ร C_nulls + 0.1 ร C_dupes + 0.4 ร C_logic โ 0.01 ร step_penaltyAll components and the final reward are normalised to [0, 1].
Inference Script
export API_BASE_URL=https://api-inference.huggingface.co/v1
export MODEL_NAME=meta-llama/Llama-3-70B-Instruct
export HF_TOKEN=hf_...
export ENV_URL=http://localhost:7860
export TASK_ID=easy
python inference.pyOutput follows strict [START] / [STEP] / [END] format.
Project Structure
โโโ openenv.yaml # Environment specification
โโโ env/
โ โโโ models.py # Pydantic schemas
โ โโโ env.py # Core environment class
โ โโโ tasks.py # Task definitions & data generators
โ โโโ graders.py # Deterministic grading
โโโ server/
โ โโโ app.py # FastAPI server
โโโ inference.py # LLM agent inference script
โโโ Dockerfile # Container definition
โโโ requirements.txt # Python dependencies
โโโ README.md # This fileLicense
MIT
