This doc is the memory/handoff for Claude (and the team). It captures the architecture, the decisions already made (and WHY — so we don't repeat dead ends), current state, and the prioritized work left to win the HUD/YC RSI RL-Environments hackathon.
A verifiable warehouse RL environment that improves a frontier model at fleet coordination via RFT — train fast PPO "muscle," let an LLM be the "brain" (dispatch), and use the env's reward to fine-tune the brain and prove it got better. Judges reward environments that improve frontier models, NOT a good PPO controller.
- PPO policy = low-level robot motion (reflexes). Small net, NOT a frontier model. Already trained (~41 orders/episode, missing ~1–4). Shown in the pygame demo.
- LLM coordinator = high-level dispatch (brain): assigns idle robots →
(order, rack). This is the frontier model we RFT. Plugged in via
env.dispatcher. - Environment =
WarehouseEnv(Gymnasium). Verifiable reward = orders ↑, missing-item alerts ↓, collisions ↓. This is the product.
| File | Role |
|---|---|
warehouse_core.py |
grid, pods/racks (+stock qty), 20 SKUs, OrderQueue+trending, AlertSystem, BFS |
warehouse_env.py |
WarehouseEnv (6 robots, 25-dim obs, 7 actions), rewards, deadlock-breaker, dispatcher hook, ParameterSharingVecEnv, gym.register("Warehouse-v0"), # HUD_HOOKs |
train.py / modal_train.py |
local / Modal-cloud PPO training |
visualize.py |
pygame demo (pods, robots carry tower, monitor, pickers, fallen-item alerts, click-to-inspect robot & rack, AI-reasoning panel w/ action probs, live RL log) |
llm_agent.py |
FireworksCoordinator (Minimax M3) + MockCoordinator + prompts |
eval_agents.py |
verifiable leaderboard: heuristic vs base-LLM vs --ft-model |
hud_warehouse.py |
HUD (v6) integration: dispatch decision as a HUD task with a verifiable reward; evaluate_local() for free offline scoring |
rft_dataset.py |
builds SFT dataset from teacher rollouts → data/*.jsonl |
rft_finetune.py |
validates dataset + prints Fireworks fine-tune steps |
env_setup.py |
loads .env, reports sponsor keys |
- Open floor (robots drive UNDER pods).
is_walkable= in-bounds only. ❌ Do NOT make carrying robots collide with pods — tested, it turns delivery into a maze the reactive PPO can't learn: orders crashed 32 → 9. Reverted. Humans (tall) DO respect pods viais_walkable_human. - Collision penalties moderate: robot −5, human −8 (NOT the spec's −100/−50 — those make PPO freeze to avoid moving). Human penalized more than robot on purpose.
- Pickup/drop auto-fire on arrival; delivery triggers within manhattan ≤ 2 of picker (avoids single-cell gridlock). Dense shaping: progress +1.0/cell, pickup +2.0.
- Deadlock-breaker (
_break_deadlocks) nudges stuck robots → no permanent gridlock. - 6 robots; policy is per-agent (obs fixed 25-dim) so it works for any N without retrain.
- Item drops scale with collisions (jostle) → smoother policy = fewer missing alerts.
- LLM models: Minimax M3 ≈ 1s/call (good). Qwen3.7 = slow reasoning model (~60s, avoid).
Serverless rate limit is low → 429s; throttle with
every=N(eval default 3). - RFT dataset prompt MUST match eval prompt (
SYSTEM_PROMPT+_build_user_prompt). - Fine-tune base must be a "Tunable (LoRA)" model (Qwen3.7 Plus is not tunable).
- Modal auth =
~/.modal.toml(token set), not.env. WarehouseEnv.reset()preservesdispatcher,human_random, andauto_heuristic_dispatch(all set in__init__).- HUD =
hud_warehouse.py(NOT the old inventedhud.wrap/hud.runhooks).- HUD v6 task protocol in the installed SDK is single-turn: template yields ONE prompt, agent answers, the template's NEXT yield is the numeric grade. Yielding a 2nd prompt (string) before the grade -> error "task graded with str". So the task is one decision: warm to a busy state -> agent dispatches -> grade = orders fulfilled / target (a trending-item assign hovers & snowballs).
WarehouseEnv.auto_heuristic_dispatch=Falsemakes the AGENT the sole dispatcher (heuristic no longer auto-fills idle robots) -> the agent's call actually moves the reward (no-op 0.0 vs greedy ~0.87). Default True elsewhere.- CREDITS: HUD bills only model calls through its gateway
(
inference.beta.hud.ai). Provider-direct (Fireworksbase_url+api_key,--runtime local, no--gateway) = 0 HUD credits; only telemetry traces hit the platform. We have ~10 credits -> dev/test on Fireworks, spend HUD credits only on the oneclaude/gateway demo trace. No CLI balance command; check the hud.ai dashboard.
| Sponsor | Status | Notes |
|---|---|---|
| Fireworks | ✅ working | Minimax M3 coordinator; RFT dataset ready (1,438 ex). $506 credits. |
| MiniMax | ✅ (indirect) | We use Minimax M3 as the agent — counts toward MiniMax too. |
| Modal | ✅ working | authed; cloud train + volume download validated. $251 credits. |
| Antim Labs (GIZMO) | 🟡 in progress | generating 3D warehouse assets (AMR, box, picker, light); storage-pod gen FAILED — retry. $200. For demo video / sim-to-real story. |
| HUD | ✅ working | hud_warehouse.py: dispatch as a HUD v6 task, verifiable reward. Validated end-to-end (reward 0.867, 100% success) via Fireworks-direct local eval = 0 HUD credits. Only ~10 HUD credits available -- protect them (see gotchas). |
| Anthropic | ⏭️ skipped | no credits; Fireworks is the agent. |
| Hillclimb / Protege | 💡 optional angle | "training data for RSI" / "real-world datasets" — our RFT dataset story aligns; mention if asked. |
| Daytona / Exa / SixtyFour / DeepMind | — | not used; not core. |
- Run the actual RFT fine-tune (Fireworks dashboard) → get ft model id →
eval_agents.py --fireworks --ft-model <id>→ capture the base-vs-FT leaderboard. This is the headline result; everything else supports it. HUD integration✅ DONE:hud_warehouse.py(HUD v6 task, verifiable reward, validated via Fireworks-direct = 0 HUD credits). Remaining: spend ONE HUD credit on aclaude/gateway run to get the dashboard trace for the demo; optionallyhud eval ... --ft-model <id>to score the fine-tuned model on HUD.- Demo video + slides (use GIZMO 3D assets): show the sim, then the leaderboard improvement. ~2–3 min.
- Full 1M Modal run for a stronger cloud model + visible Modal usage.
- Strengthen the result (optional but high-value):
- reward-filtered dataset (
--min-reward) so RFT = rejection sampling, not imitation. - more eval episodes/seeds + report mean ± spread (credibility).
- a HARD task variant where heuristics are weak (e.g. rack-handoff: stage hot pods near pickers) so the fine-tuned model can clearly BEAT the heuristic.
- reward-filtered dataset (
- README polish tying env + eval + RFT + sponsors together for the repo.
The nearest-rack heuristic is strong, so a base LLM ties it. The win is the loop: verifiable env → reward-filtered post-training data → fine-tune → measured gain. If you want "model beats heuristic," build the hard task (#5) where planning matters.
Read this file + RUNBOOK.md + PITCH.md. Current model: models/ppo_warehouse.zip
(local 1M, ~41 orders). Dataset: data/warehouse_dispatch_sft.jsonl. Next action:
help the user run/interpret the Fireworks fine-tune, then build the HUD wrapper.