- Update all 20 personas in nn_train.py and nn_selfimprove.py to match
enhanced personas.yaml (corrected names, ages, traits, occupations)
- Add persona-specific behavioral patterns: night shift schedule (George),
nightly bar routine (Frank), crush proximity (Lila→Elena), taxi wandering
(Omar), overworked doctor (Priya), morning exercise (Marcus/Yuki), etc.
- Add persona-aware needs generation, mood calculation, starting locations
- Add training graph plots (loss + accuracy curves) after training
- Add --graph flag to display graphs from last training run
- Decouple --push from training (push existing model without retraining)
- Add POST /api/nn/reload endpoint for hot-reloading ONNX model from HF Hub
- NNClient.reload() deletes cache, re-downloads, swaps ONNX session in-place
- Both scripts auto-trigger /api/nn/reload after pushing to HF Hub
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add life events, goals, pregnancy system; fix profile editor bugs
- Life events: append-only timeline seeded from persona, extended by
LLM reflections and romance milestones (dating/engaged/married/birth)
- Goals: personal aspirations with progress tracking, managed by LLM
reflections (add/complete/progress)
- Pregnancy: married couples can conceive, birth after ~7 sim-days,
baby names, both parents get memories and life events
- Agent context: LLM now sees life story, goals, children, pregnancy
- Fix profile editor: fetch full agent detail instead of WS summary
(occupation, background, personality sliders now load correctly)
- Fix Go dropdown: only rebuild when empty, preserves user selection
- Fix WS state summary: include age, occupation, daily_plan, is_player
- NN self-improve: track accuracy in training_stats.json, compare with
previous model on push
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix quota runtime estimates: use RPM as bottleneck, sync top probability slider
- Runtime estimate now based on RPM (Gemini 4 RPM = 240 calls/h, ~6.25h for 1500 RPD)
not probability, which barely affects duration with 50 agents
- Remove misleading per-probability runtime table from popup
- Show RPM and single accurate runtime estimate instead
- Fix ID collision between top slider and popup slider (use class selectors)
- Sync top probability slider when switching provider via popup
- Expose RPM and max_calls_per_hour in /api/llm/quota per-provider data
- Update nn_selfimprove budget calculations to use RPM-based math
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add quota-aware LLM switching: budget calculator, probability slider, Gemini/Groq support
- Add GET /api/llm/quota endpoint exposing per-provider daily quota (Gemini 1500 RPD, Groq 14400 RPD)
- Add personality/home/work fields to agent detail API for NN training data collection
- Fix nn_selfimprove: /api/agents returns dict not list, correct probability endpoint path
- Fix Gemini scheduled reset to 10:00 AM Athens instead of midnight
- Add 'budget' CLI mode to calculate and apply optimal probability for target duration
- Scheduled mode now auto-calculates probability from remaining quota
- Frontend: rate-limited providers (Gemini/Groq) show quota badge and expand a panel
with runtime estimates table, probability slider, and confirm button before switching
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diversify agent activities, add local training script, scheduled Gemini cycle, architecture diagram
- routine.py: Add morning/post-work exercise, park lunch, sports_field for more
personality types, varied activity descriptions, park as exercise destination
- nn_train.py: Standalone local training script (equivalent to Kaggle notebook)
with synthetic data gen, ONNX export, HF push, CUDA support
- nn_selfimprove.py: Add 'scheduled' mode for nightly Gemini collection + retrain,
oversample LLM-sourced samples 3x during training
- routes.py: Fix valid providers list (nn instead of hf)
- docs/architecture.html: SVG diagram of SociAgentTransformer architecture
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add NN self-improvement pipeline: collect, train, push
scripts/nn_selfimprove.py — three-step pipeline:
1. collect: polls the live HF Space simulation, records (state, action)
pairs from all agents each tick as labeled training samples
2. train: retrains the SociAgentTransformer on collected + synthetic data,
exports to ONNX
3. push: uploads the improved model to RayMelius/soci-agent-nn on HF Hub
Usage:
python scripts/nn_selfimprove.py collect --minutes 60
python scripts/nn_selfimprove.py train --epochs 20
python scripts/nn_selfimprove.py push
python scripts/nn_selfimprove.py all # full pipeline
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix GGUF export: clone llama.cpp for bundled gguf-py; update Modelfile
- Clone llama.cpp shallow repo instead of downloading single script;
its bundled gguf-py is always in sync with convert_hf_to_gguf.py,
fixing MistralTokenizerType import error against PyPI gguf 0.17.1
- Add PYTHONPATH override so convert picks up llama.cpp's gguf-py
- Modelfile FROM now points to 7b-q4_k_m.gguf (4683 MB, Q4_K_M)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add GGUF export script for Windows (merge LoRA + quantise)
scripts/export_gguf_windows.py pipeline:
1. Load LoRA adapters via Unsloth, merge to 16-bit safetensors
2. Download convert_hf_to_gguf.py from llama.cpp (cached)
3. Convert merged model → F16 GGUF
4. Quantise F16 → Q4_K_M via llama_cpp.llama_model_quantize
5. Update Modelfile FROM to point at the new GGUF
6. Optionally push GGUF to HF Hub (--push flag)
Supports --model 0.5b/1.5b/3b/7b/8b and --quant f16/q4_k_m/q5_k_m/q8_0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add multi-model support to fine-tune pipeline (0.5b–8b)
- New --base-model flag: 0.5b (default), 1.5b, 3b, 7b, 8b
- Model profiles: unsloth IDs, HF repo names, per-model VRAM settings
- Per-model subdirs (data/training/<size>/) prevent run collisions
- 7b/8b use r=8, q+v only, seq=512, batch=1 for RTX 4050 VRAM budget
- Resume and history per-model rather than global
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Soci fine-tuned model and training data pipeline
- Add RayMelius/soci-agent-q4 (fine-tuned Qwen2.5-0.5B) to HF provider list
- Add soci-agent as named Ollama option for GGUF-loaded model
- Add MODEL_HF_SOCI and MODEL_OLLAMA_SOCI constants to llm.py
- Persist conversation_history in simulation snapshots (to_dict/from_dict)
- scripts/collect_training_data.py: poll Render API, save raw JSONL
- scripts/convert_to_training_jsonl.py: convert to SFT chat format
- scripts/finetune_local.py: local Unsloth fine-tune (RTX 4050, Windows-safe)
Fixes: transformers 4.56 list_repo_templates patch, TORCHINDUCTOR_DISABLE
Round 1: 116 examples, 3 epochs, loss 1.9222, LoRA -> RayMelius/soci-agent-q4
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>