| --- |
| title: Smart Tiffin Packer |
| emoji: ๐ฑ |
| colorFrom: yellow |
| colorTo: green |
| sdk: docker |
| app_port: 7860 |
| pinned: false |
| --- |
| |
| # Smart Tiffin Packing Environment ๐ฑ๐ค |
|
|
| > **Semantic-aware constrained packing under real-world constraints** |
| > |
| > An OpenEnv-compliant RL environment where an LLM agent controls a robotic arm |
| > to pack an Indian tiffin meal. The agent uses VLM-derived food classification |
| > to reason about container compatibility, volume constraints, temperature zones, |
| > and fragility โ then physically executes packing decisions. |
|
|
| ## ๐ฏ What is this? |
|
|
| This environment simulates the real-world task of **packing an Indian meal into tiffin containers**. An AI agent must: |
|
|
| 1. **Identify** food items using a Vision-Language Model (VLM) |
| 2. **Reason** about which container each item should go into |
| 3. **Execute** packing commands via a robotic arm |
| 4. **Satisfy** multiple constraints simultaneously |
|
|
| ### Why Tiffin Packing? |
|
|
| Every day, millions of people in India pack tiffin boxes for lunch. It's a genuine spatial-reasoning task with real constraints: |
| - Liquids (sambar, dal) must go in sealed containers |
| - Fragile items (papad, chapati) shouldn't be crushed |
| - Hot and cold foods should be separated |
| - Volume limits mean you can't just stuff everything in one box |
|
|
| ## ๐๏ธ Architecture |
|
|
| ``` |
| LLM Agent (via OpenAI API) |
| โ |
| โโโ observe โ See scene description |
| โโโ identify โ VLM classifies food item |
| โโโ pick โ Robotic arm picks up food |
| โโโ place โ Place item in container |
| โโโ pour โ Pour liquid into container |
| โ |
| โผ |
| OpenEnv Server (FastAPI) |
| โ |
| โโโ Simulation Engine (logic + PyBullet physics) |
| โโโ VLM Classifier (cached food_db.json) |
| โโโ Task Manager (easy/medium/hard) |
| โโโ Deterministic Grader (0.0-1.0) |
| ``` |
|
|
| ## ๐ฎ Tasks |
|
|
| | Task | Items | Containers | Constraints | Difficulty | |
| |------|-------|-----------|-------------|------------| |
| | ๐ข Easy | rice, sambar (2) | sealed, flat (2) | Type matching | Straightforward | |
| | ๐ก Medium | rice, sambar, chapati, pickle (4) | sealed, flat, deep (3) | Types + overflow + temperature | Requires reasoning | |
| | ๐ด Hard | rice, sambar, curd, chapati, papad, curry (6) | sealed, flat, deep, small_sealed (4) | All constraints active | Genuinely challenging | |
| |
| ## ๐ Scoring (0.0 โ 1.0) |
| |
| | Component | Weight | Description | |
| |-----------|--------|-------------| |
| | Validity | 40% | Food placed in type-compatible container? | |
| | Efficiency | 30% | Space utilization vs capacity used | |
| | Constraints | 20% | Temperature, fragility, flavor isolation | |
| | Neatness | 10% | All items packed? Nothing dropped? | |
| |
| ## ๐ Quick Start |
| |
| ### Run locally |
| ```bash |
| pip install -r requirements.txt |
| uvicorn server.app:app --host 0.0.0.0 --port 7860 |
| ``` |
| |
| ### Run inference |
| ```bash |
| export API_BASE_URL=https://api.openai.com/v1 |
| export MODEL_NAME=gpt-4o |
| export HF_TOKEN=your-api-key |
| export ENV_URL=http://localhost:7860 |
| python inference.py |
| ``` |
| |
| ### Docker |
| ```bash |
| docker build -t tiffin-packer . |
| docker run -p 7860:7860 tiffin-packer |
| ``` |
| |
| ## ๐ง Action Space |
| |
| ```json |
| { |
| "command": "identify | pick | place | pour | observe", |
| "target_id": 1 |
| } |
| ``` |
| |
| ## ๐๏ธ Observation Space |
| |
| ```json |
| { |
| "scene_description": "Natural language scene state", |
| "food_items": [{"id": 1, "name": "rice", "status": "on_table", ...}], |
| "containers": [{"id": 1, "type": "sealed_round", "capacity_ml": 300, ...}], |
| "held_item": null, |
| "vlm_result": {"type": "solid", "fragility": 0.1, ...}, |
| "available_commands": ["observe", "identify", "pick"], |
| "step_feedback": "Successfully picked up rice" |
| } |
| ``` |
| |
| ## ๐ Project Structure |
| |
| ``` |
| tiffen-packer/ |
| โโโ openenv.yaml # OpenEnv manifest |
| โโโ inference.py # LLM inference script (OpenAI Client) |
| โโโ Dockerfile # HF Spaces deployment |
| โโโ tiffin_packer/ # Core package |
| โ โโโ models.py # Pydantic Action/Observation/State |
| โ โโโ simulation/ |
| โ โ โโโ engine.py # Logic simulation engine |
| โ โ โโโ pybullet_renderer.py # Physics visualization |
| โ โโโ vlm/ |
| โ โ โโโ classifier.py # VLM food classifier |
| โ โ โโโ food_db.json # 15 Indian food items |
| โ โโโ tasks.py # Easy/Medium/Hard task configs |
| โ โโโ grader.py # Deterministic scoring |
| โโโ server/ |
| โโโ tiffin_environment.py # OpenEnv Environment |
| โโโ app.py # FastAPI server |
| ``` |
| |
| ## ๐ OpenEnv Compliance |
|
|
| - โ
Typed Pydantic models (Action, Observation, State) |
| - โ
`step()` / `reset()` / `state()` API |
| - โ
`openenv.yaml` manifest |
| - โ
3 tasks with deterministic graders (0.0โ1.0) |
| - โ
Dense reward function with partial progress signals |
| - โ
Baseline inference script using OpenAI Client |
| - โ
Docker deployment for HF Spaces |
|
|
| ## ๐ฅ Team |
|
|
| **CtrlAltWin** โ Meta PyTorch OpenEnv Hackathon 2026 |
|
|
| ## ๐ License |
|
|
| MIT |
|
|