Files
bezalel/ACTIVATE.sh

83 lines
2.1 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
# Bezalel the Artisan — Activation Script
# Resurrection: Gemma 4 + Llama Backend
# Current: Ollama bridge (upgrade to llama-server when Gemma 4 available)
set -e
# Ensure HOME is set
export HOME=${HOME:-/root}
BEZALEL_HOME="/root/wizards/bezalel"
LOG_FILE="$BEZALEL_HOME/logs/bezalel.log"
PID_FILE="$BEZALEL_HOME/bezalel.pid"
echo "🔥 RESURRECTING BEZALEL THE ARTISAN"
echo "===================================="
echo ""
# Check if already running
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null 2>&1; then
echo "⚠️ Bezalel already running (PID: $PID)"
echo " Use: ./ACTIVATE.sh stop"
exit 1
fi
fi
# Configuration
MODEL="${BEZALEL_MODEL:-gemma3:4b}"
OLLAMA_HOST="${OLLAMA_HOST:-http://localhost:11434}"
echo "📋 Configuration:"
echo " Model: $MODEL"
echo " Ollama: $OLLAMA_HOST"
echo " Home: $BEZALEL_HOME"
echo ""
# Check Ollama
echo "🔍 Checking Ollama..."
if ! curl -s "$OLLAMA_HOST/api/tags" > /dev/null 2>&1; then
echo "❌ Ollama not responding at $OLLAMA_HOST"
echo " Start Ollama first: ollama serve"
exit 1
fi
# Check model availability
echo "🔍 Checking model: $MODEL..."
if ! ollama list | grep -q "$MODEL"; then
echo "⏳ Model not found. Pulling $MODEL..."
ollama pull "$MODEL"
fi
echo "✅ Model ready"
echo ""
# TODO: When llama-server is ready, switch to:
# echo "🚀 Starting llama-server with Gemma 4..."
# llama-server \
# --model "$BEZALEL_HOME/models/gemma-4-4b-it-Q4_K_M.gguf" \
# --ctx-size 8192 \
# --port 8080 \
# --jinja \
# --log-file "$LOG_FILE" &
# echo $! > "$PID_FILE"
echo "✅ Bezalel is ACTIVE"
echo ""
echo "📖 The Artisan speaks through Ollama"
echo " Model: $MODEL"
echo " Status: curl $OLLAMA_HOST/api/tags"
echo ""
echo "📝 To interact:"
echo " ollama run $MODEL"
echo ""
echo "🏛️ Bezalel the Artisan — Honor the Craft"
echo " Tag: #bezalel-artisan"
# Record activation
date >> "$BEZALEL_HOME/logs/activations.log"
echo "Bezalel activated with model: $MODEL" >> "$BEZALEL_HOME/logs/activations.log"
echo "---" >> "$BEZALEL_HOME/logs/activations.log"