OpenEnv Dispatch Demo
OpenEnv Dispatch Demo is an Uber-style ride-dispatch RL environment built on OpenEnv.
Core trick
PPO agent learns to call repair actions after injected API and schema drift breaks a mock ride-dispatch workflow.
Description
OpenEnv Dispatch Demo is an Uber-style ride-dispatch RL environment built on OpenEnv. It simulates a workflow (request → match driver → fare → confirm → payment) while exposing drift (schema, API, and policy changes). An RL agent is trained with Stable-Baselines3 (PPO) to repair failures and restore the workflow. The repo includes a FastAPI mock API, Gymnasium env, drift engine, and a demo UI for running episodes with different drift settings.
README excerpt
--- sdk: docker app_port: 7860 --- # Ride-Sharing Dispatch RL Environment (OpenEnv) Uber-style ride-dispatch reliability environment: workflow (request → match → fare → confirm → payment) with **drift** (schema, API, policy). The RL agent learns to repair failures and restore the workflow. Built with **OpenEnv** (mandatory), Gymnasium, Stable-Baselines3, and FastAPI. ## Quick start ### Local (API + training) 1. **Install** ```bash pip install -r requirements.txt ``` 2. **Run mock API** (terminal 1) ```bash python -m uvicorn backend.api.app:app --host 0.0.0.0 --port 8000 ``` 3. **Train** (terminal 2; API must be running, or use built-in thread) ```bash python -m backend.train --steps 50000 --drift schema ``` Training starts the API in a background thread by default, so you can run `train` alone. Logs to W&B if `WANDB_API_KEY` is set. ### Demo (episode runner + Next.js) 1. **Run demo API** (from project root) ```bash python run_demo_api.py ``` Listens on port 8001 and starts the mock API on 8000 in a thread if not using Docker. 2. **Run frontend** ```bash cd demo/frontend && npm install --legacy-peer-deps && npm run dev ``` (Use `npm run dev:win` if you see NODE_OPTIONS errors on Windows.) Open http://localhost:3000, pick a drift type, and click "Run episode". **If you see** `--r= is not allowed in NODE_OPTIONS`: - **Dynatrace OneAgent** injects this. Use Docker (below) to run the frontend in an isolated contain