ace3848w34u32y/restaurant-kitchen
Restaurant Kitchen Simulator — OpenEnv RL Environment
A restaurant kitchen management simulation for OpenEnv. The agent acts as a kitchen manager — assigning incoming orders to cooking stations, timing preparations, and serving customers before their patience runs out.
Built for the Meta PyTorch OpenEnv Hackathon x Scaler School of Technology — Round 1.
How It Works
The kitchen has 4 stations: grill, fry, prep, and plate. Orders arrive randomly (0-2 per tick) and each order type requires a specific station. The agent needs to:
- Assign queued orders to the correct cooking station
- Serve orders once they're ready, before customers walk out
- Clean dirty stations (each serve adds dirt; dirty stations burn orders)
- Balance all of this across a 100-tick shift
Reward Logic
Graders
Quick Start
Local dev
cd restaurant-kitchen
uv sync && uv run server
uvicorn server.app:app --host 0.0.0.0 --port 8000 --reloadHealth check:
curl http://localhost:8000/healthVisual simulator UI:
http://localhost:8000/simRun the training demo
uv run python train.pyThis runs 50 episodes each of a random agent and a rule-based (greedy) agent, then compares the results. You should see the rule-based agent significantly outperform random — proof the env has a learnable signal.
Docker
docker build -t restaurant-kitchen:latest -f server/Dockerfile .
docker run -d -p 8000:8000 restaurant-kitchen:latestDeploy to Hugging Face
openenv push --repo-id username/restaurant-kitchenAfter deploy, open:
https://<your-space>.hf.space/simAction Space
Use order_id=-1 to pick the oldest queued order automatically.
Order Types
Architecture
restaurant-kitchen/
├── models.py # Pydantic: OrderItem, KitchenObservation, KitchenState
├── client.py # WebSocket client
├── server/
│ ├── environment.py # Core: reset(), step(), state(), graders
│ ├── app.py # FastAPI routing
│ └── Dockerfile # Container config
├── train.py # Training demo (random vs greedy)
├── openenv.yaml # Environment manifest
└── pyproject.toml # Package configTech Stack
- Python 3.11+
- OpenEnv — RL environment framework
- Pydantic — Type-safe models
- FastAPI + Uvicorn — Async WebSocket server
- Docker
Known Limitations
- No per-order wait time tracking — the efficiency grader just measures throughput ratio, not actual average wait. Would need a redesign to track timestamps.
- Single-process simulation — while sessions are isolated and concurrent, all env execution still runs in one server process by default. Horizontal scaling needs multi-replica deployment.
- Single-agent only — the kitchen runs one agent making all decisions. Real kitchens have multiple chefs.
- Fixed difficulty — no configurable parameters via openenv.yaml yet. Rush hours, order mix, and patience ranges are hardcoded.
- HTTP API is stateless — each /reset or /step call creates a fresh environment. Full WebSocket sessions would be needed for multi-step episodes via API.
Future Work
- [ ] Integrate with TRL's GRPOTrainer for actual RL training
- [ ] Per-order wait time tracking for finer-grained reward signals
- [ ] Multi-agent support (separate agents per station)
- [ ] Configurable difficulty via openenv.yaml
- [ ] Training with PPO/GRPO
License
MIT — Built for the Meta PyTorch OpenEnv Hackathon 2026.
