Files
Clawd BotandClaude Opus 4.6 ca9b510922 chore: align with upstream openclaw/openclaw and overlay local additions
- Reset master to upstream/main (16,697 commits)
- Overlay 2,271 local-only files (skills, tools, workspace, configs, apps)
- Restore IDENTITY.md and USER.md templates
- Build verified, gateway running, Discord working

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-03 07:40:46 +01:00

69 lines
1.8 KiB
Bash

#!/usr/bin/env bash
# gpu-lara.sh — Spin up/down Ollama on gaming PC (192.168.1.10)
# Usage: gpu-lara up | down | status | run "prompt"
GAMING_PC="192.168.1.10"
OLLAMA_PORT="11434"
up() {
echo "🎮 Starting Ollama on gaming PC..."
if ! ping -c1 -W2 "$GAMING_PC" &>/dev/null; then
echo "❌ Gaming PC offline ($GAMING_PC)"
return 1
fi
ssh "$GAMING_PC" "sudo systemctl start ollama" 2>/dev/null
# Wait for ready
for i in {1..10}; do
if ssh "$GAMING_PC" "curl -sf http://localhost:$OLLAMA_PORT/api/tags" &>/dev/null; then
echo "✅ Ollama ready (${i}s)"
# Pre-load model
ssh "$GAMING_PC" "ollama run glm-4.7-flash '/no_think ping' 2>/dev/null" &>/dev/null &
echo "🎮 GLM-4.7-Flash loading..."
return 0
fi
sleep 1
done
echo "❌ Ollama failed to start"
return 1
}
down() {
echo "🎮 Stopping Ollama on gaming PC..."
ssh "$GAMING_PC" "sudo systemctl stop ollama" 2>/dev/null
echo "✅ GPU freed — game on"
}
status() {
if ! ping -c1 -W2 "$GAMING_PC" &>/dev/null; then
echo "❌ Gaming PC offline"
return 1
fi
local ps
ps=$(ssh "$GAMING_PC" "ollama ps 2>/dev/null")
if echo "$ps" | grep -q "glm-4.7-flash"; then
echo "🎮 Lara online — GLM-4.7-Flash loaded"
echo "$ps"
elif ssh "$GAMING_PC" "systemctl is-active ollama" &>/dev/null; then
echo "🎮 Ollama running (no model loaded)"
else
echo "💤 Ollama stopped — GPU free"
fi
}
run_prompt() {
# Auto-start if needed
if ! ssh "$GAMING_PC" "curl -sf http://localhost:$OLLAMA_PORT/api/tags" &>/dev/null; then
up || return 1
sleep 3
fi
ssh "$GAMING_PC" "ollama run glm-4.7-flash '$1'"
}
case "${1:-status}" in
up) up ;;
down) down ;;
status) status ;;
run) run_prompt "$2" ;;
*) echo "Usage: gpu-lara up|down|status|run \"prompt\"" ;;
esac