motif64

m64_9ef64c9b4712 / start.sh

37 lines, 1.6 KBraw
1#!/usr/bin/env bash2# hermes-qwen38flash-openrouter-gb10 entrypoint. Runs inside the container; takes no arguments.3# Three processes, all in this container:4#   127.0.0.1:9000  llm_relay.py   OpenAI-compatible; forces the model, goes out via the gate5#   127.0.0.1:4096  cli_shim.py    runs `hermes -z` once per prompt6#   0.0.0.0:$M64_PORT agent_gateway.py   the agent.session API m64's front proxies to7set -eu89echo '{"phase":"loading","detail":"starting hermes"}' >> "$M64_STATUS"1011export HOME=/scratch/home12export WORK_DIR=/scratch/work13export SHIM_HOMES=/scratch/homes14mkdir -p "$HOME" "$WORK_DIR/sessions" "$SHIM_HOMES"1516export AGENT_HARNESS=hermes17export AGENT_HARNESS_TITLE="Hermes Agent v2026.9.21 (NousResearch)"18export AGENT_MODEL=qwen3.8-flash               # the name the harness uses19export UPSTREAM_MODEL=qwen/qwen3.8-flash   # what the relay sends to OpenRouter20export AGENT_CONTEXT=1000000   # Qwen3.8 Flash: 1M context21export AGENT_VISION=122export LLM_BASE_URL=http://127.0.0.1:9000/v123export RELAY_TITLE="m64 hermes-qwen38flash-openrouter-gb10"2425python3 -u /capsule/llm_relay.py &26RELAY_PID=$!27python3 -u /capsule/cli_shim.py &28SHIM_PID=$!2930# If the relay or the shim dies, take the container down so m64 reports the error ($$ is31# the gateway after the exec below). A dead child lingers as a zombie: test its state.32alive() { [ -r "/proc/$1/stat" ] && [ "$(cut -d')' -f2 "/proc/$1/stat" | cut -d' ' -f2)" != Z ]; }33( while alive "$RELAY_PID" && alive "$SHIM_PID"; do sleep 5; done34  echo '{"phase":"error","detail":"the LLM relay or the hermes shim exited"}' >> "$M64_STATUS"35  kill -TERM $$ ) &3637exec /opt/gateway/bin/python /capsule/agent_gateway.py