prashant-9457/my-openenv-task
0
๐ฅ ICU Resource Allocation โ OpenEnv
A real-world OpenEnv environment modelling a 20-bed ICU in a 500-bed Indian tertiary-care hospital. An AI agent acts as the ICU charge coordinator, making resource allocation decisions every 30 minutes over a 24-hour duty cycle.
๐ Real-World Grounding
This environment is not a simulation of a game โ it models actual clinical practice:
๐ฎ Action Space (7 discrete actions)
๐๏ธ Observation Space (27 fields)
Rich, clinically meaningful state:
- Bed status: occupied / available / in turnover
- Queue: total waiting, broken down by SOFA severity (critical/severe/moderate), longest wait
- Patient acuity: avg SOFA score, avg mortality risk of current ICU patients
- Equipment: ventilators & dialysis machines available/in-use
- Staff: nurses on duty, nurse:patient ratio, doctors
- Time: hour, shift (Day/Evening/Night), step
- Budget: remaining INR, utilisation %
- Outcomes: admissions, transfers, deaths in queue, adverse events, wait violations
๐ Tasks
๐ข Easy โ Prevent Preventable Deaths
Zero queue deaths + nurse:patient ratio โค 2.0 in โฅ90% of steps.
๐ก Medium โ NABH-Compliant Critical Care
All Easy criteria + all critical patients (SOFA โฅ 11) admitted within 2 hours of arrival. Maps to NABH Grade-B ICU standard.
๐ด Hard โ JCI-Grade ICU Excellence
All Medium criteria + zero adverse events + budget โค 85% + average SOFA non-increasing. Maps to JCI / NABH Grade-A accreditation benchmarks.
๐ API
# Reset
curl -X POST http://localhost:7860/reset -H "Content-Type: application/json" -d '{"seed": 42}'
# Step (action 1 = ADMIT_CRITICAL)
curl -X POST http://localhost:7860/step -H "Content-Type: application/json" -d '{"action": 1}'
# State
curl http://localhost:7860/state๐ Local Setup
pip install -r requirements.txt
# Run server
python app.py
# Run graders (validates all scores in [0,1])
python graders/task_graders.py
# Run LLM inference (needs env vars)
export API_BASE_URL=...
export MODEL_NAME=...
export HF_TOKEN=...
python inference.py๐ Structure
hospital_env/
โโโ env.py # ICU environment (SOFA, NABH, Poisson arrivals)
โโโ app.py # FastAPI: /reset /step /state
โโโ inference.py # LLM agent via OpenAI client
โโโ openenv.yaml # OpenEnv spec
โโโ requirements.txt
โโโ Dockerfile
โโโ README.md
โโโ graders/
โโโ task_graders.py # Easy / Medium / Hard graders โ scores [0,1]