ace3848w34u32y/grid-world-navigator
0
Grid World Navigator — OpenEnv Mini RL Environment
A Mini Reinforcement Learning environment where an agent navigates a grid world to reach a goal while avoiding walls. Built for the Meta PyTorch OpenEnv Hackathon x Scaler School of Technology — Round 1.
🎯 Tasks
- Navigate from a random start position to the goal (bottom-right corner)
- Avoid wall collisions (walls are randomly placed)
- Minimize steps taken (shortest path is rewarded)
🏆 Graders
💰 Reward Logic
🏗️ Architecture
Follows the OpenEnv 3-component pattern:
grid-world-navigator/
├── models.py # Pydantic models: GridAction, GridObservation, GridState
├── client.py # WebSocket client communication
├── server/
│ ├── environment.py # Core logic: reset(), step(), state(), graders
│ ├── app.py # FastAPI routing
│ └── Dockerfile # Containerization
├── openenv.yaml # Environment manifest
├── pyproject.toml # Python package config
└── requirements.txt # Dependencies🚀 Quick Start
Local Development
cd grid-world-navigator
uv sync && uv run server
# Or with uvicorn directly:
uvicorn server.app:app --host 0.0.0.0 --port 8000 --reloadTest health:
curl http://localhost:8000/healthDocker
docker build -t grid-world-navigator:latest -f server/Dockerfile .
docker run -d -p 8000:8000 grid-world-navigator:latestDeploy to Hugging Face
openenv push --repo-id username/grid-world-navigator🎮 Action Space
📐 Observation Space
The agent receives a GridObservation containing:
grid: 5x5 2D list (0=empty, 1=wall, 2=goal, 3=agent)agent_pos: [row, col] of the agentgoal_pos: [row, col] of the goalsteps_taken: number of steps so farmessage: feedback string
📋 API Methods
🛠️ Tech Stack
- Python 3.11+
- OpenEnv — Standardized RL environment framework
- Pydantic — Type-safe data models
- FastAPI + Uvicorn — Async WebSocket server
- Docker — Containerization
📜 License
MIT — Built for the Meta PyTorch OpenEnv Hackathon 2026.
