Skip to content

scienstien/BladeLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title Bladelab
emoji 🦀
colorFrom pink
colorTo yellow
sdk docker
app_port 7860
pinned false

TurboDesigner 2.0

Physics-driven turbomachinery design environment with both a local Flask API and an OpenEnv-compatible FastAPI server.

Project Structure

turbodesigner2.0/
├── api/                # Web API (Flask)
│   ├── app.py
│   └── routes.py
├── env/                # Environment module
│   ├── core_env.py
│   ├── physics.py
│   ├── reward.py
│   ├── tasks.py
│   └── graders.py
├── tests/              # Test suite
│   ├── test_api.py
│   └── test_env.py
├── client.py           # OpenEnv client wrapper
├── models.py           # OpenEnv-facing models
├── server/             # OpenEnv FastAPI server
├── inference.py        # Baseline inference loop
├── openenv.yaml        # OpenEnv manifest
├── pyproject.toml      # OpenEnv packaging metadata
├── uv.lock             # uv lockfile
├── Dockerfile
├── requirements.txt
└── README.md

Setup

Using pip

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

Runtime Configuration

OpenAI-backed inference is configured from environment variables at runtime. The project keeps secrets in a local .env file or in the host environment. .env is ignored by git and should not be committed.

Start from the checked-in .env.example template and create a local .env:

cp .env.example .env

On Windows PowerShell:

Copy-Item .env.example .env

All runtime entrypoints import the template through python-dotenv, so copying the template is enough for the local scripts and flask app to pick up those values.

Variables used by the current code paths:

  • OPENAI_API_KEY: required only when using the OpenAI-backed policy paths
  • MODEL_NAME: optional; defaults to gpt-4.1-mini
  • API_BASE_URL: optional; takes precedence over OPENAI_BASE_URL when both are set
  • OPENAI_BASE_URL: optional fallback for OpenAI-compatible endpoints
  • HF_TOKEN: optional token for Hugging Face Space deployment or push workflows

You only need OpenAI credentials when:

  • calling the API with policy_type="openai"
  • running python inference.py --openai

Heuristic policy flows and the current test suite do not require OPENAI_API_KEY.

Usage

Run the OpenEnv Server

python -m server.app --port 7860

Run the Flask API

python -m api.app

Run Baseline Inference

python inference.py

Run Tests

python -m pytest tests/

Docker

Build and run with Docker:

docker build -t turbodesigner2.0 .
docker run -p 7860:7860 turbodesigner2.0

The Docker image installs runtime dependencies from requirements-server.txt to keep validator builds fast and lightweight.

To use the OpenAI-backed policy in Docker, pass env vars at runtime instead of baking secrets into the image:

docker run --env-file .env -p 7860:7860 turbodesigner2.0

For OpenEnv validation, the image should expose the FastAPI app on port 7860.

Endpoints

  • GET /api/health - Health check
  • POST /api/predict - Run prediction
  • GET /api/tasks - List available tasks
  • POST /reset - OpenEnv reset endpoint
  • POST /step - OpenEnv step endpoint
  • GET /state - OpenEnv state endpoint
  • GET /schema - OpenEnv action/observation schema endpoint

License

MIT

About

BladeLab is a physics-informed turbomachinery design environment built using the OpenEnv framework. It provides a structured setting where AI agents can iteratively optimize blade and rotor parameters under realistic engineering constraints.

Resources

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors