motif64

m64_2eac365996ff / start.sh

46 lines, 2.9 KBraw
1#!/usr/bin/env bash2# pi17-qwen36-35b-a3b-strixhalo entrypoint. Runs inside the container; takes no arguments.3#   127.0.0.1:9000     llama-server (llama.cpp 75d911f, Vulkan): Qwen3.6-35B-A3B UD-Q4_K_XL, q8_0 KV, CONTEXT ctx (default 262144)4#   127.0.0.1:4096     cli_shim.py: `pi -p --mode json` once per prompt5#   0.0.0.0:$M64_PORT  agent_gateway.py: the agent.session API6set -eu7export HOME=/scratch/home WORK_DIR=/scratch/work SHIM_HOMES=/scratch/homes8mkdir -p "$HOME" "$WORK_DIR/sessions" "$SHIM_HOMES" /scratch/cache9export XDG_CACHE_HOME=/scratch/cache10# The context window: the model's full 262144 by default.11CTX=${CONTEXT:-262144}1213echo '{"phase":"loading","detail":"llama.cpp: loading Qwen3.6-35B-A3B into GPU memory (about 23 GB)"}' >> "$M64_STATUS"14# Measured on this GPU with llama-bench (Vulkan, RADV): -ub 2048 reads prompts 10% faster than 1024 (1625 vs 147815# t/s at 4096), and a q8_0 KV cache is as fast as f16 at 32K depth (51.5 vs 48.5 t/s generation). Weights read16# once and offloaded whole (-lm none). Sampling: Qwen's thinking-mode values for general tasks, with presence17# penalty 1.5, which Qwen advises against endless repetition in quantized models: the capsule this one replaces18# (temp 0.6, no penalty) lost three of five checkup sections to one thinking loop that filled the 32768-token cap.19/opt/llama/bin/llama-server \20    -m /weights/qwen36/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf \21    --mmproj /weights/qwen36/mmproj-F16.gguf --image-min-tokens 1024 \22    -c "$CTX" -np 1 -ngl 999 -fa on -ctk q8_0 -ctv q8_0 -b 2048 -ub 2048 -lm none --jinja \23    --temp 1.0 --top-k 20 --top-p 0.95 --min-p 0 --presence-penalty 1.5 \24    --no-ui --metrics --alias qwen3.6-35b-a3b-ud-q4_k_xl --host 127.0.0.1 --port 9000 &25LLM_PID=$!2627export AGENT_HARNESS=pi28export AGENT_HARNESS_TITLE="pi coding agent 1.7.0 (earendil-works/pi)"29export AGENT_MODEL=qwen3.6-35b-a3b-ud-q4_k_xl UPSTREAM_MODEL=qwen3.6-35b-a3b-ud-q4_k_xl30export AGENT_CONTEXT=$CTX AGENT_VISION=131# The airbench checkup harness's settings (checkup.py output_cap / compaction_reserve): 32768 out at both32# windows, and pi compacts with a 65536-token reserve at 262144 (49152 at 131072).33export AGENT_MAX_OUT=3276834if [ "$CTX" -ge 262144 ]; then export AGENT_COMPACTION_RESERVE=65536; else export AGENT_COMPACTION_RESERVE=49152; fi35export LLM_BASE_URL=http://127.0.0.1:9000/v136export RELAY_URL=http://127.0.0.1:9000        # the gateway's health check: llama-server's /health37export NODE_USE_ENV_PROXY=1                   # web access, if granted, goes through the m64 gate38/opt/gateway/bin/python3 -u /capsule/cli_shim.py &39SHIM_PID=$!4041alive() { [ -r "/proc/$1/stat" ] && [ "$(cut -d')' -f2 "/proc/$1/stat" | cut -d' ' -f2)" != Z ]; }42( while alive "$LLM_PID" && alive "$SHIM_PID"; do sleep 5; done43  echo '{"phase":"error","detail":"llama-server or the pi shim exited"}' >> "$M64_STATUS"44  kill -TERM $$ ) &4546exec /opt/gateway/bin/python3 /capsule/agent_gateway.py