From 435af8ccc925b180e78919cc0591dd8420691477 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Wed, 1 Jul 2026 04:02:30 -0500 Subject: [PATCH] Wire Ollama properly: fix IP, upgrade to llama3.1:8b, use for guardian/sitrep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - reactor.py: fix OLLAMA_HOST .95 → .210 (actual Ollama VM IP) - reactor.py: upgrade OLLAMA_MODEL 1b → 8b (llama3.1:8b has tool-calling, 131K ctx) - reactor.py: guardian alerts and sitrep now use ollama instead of groq (free, on-LAN, no quota) - config.example.php: same IP/model fixes + fix GROQ_MODEL_SEARCH to compound-beta-mini (groq/ prefix causes 404) - deploy script: patch live config.php on every deploy to correct Ollama IP/model and Groq model name Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01X8tDRrQqgLjqXebMCBNcP3 --- api/config.example.php | 8 ++++---- deploy/jarvis-deploy.sh | 12 ++++++++++++ deploy/reactor.py | 8 ++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/api/config.example.php b/api/config.example.php index ca1968b..2fed500 100644 --- a/api/config.example.php +++ b/api/config.example.php @@ -18,13 +18,13 @@ define(chr(39)+'CLAUDE_MODEL'.chr(39), chr(39)+'claude-sonnet-4-6'.chr(39)) define(chr(39)+'CLAUDE_MAX_TOKENS'.chr(39), 1024); define(chr(39)+'GROQ_API_KEY'.chr(39), chr(39)+'gsk_...'.chr(39)); -define(chr(39)+'GROQ_MODEL_SEARCH'.chr(39), chr(39)+'groq/compound-mini'.chr(39)); +define(chr(39)+'GROQ_MODEL_SEARCH'.chr(39), chr(39)+'compound-beta-mini'.chr(39)); define(chr(39)+'GROQ_MODEL_GENERAL'.chr(39), chr(39)+'llama-3.3-70b-versatile'.chr(39)); define(chr(39)+'GROQ_TIMEOUT'.chr(39), 30); -define(chr(39)+'OLLAMA_HOST'.chr(39), chr(39)+'http://10.48.200.95:11434'.chr(39)); -define(chr(39)+'OLLAMA_MODEL_PRIMARY'.chr(39), chr(39)+'llama3.2:1b'.chr(39)); -define(chr(39)+'OLLAMA_MODEL_HEAVY'.chr(39), chr(39)+'llama3.1:70b'.chr(39)); +define(chr(39)+'OLLAMA_HOST'.chr(39), chr(39)+'http://10.48.200.210:11434'.chr(39)); +define(chr(39)+'OLLAMA_MODEL_PRIMARY'.chr(39), chr(39)+'llama3.1:8b'.chr(39)); +define(chr(39)+'OLLAMA_MODEL_HEAVY'.chr(39), chr(39)+'llama3.1:8b'.chr(39)); define(chr(39)+'OLLAMA_TIMEOUT'.chr(39), 90); define(chr(39)+'LOCAL_SUBNET'.chr(39), chr(39)+'10.48.200'.chr(39)); diff --git a/deploy/jarvis-deploy.sh b/deploy/jarvis-deploy.sh index eb5f936..531bd8a 100755 --- a/deploy/jarvis-deploy.sh +++ b/deploy/jarvis-deploy.sh @@ -80,6 +80,18 @@ while IFS= read -r path; do systemctl reload lsws 2>/dev/null || systemctl restart lsws 2>/dev/null log "OLS reloaded for JARVIS deploy" + # Patch live config.php with correct Ollama host/model and Groq search model + CONFIG="$path/api/config.php" + if [ -f "$CONFIG" ]; then + sed -i "s|http://10\.48\.200\.95:11434|http://10.48.200.210:11434|g" "$CONFIG" + sed -i "s|'llama3\.2:1b'|'llama3.1:8b'|g" "$CONFIG" + sed -i "s|\"llama3\.2:1b\"|\"llama3.1:8b\"|g" "$CONFIG" + sed -i "s|'llama3\.1:70b'|'llama3.1:8b'|g" "$CONFIG" + sed -i "s|\"llama3\.1:70b\"|\"llama3.1:8b\"|g" "$CONFIG" + sed -i "s|'groq/compound-mini'|'compound-beta-mini'|g;s|\"groq/compound-mini\"|\"compound-beta-mini\"|g" "$CONFIG" + log "Patched config.php: Ollama IP→.210, model→llama3.1:8b, Groq search→compound-beta-mini" + fi + # Sync reactor.py + service file to runtime location if they changed if echo "$CHANGED" | grep -q 'deploy/reactor.py\|deploy/jarvis-arc.service'; then mkdir -p /opt/jarvis-arc diff --git a/deploy/reactor.py b/deploy/reactor.py index 01ee171..ffa89cd 100644 --- a/deploy/reactor.py +++ b/deploy/reactor.py @@ -49,8 +49,8 @@ CLAUDE_API_KEY = "sk-ant-api03-JL6vjFeyEfajQmaTOmsT6AfLLPs2icrIAvvJ0hdi4DuMi0155 CLAUDE_MODEL = "claude-sonnet-4-6" GROQ_API_KEY = "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" GROQ_MODEL = "llama-3.3-70b-versatile" -OLLAMA_HOST = "http://10.48.200.95:11434" -OLLAMA_MODEL = "llama3.2:1b" +OLLAMA_HOST = "http://10.48.200.210:11434" +OLLAMA_MODEL = "llama3.1:8b" GMAIL_USER = "myronblair@gmail.com" GMAIL_PASS = "demsvdylwweacbcx" @@ -1022,7 +1022,7 @@ async def guardian_loop() -> None: "for Myron. Be direct about severity and what action to take. " "No markdown, no headers." ) - ai_msg = await llm_call([{"role": "user", "content": ai_prompt}], "groq") + ai_msg = await llm_call([{"role": "user", "content": ai_prompt}], "ollama") # Update the most recent guardian event with AI analysis await db_execute( """UPDATE guardian_events SET ai_analysis=%s @@ -1065,7 +1065,7 @@ async def handle_sitrep(payload: dict) -> dict: payload: { detail: brief|full, provider: groq } """ detail = payload.get("detail", "full") - provider = payload.get("provider", "groq") + provider = payload.get("provider", "ollama") log.info(f"[GUARDIAN] SITREP requested (detail={detail})")