m64_59814df31ca3 / start.sh
45 lines, 2.4 KBraw
1#!/usr/bin/env bash2# pi17-basalt07-qwen4-jesdga-5090 entrypoint. Runs inside the container; takes no arguments.3# 127.0.0.1:9000 basalt serve (main fe03cb21): Qwen4-35B-A3B NVFP4, the official Basalt pack (jesdga), CONTEXT ctx (default 262144)4# 127.0.0.1:4096 cli_shim.py: `pi -p --mode json` once per prompt, with a command watchdog (TOOL_TIMEOUT_S, 600 s)5# 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/cache10CTX=${CONTEXT:-262144}1112# Basalt's v2 config, the pack's defaults otherwise: every expert resident, the n-gram table read from the SSD, DFlash 213# drafter, vision dynamic (16384 tokens max), the checkpoint's sampling (temperature 1.0, top-p 0.95, top-k 20).14cat > /scratch/basalt_config.json <<JSON15{16 "version": 2,17 "engine": { "resident-experts": true },18 "models": [ { "alias": "qwen4-35b-a3b-basalt", "model": "/weights/pack/Qwen4-35B-A3B-NVFP4.basalt", "max-context": $CTX, "kv": "int8", "max-running": 1, "reasoning-effort": "high" } ],19 "server": { "host": "127.0.0.1", "port": 9000 }20}21JSON22echo '{"phase":"loading","detail":"Basalt 0.7: loading Qwen4-35B-A3B NVFP4 (jesdga official pack)"}' >> "$M64_STATUS"23/opt/basalt/bin/basalt serve --config /scratch/basalt_config.json &24LLM_PID=$!2526export AGENT_HARNESS=pi27export AGENT_HARNESS_TITLE="pi coding agent 1.7.0 (earendil-works/pi)"28export AGENT_MODEL=qwen4-35b-a3b-basalt UPSTREAM_MODEL=qwen4-35b-a3b-basalt29export AGENT_CONTEXT=$CTX AGENT_VISION=130# The airbench checkup harness's settings (checkup.py output_cap / compaction_reserve) at 262144.31export AGENT_MAX_OUT=3276832if [ "$CTX" -ge 262144 ]; then export AGENT_COMPACTION_RESERVE=65536; else export AGENT_COMPACTION_RESERVE=49152; fi33export TOOL_TIMEOUT_S=${TOOL_TIMEOUT_S:-600}34export LLM_BASE_URL=http://127.0.0.1:9000/v135export RELAY_URL=http://127.0.0.1:9000 # the gateway's health check: basalt's /health36export NODE_USE_ENV_PROXY=137/opt/gateway/bin/python3 -u /capsule/cli_shim.py &38SHIM_PID=$!3940alive() { [ -r "/proc/$1/stat" ] && [ "$(cut -d')' -f2 "/proc/$1/stat" | cut -d' ' -f2)" != Z ]; }41( while alive "$LLM_PID" && alive "$SHIM_PID"; do sleep 5; done42 echo '{"phase":"error","detail":"basalt or the pi shim exited"}' >> "$M64_STATUS"43 kill -TERM $$ ) &4445exec /opt/gateway/bin/python3 /capsule/agent_gateway.py