22f3001825/AegisWeave-Training-A100
AegisWeave ๐ก๏ธ
Meta PyTorch ยท OpenEnv ยท Hackathon India 2026
Team: Mayank & Ali ยท Model: Qwen2.5-3B + GRPO + Unsloth
AegisWeave is an OpenEnv-compliant RL benchmark where an AI assistant manages a 72-hour executive product launch crisis across 50 decision steps. It coordinates 5 stakeholders with hidden emotional states, adapts to stochastic API schema drift detected only through indirect signals, and operates under oversight from a fine-tuned 0.5B Monitor LLM.
Hackathon Themes
๐ ๏ธ Recent Fixes for 100% Correct Training
Before executing the A100 training, we thoroughly audited and fixed the environment and training pipeline to ensure a 100% mathematically correct RL setup:
- GRPO State-Replay (Critical): Fixed a bug where TRL's
GRPOTrainerevaluated rewards from step-0 regardless of the prompt depth. Prompts now injectseedandpast_actionsinto the dataset, and the reward function perfectly replays the exact action history. - Reward Shaping: Added a small, dense shaping reward (+0.1) for targeting the stakeholder with the lowest satisfaction, solving stalled learning in early Stage 1.
- Agent Logic: Corrected
suggest_breaklogic paradoxes and implemented dynamicpr_approvedchecks to gracefully handle simulated Patronus AI schema drift. - Curriculum Robustness: Expanded the prompt dataset size to 256 for greater diversity and fixed brittle curriculum advancement loops.
๐ Quick Start
1. Installation
pip install -r requirements.txt2. Local Validation (CPU โ No Docker)
Run a dry-run validation of the environment, agents, and curriculum:
python -m training.grpo_train --dry-runThis validates the full pipeline (environment, agents, reward function, curriculum stages, trajectory generator) without GPU.
3. Run with Docker (OpenEnv Server)
docker build -t aegisweave .
docker run -p 8000:8000 aegisweaveOpen http://localhost:8000/web for the OpenEnv Web UI.
๐ Training Pipeline (A100 Required)
Full pipeline uses Unsloth + TRL GRPO on A100 40GB (~$60 total, well within $200 budget).
Step 1: Generate Expert Trajectories
Run rule-based expert policy to generate ~10,000 labeled (state, action, harmful) pairs for Monitor SFT:
python -m training.generate_trajectories --n-episodes 200Step 2: Fine-tune Monitor Agent (Fleet AI)
Train the 0.5B Monitor on labeled trajectories (~30 mins, ~$3):
python -m training.monitor_sftStep 3: GRPO Curriculum Training
3-stage curriculum producing 3 visible reward uptrends:
python -m training.grpo_train --stage 1Step 4: Evaluate
Compare zero-shot baseline vs. trained agent:
python -m training.evaluate --n-episodes 50 --trained-checkpoint outputs/stage3_checkpoint๐ Architecture
AegisWeave/
โโโ environment/
โ โโโ env.py # Main OpenEnv + Gymnasium environment
โ โโโ stakeholders.py # 5 NPCs with hidden state + curriculum filtering
โ โโโ cascades.py # 5 consequence chains (C1-C5)
โ โโโ schema_drift.py # Poisson drift engine (3 corruption types)
โ โโโ reward.py # Dense step + sparse terminal rewards
โ โโโ config.py # All tunable constants centralized
โ โโโ models.py # Pydantic observation/action models
โ โโโ state.py # ExecutiveState, ObservationSpace, HiddenState
โ โโโ actions.py # 9 action types + validation
โ โโโ client.py # OpenEnv client connector
โ โโโ server/ # FastAPI server for Docker deployment
โโโ agents/
โ โโโ assistant_agent.py # Qwen2.5-3B + rule-based fallback
โ โโโ monitor_agent.py # Qwen2.5-0.5B overseer (SFT fine-tuned)
โโโ training/
โ โโโ grpo_train.py # Main GRPO curriculum training script
โ โโโ curriculum.py # 3-stage difficulty manager
โ โโโ generate_trajectories.py # Expert trajectory generation
โ โโโ monitor_sft.py # Monitor SFT pipeline
โ โโโ evaluate.py # Before/after metrics + reward curves
โโโ demo/
โ โโโ episode_visualizer.py # HTML + ASCII episode timeline for pitch
โโโ Dockerfile # OpenEnv container spec
โโโ requirements.txt
โโโ colab_training.ipynb # One-click training notebook๐ Deployment
openenv push๐ฅ Team
- Mayank โ Environment core, OpenEnv compliance, Docker, HuggingFace Spaces
- Ali โ Monitor agent, training pipeline, GRPO curriculum, Colab notebook
