Skip to content

BEASTSHRIRAM/STATIC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STATIC - NeoVentEnv OpenEnv Project

This repository contains a complete OpenEnv environment for neonatal mechanical ventilator management. The environment is called NeoVentEnv and lives in the static/ folder.

What This Project Includes

  • 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.

Repository Layout

.
|- 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

Quick Start (Local)

  1. Create and activate a virtual environment.
  2. Install dependencies.
  3. Run tests.
  4. Start the server.
cd /workspaces/STATIC
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r static/server/requirements.txt

Run Tests

cd /workspaces/STATIC/static
pytest tests/test_env.py -v

Run Baseline (Inside static/)

cd /workspaces/STATIC/static
export OPENAI_API_KEY=your_key_here
python -m baseline.run_baseline

If OPENAI_API_KEY is not set, deterministic heuristic fallback is used.

Start API Server

cd /workspaces/STATIC/static
uvicorn server.app:app --host 0.0.0.0 --port 8000 --reload

Important endpoints:

  • GET / health and endpoint listing
  • POST /reset
  • POST /step
  • GET /state
  • GET /schema
  • GET /docs Swagger UI
  • GET /web/ OpenEnv web playground

API Request Format (Most Common Gotcha)

/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"
}

Run Submission-Style Inference

cd /workspaces/STATIC
export OPENAI_API_KEY=your_key_here
python inference.py

This script logs start, step, and end events in machine-readable JSON.

Validate Submission Readiness

cd /workspaces/STATIC
bash scripts/validate-submission.sh

Validator checks include:

  • required project files
  • data presence and size
  • Docker/runtime files
  • README section coverage
  • model/env/grader structure

Deploy to Hugging Face Space

From repo root:

cd /workspaces/STATIC
source .venv/bin/activate
openenv push static --repo-id Beast7878/neovent

Deployment metadata is in static/openenv.yaml.

Detailed Environment Documentation

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.

About

NeoVentEnv: An OpenEnv neonatal ventilator management simulator for training and evaluating RL/LLM agents on realistic NICU tasks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors