YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
π₯ Healthcare RL Environment
An OpenEnv-compliant multi-task reinforcement learning environment for healthcare decision-making, built for the Hackathon submission.
π― Tasks (4 total, all graded 0.0 β 1.0)
| # | Task ID | Description | Reward Signal |
|---|---|---|---|
| 1 | medical_diagnosis |
Diagnose a patient from symptoms | Exact=1.0, Same category=0.5, Wrong=0.0 |
| 2 | drug_dosage |
Recommend optimal drug dose (mg/kg) | Smooth decay from optimal dose |
| 3 | patient_triage |
Priority-order patients by criticality | Normalised Kendall-Ο correlation |
| 4 | treatment_planning |
Select evidence-based treatment protocol | Guideline adherence β contraindication penalty |
π Quick Start
Prerequisites
export API_BASE_URL="https://your-llm-api-endpoint/v1"
export MODEL_NAME="your-model-id"
export HF_TOKEN="your-hf-or-api-token"
Run with Docker
docker build -t healthcare-rl-env .
docker run -p 8000:8000 \
-e API_BASE_URL=$API_BASE_URL \
-e MODEL_NAME=$MODEL_NAME \
-e HF_TOKEN=$HF_TOKEN \
healthcare-rl-env
Run locally
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 8000 --reload
π‘ API Endpoints
| Method | Path | Description |
|---|---|---|
GET |
/health |
Health check β returns {"status": "ok"} |
POST |
/reset |
Reset env; body: {"task_id": "...", "seed": 42} |
POST |
/step |
Take action; body: {"action": {...}} |
GET |
/state |
Current environment state |
GET |
/tasks |
List all available tasks |
GET |
/docs |
Interactive Swagger UI |
Example session
# Reset to medical_diagnosis task
curl -X POST http://localhost:8000/reset \
-H "Content-Type: application/json" \
-d '{"task_id": "medical_diagnosis", "seed": 42}'
# Take a step
curl -X POST http://localhost:8000/step \
-H "Content-Type: application/json" \
-d '{"action": {"diagnosis": "myocardial_infarction"}}'
# Check state
curl http://localhost:8000/state
π€ Running Inference
# With server already running:
export ENV_HOST="http://localhost:8000"
python inference.py
Inference uses the OpenAI client pointed at API_BASE_URL and emits structured logs:
[START] {"episode": 1, "task": "medical_diagnosis"}
[STEP] {"episode": 1, "task": "medical_diagnosis", "step": 1, "action": {...}, "reward": 1.0, "done": true}
[END] {"episode": 1, "task": "medical_diagnosis", "total_reward": 1.0, "score": 1.0}
β Pre-submission Validation
python validator.py
π OpenEnv Compliance Checklist
-
openenv.yamlwith typed models, task definitions, env_var declarations -
POST /resetendpoint -
POST /stependpoint -
GET /stateendpoint -
GET /healthreturns 200 (HF Space ping) -
inference.pyin root, uses OpenAI client - 4 tasks with graders, all scores in [0.0, 1.0]
-
[START]/[STEP]/[END]structured logs - Runtime < 20 min on vcpu=2, memory=8gb
-
Dockerfilefor containerised build -
validator.pyfor pre-submission checks
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support