modelbeast/scripts/install_launchagent.sh
MODELBEAST 19f086773e Headless control: mb CLI, AGENTS.md handover, serve scripts; verified-current image models
- mb: zero-dependency python CLI for the full API (ops/upload/run/wait/follow/
  download incl. folder assets, retry/cancel, settings). Schema-aware -p k=v
  coercion. Works from any tailnet machine via MB_HOST. Tested end-to-end
  (upload -> blender_convert -> download).
- AGENTS.md: complete handover brief for other agents using this box as an
  asset factory — endpoints, CLI reference, catalog, recipes, lanes/etiquette.
- scripts/serve.sh (headless start/restart) + scripts/install_launchagent.sh
  (optional boot persistence, owner-run)
- flux_local upgraded to mflux 0.18 reality: flux2-klein-4b default (Apache,
  UNGATED — runs with zero keys), klein-9b, schnell/schnell-4bit community
  quant, dev/krea-dev. Research verdict: FLUX.1-dev no longer competitive
  (Elo ~1027) vs klein ~1083-1119 vs nano-banana ~1154.
- openrouter_image rewritten to the dedicated Image API (POST /api/v1/images):
  b64_json parsing, seed, resolution/aspect, exact usage.cost logging; model
  enum: gemini-2.5-flash-image / 3.1-flash-image (NB2) / 3-pro-image

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:38:52 +10:00

32 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# OPTIONAL (owner runs this by hand): keep MODELBEAST running across reboots
# via a per-user LaunchAgent. Remove with:
# launchctl bootout gui/$(id -u)/com.modelbeast.server
# rm ~/Library/LaunchAgents/com.modelbeast.server.plist
set -euo pipefail
cd "$(dirname "$0")/.."
ROOT=$(pwd)
PLIST="$HOME/Library/LaunchAgents/com.modelbeast.server.plist"
mkdir -p "$HOME/Library/LaunchAgents" "$ROOT/data"
cat > "$PLIST" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>Label</key><string>com.modelbeast.server</string>
<key>ProgramArguments</key><array>
<string>/opt/homebrew/bin/uv</string>
<string>run</string><string>uvicorn</string><string>server.main:app</string>
<string>--host</string><string>0.0.0.0</string>
<string>--port</string><string>8777</string>
</array>
<key>WorkingDirectory</key><string>$ROOT</string>
<key>KeepAlive</key><true/>
<key>RunAtLoad</key><true/>
<key>StandardOutPath</key><string>$ROOT/data/server.log</string>
<key>StandardErrorPath</key><string>$ROOT/data/server.log</string>
</dict></plist>
EOF
launchctl bootout "gui/$(id -u)/com.modelbeast.server" 2>/dev/null || true
launchctl bootstrap "gui/$(id -u)" "$PLIST"
echo "LaunchAgent installed + started. Server will survive reboots."