SParsh003/LifeOS-Trained-Agent
0
1---2base_model: unsloth/mistral-7b-instruct-v0.3-bnb-4bit3tags:4- text-generation-inference5- transformers6- unsloth7- mistral8- trl9- openenv10- reinforcement-learning11- grpo12- agents13license: apache-2.014language:15- en16thumbnail: https://huggingface.co/spaces/SParsh003/LifeOS-Personal-Chaos-Agen/resolve/main/docs/reward_curves.png17---18 19# 🧬 LifeOS Trained Agent (Mistral-7B-Instruct-v0.3)20 2122 23This model was trained to survive the chaos of an unpredictable, stressful student week using **GRPO (Group Relative Policy Optimization)** within the [LifeOS OpenEnv](https://github.com/itzzSPcoder/LifeOS) simulation. 24 25It is a fine-tuned version of `mistralai/Mistral-7B-Instruct-v0.3` that has learned to balance multiple competing constraints—energy, stress, deadlines, social obligations, and budget—under conditions of high uncertainty (35% probability of random chaos events per step).26 27### 🏆 Meta OpenEnv Hackathon 2026 Submission28 29- **Live Demo (Interactive Space):** [SParsh003/LifeOS-Personal-Chaos-Agen](https://huggingface.co/spaces/SParsh003/LifeOS-Personal-Chaos-Agen)30- **Deep Dive Blog Post:** [Read the journey & methodology](https://huggingface.co/spaces/SParsh003/LifeOS-Personal-Chaos-Agen/blob/main/docs/hf_blog.md)31- **GitHub Repository:** [itzzSPcoder/LifeOS](https://github.com/itzzSPcoder/LifeOS)32- **Developed by:** Sparsh Bansal, Ayushika Verma, Aishani Mittal33- **License:** Apache 2.034 35---36 37## 🚀 Model Capabilities: Triage over Grinding38 39Most agents fail at long-horizon personal planning because they treat scheduling as a static puzzle. This agent was trained in a dynamic environment where pushing too hard leads to burnout (-1.5 penalty) and ignoring friends leads to social debt (-0.8 penalty).40 41**Key Behaviors Learned via RL:**421. **Proactive Recovery:** It learns to call the `rest` action *before* its energy drops to critical levels, avoiding burnout cascades.432. **Social Debt Management:** It prioritizes the `reply_message` action to maintain relationships, clearing unread messages before they heavily penalize the social coherence score.443. **Strategic Delegation:** It learns to use budget (₹) via `delegate_task` to offload low-priority work when energy is low and deadlines are looming.454. **Resilience to Chaos:** When a random chaos event (e.g., "Deadline moved up by 2 days") fires, it can pause, recover, and pivot its focus without collapsing.46 47---48 49## 📊 Training Methodology50 51The model was trained entirely using Reinforcement Learning (GRPO) from the `trl` library, without human-labeled preference data. We designed a multi-objective reward function to prevent reward hacking:52 531. **Task Completion:** +1.0 for finishing, -1.0 for missing deadlines.542. **Social Coherence:** Penalty for leaving messages unread.553. **Energy Sustainability:** +0.4 for proactive rest, -1.5 (Game Over) for burnout.564. **Format Compliance:** Strict adherence to valid JSON actions.57 58**Training Stack:**59- **Frameworks:** `unsloth` (for 2x faster, memory-efficient 4-bit LoRA training), `trl` (GRPO Trainer).60- **Compute:** Single Google Colab T4 GPU (free tier).61- **Episodes:** 30 training episodes, 30 steps each.62 6364 65---66 67## 💻 How to Use68 69This model is intended to be used as a policy agent within the **LifeOS OpenEnv framework**. It expects a highly structured observation prompt and is trained to output a specific JSON action schema preceded by an inner monologue block.70 71### Example Input (Observation):72```text73=== Step 14 / 30 ===74Vitals: Energy=35, Stress=7275Resources: Budget=₹1800, Relationships=0.6076Chaos Event: Assignment deadline moved up by 2 days!77Pending Tasks: 378Unread Messages: 179```80 81### Example Output (Agent Action):82```text83<thought>84Energy is at 35, which is dangerous territory. If I push to work on the urgent assignment now, I will hit 0 energy and burn out. I have enough budget to offload the minor task, but first I must rest to recover my vitals before tackling the big deadline.85</thought>86{87 "action_type": "rest",88 "reasoning": "Need to recover energy before prioritizing the urgent assignment."89}90```91 92---93 94## ⚙️ Loading the Model95 96You can load this model directly using Hugging Face `transformers` or `unsloth` for faster inference.97 98```python99from unsloth import FastLanguageModel100 101model, tokenizer = FastLanguageModel.from_pretrained(102 model_name = "SParsh003/LifeOS-Trained-Agent",103 max_seq_length = 2048,104 dtype = None,105 load_in_4bit = True,106)107 108FastLanguageModel.for_inference(model)109 110prompt = """... (insert LifeOS observation here) ..."""111inputs = tokenizer([prompt], return_tensors="pt").to("cuda")112 113outputs = model.generate(**inputs, max_new_tokens=256)114print(tokenizer.decode(outputs[0], skip_special_tokens=True))115```116 117This model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) 🦥.118 