ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / ops/m4/gateway-backend.sh

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / ops/m4/gateway-backend.sh
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberops/m4/gateway-backend.sh
Original SHA-256d61acdd359683b815472fa59467292134d07823744464a11676a966209135278
Git blob SHA0dd471d20462f70c29711f99debaa4fdd0e78a34
Reading-copy SHA-256d61acdd359683b815472fa59467292134d07823744464a11676a966209135278

Original source ↗

Every recorded occurrence

These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / ops/m4/gateway-backend.shfeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / ops/m4/gateway-backend.shfeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original

Recovered source transcript

#!/bin/bash # Flip the missionMATCH generation runtime the MEGAMIND gateway proxies, then verify it. # # gateway-backend.sh ollama the local Ollama binary (default, no Python, Metal accelerated) # gateway-backend.sh mlx the external MLX server on 8081 (Apple Silicon, fastest on an M chip) # gateway-backend.sh megamind the MEGAMIND reasoning brain on 9999 (answers from its own learned corpus) # # Embeddings ALWAYS stay on Ollama's bge model so the stored vectors and the boot vector gate keep matching; # only generation is selectable. The running mm-api reads the gateway per request, so a flip is picked up with # no mm-api redeploy. If the selected backend fails at request time the gateway falls back to Ollama. set -u BACKEND=${1:-ollama} case "$BACKEND" in ollama|mlx|megamind) ;; *) echo "usage: $0 ollama|mlx|megamind"; exit 2 ;; esac # When flipping to MLX, make sure a known good small MLX server is up on 8081 first (a 4 bit 3B model that is # fast on an M chip and leaves room for the Ollama faithfulness model in 16GB). If it is not running, start it; # the gateway's ollama fallback covers requests while the model loads. if [ "$BACKEND" = "mlx" ]; then MLXBIN="$HOME/mlx-train-venv/bin/mlx_lm.server" MLXMODEL=mlx-community/Qwen2.5-3B-Instruct-4bit if pgrep -f "mlx_lm.server.*--port 8081" >/dev/null 2>&1; then echo "mlx server already up on 8081" elif [ -x "$MLXBIN" ]; then echo "starting mlx server ($MLXMODEL) on 8081" nohup "$MLXBIN" --model "$MLXMODEL" --host 0.0.0.0 --port 8081 > "$HOME/mlx-server.log" 2>&1 </dev/null & sleep 6 else echo "mlx server binary $MLXBIN missing; the mlx backend will fall back to ollama" fi fi SECRETS_FILE="${MEGAMIND_SECRETS_FILE:-$HOME/.megamind-secrets.env}" if [ ! -f "$SECRETS_FILE" ]; then echo "missing $SECRETS_FILE (needs MEGAMIND_GATEWAY_TOKEN=..., chmod 600); refusing to start an open gateway" exit 1 fi pkill -f "megamind-gateway" 2>/dev/null sleep 1 # No MEGAMIND_ADDR: the gateway binds the Tailscale interface by itself (loopback when none is up). MEGAMIND_SECRETS_FILE="$SECRETS_FILE" MEGAMIND_GENERATE_BACKEND="$BACKEND" \ nohup "$HOME/megamind-gateway" > "$HOME/megamind-gateway.log" 2>&1 </dev/null & sleep 2 TSIP=$(/Applications/Tailscale.app/Contents/MacOS/Tailscale ip -4 2>/dev/null || tailscale ip -4 2>/dev/null || echo 127.0.0.1) if ! curl -fsS -m 5 "http://$TSIP:8090/healthz" >/dev/null 2>&1; then echo "gateway did not come up on 8090, check $HOME/megamind-gateway.log" exit 1 fi echo "gateway restarted with generation backend=$BACKEND" head -1 "$HOME/megamind-gateway.log"

Search equations, builds, manuscript text, and recovered sources.