This repository contains a complete OpenEnv environment for neonatal mechanical ventilator management.
The environment is called NeoVentEnv and lives in the static/ folder.
- A physiologically grounded neonatal ventilation environment.
- Three benchmark tasks (
task_easy,task_medium,task_hard). - A FastAPI/OpenEnv server with web UI support.
- Baseline agents (LLM and deterministic heuristic fallback).
- Scoring logic and tests.
- Hugging Face Space deployment configuration.
.
|- inference.py # Root-level baseline runner for submission format
|- scripts/validate-submission.sh # Local validator for required files and sections
|- static/
| |- openenv.yaml # OpenEnv metadata (tasks, rewards, expected scores)
| |- README.md # Full environment documentation
| |- models.py # Action/observation/state models
| |- env/ # Core simulation and environment logic
| |- graders/grader.py # Episode grading (0.0 to 1.0)
| |- baseline/run_baseline.py # Baseline runner
| |- server/ # FastAPI server + Docker runtime
| |- tests/test_env.py # Smoke and contract tests
| |- data/patients.csv # Neonatal cohort
- Create and activate a virtual environment.
- Install dependencies.
- Run tests.
- Start the server.
cd /workspaces/STATIC
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r static/server/requirements.txtcd /workspaces/STATIC/static
pytest tests/test_env.py -vcd /workspaces/STATIC/static
export OPENAI_API_KEY=your_key_here
python -m baseline.run_baselineIf OPENAI_API_KEY is not set, deterministic heuristic fallback is used.
cd /workspaces/STATIC/static
uvicorn server.app:app --host 0.0.0.0 --port 8000 --reloadImportant endpoints:
GET /health and endpoint listingPOST /resetPOST /stepGET /stateGET /schemaGET /docsSwagger UIGET /web/OpenEnv web playground
/step expects an action envelope object.
{
"action": {
"delta_pip": 1,
"delta_peep": 0.5,
"delta_fio2": 0.02,
"delta_rr": 2,
"reasoning": "rescue low oxygen"
}
}Reset payload example:
{
"task_id": "task_easy"
}cd /workspaces/STATIC
export OPENAI_API_KEY=your_key_here
python inference.pyThis script logs start, step, and end events in machine-readable JSON.
cd /workspaces/STATIC
bash scripts/validate-submission.shValidator checks include:
- required project files
- data presence and size
- Docker/runtime files
- README section coverage
- model/env/grader structure
From repo root:
cd /workspaces/STATIC
source .venv/bin/activate
openenv push static --repo-id Beast7878/neoventDeployment metadata is in static/openenv.yaml.
For complete technical and clinical details, including:
- task definitions
- action/observation schema
- reward function and grading
- manual playground test presets
- troubleshooting
see static/README.md.