Skip to content

v4.0.0-beta: Ollama + Project Reorganization + Smart Model Saving

Latest

Choose a tag to compare

@dzaczek dzaczek released this 17 Feb 18:26
· 2549 commits to main since this release

What's new

Project Reorganization

  • Gen2 code promoted to repository root — no more gen2/ prefix
  • Gen1 archived to old/ (untracked)
  • Security-hardened .gitignore — secrets, model weights, logs, and debug artifacts are all excluded

Ollama Support (Local LLM)

AI Supervisor now supports Ollama as a provider — run hyperparameter tuning with local models, no API key needed:

python trainer.py --resume --ai-supervisor ollama
  • Configurable via OLLAMA_HOST and OLLAMA_MODEL env vars
  • Default model: llama3.1
  • Uses stdlib urllib — no extra dependencies

Smart Best Model Saving

Best model checkpoints are now saved based on fitness (survival + food) instead of raw reward:

fitness = avg_steps + avg_food × 10
  • File naming: best_model_{uid}_ep{ep}_s{steps}_f{food}.pth
  • Steps (survival time) dominate the score, food amplifies it
  • Prevents saving "lucky" models that got high reward from a single good episode

Stage 1 Extended Episodes

  • max_steps increased from 300 → 600 (~48 sec instead of ~24 sec)
  • Gives the snake more time to learn food-seeking behavior before episode timeout

AI Supervisor in Progress Report

  • New "AI Supervisor — Recent Changes" table at the bottom of progress_report.md
  • Shows last 10 consultations: time, episode, parameter changes, reasoning
  • Tracks most frequently adjusted parameters

TUI Dashboard

  • Added screenshot of the training TUI to README

Training Dashboard

Providers supported

Provider Flag API Key Required
Claude --ai-supervisor claude Yes (ANTHROPIC_API_KEY)
OpenAI --ai-supervisor openai Yes (OPENAI_API_KEY)
Gemini --ai-supervisor gemini Yes (GOOGLE_API_KEY)
Ollama --ai-supervisor ollama No

Full changelog

  • Reorganize: gen2/ → root, gen1/ → old/
  • .gitignore: block .env, *.pth, logs/, config_ai.json, .claude/, chart_*.png
  • ai_supervisor.py: add _call_ollama() via urllib.request
  • trainer.py: fitness-based best model saving, ollama in --ai-supervisor choices
  • styles.py: S1 max_steps 300 → 600
  • training_progress_analyzer.py: parse ai_supervisor.log, render changes table in MD report
  • auto_report.sh: fix paths after reorganization (remove gen2/ prefix)
  • README.md: add TUI screenshot, update AI supervisor docs for Ollama