m64_8077c7cae3bf / start.sh
44 lines, 2.2 KBraw
1#!/usr/bin/env bash2# pi073-qwen38fn-unsloth-v31-5090 entrypoint. Runs inside the container; takes no arguments.3# 127.0.0.1:9000 llama-server (Unsloth b11985): Qwen3.8-Flash-Next UD-IQ4_XS + MTP draft head, 262144 ctx4# (m64_516ff942b134's command line, unchanged except the host and port)5# 127.0.0.1:4096 cli_shim.py: `pi -p --mode json` once per prompt6# 0.0.0.0:$M64_PORT agent_gateway.py: the agent.session API7set -eu8export HOME=/scratch/home WORK_DIR=/scratch/work SHIM_HOMES=/scratch/homes9mkdir -p "$HOME" "$WORK_DIR/sessions" "$SHIM_HOMES" /scratch/cache10export XDG_CACHE_HOME=/scratch/cache1112echo '{"phase":"loading","detail":"unpacking llama.cpp"}' >> "$M64_STATUS"13L=/scratch/llama.cpp14if [ ! -x "$L/llama-server" ]; then mkdir -p "$L"; tar xzf /weights/llama.cpp.tar.gz -C "$L"; fi15W=/weights/qwen16CTX=${CONTEXT:-262144}17echo '{"phase":"loading","detail":"llama.cpp: loading Qwen3.8-Flash-Next (a few minutes)"}' >> "$M64_STATUS"18"$L/llama-server" \19 -m "$W/UD-IQ4_XS/Qwen3.8-Flash-Next-UD-IQ4_XS-00001-of-00004.gguf" \20 --mmproj "$W/mmproj-BF16.gguf" \21 -md "$W/MTP/mtp-Qwen3.8-Flash-Next-shared-Q8_0.gguf" --spec-type draft-mtp --spec-draft-n-max 2 \22 -c "$CTX" -np 1 -fa on -ctk q8_0 -ctv q8_0 \23 --jinja --alias qwen3.8-flash-next-ud-iq4_xs-unsloth-v3.1 \24 --host 127.0.0.1 --port 9000 &25LLM_PID=$!2627export AGENT_HARNESS=pi28export AGENT_HARNESS_TITLE="pi coding agent 0.73.1 (badlogic/pi-mono)"29export AGENT_MODEL=qwen3.8-flash-next-ud-iq4_xs-unsloth-v3.1 UPSTREAM_MODEL=qwen3.8-flash-next-ud-iq4_xs-unsloth-v3.130export AGENT_CONTEXT=$CTX AGENT_VISION=131# agent-checkup-benchmark's pi settings at 262144 (checkup.py output_cap / compaction_reserve).32export AGENT_MAX_OUT=32768 AGENT_COMPACTION_RESERVE=6553633export LLM_BASE_URL=http://127.0.0.1:9000/v134export RELAY_URL=http://127.0.0.1:900035export NODE_USE_ENV_PROXY=136/opt/gateway/bin/python3 -u /capsule/cli_shim.py &37SHIM_PID=$!3839alive() { [ -r "/proc/$1/stat" ] && [ "$(cut -d')' -f2 "/proc/$1/stat" | cut -d' ' -f2)" != Z ]; }40( while alive "$LLM_PID" && alive "$SHIM_PID"; do sleep 5; done41 echo '{"phase":"error","detail":"llama-server or the pi shim exited"}' >> "$M64_STATUS"42 kill -TERM $$ ) &4344exec /opt/gateway/bin/python3 /capsule/agent_gateway.py