#!/usr/bin/env bash # dsh-qwen38-gb10 entrypoint. Runs inside the container; takes no arguments. # 127.0.0.1:9000 vllm serve qwen38-27b (gx10 agents/sandbox.sh profile: util 0.85, ctx 262144) # 127.0.0.1:4096 cli_shim.py: `dsh --profile headless --json` once per prompt # 0.0.0.0:$M64_PORT agent_gateway.py: the agent.session API set -eu export HOME=/scratch/home WORK_DIR=/scratch/work SHIM_HOMES=/scratch/homes mkdir -p "$HOME" "$WORK_DIR/sessions" "$SHIM_HOMES" /scratch/cache export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 VLLM_NO_USAGE_STATS=1 DO_NOT_TRACK=1 export XDG_CACHE_HOME=/scratch/cache VLLM_CACHE_ROOT=/scratch/cache/vllm TRITON_CACHE_DIR=/scratch/cache/triton echo '{"phase":"loading","detail":"vLLM: loading Qwen3.8-27B"}' >> "$M64_STATUS" vllm serve /weights/model --host 127.0.0.1 --port 9000 \ --served-model-name qwen38-27b \ --max-model-len 262144 \ --gpu-memory-utilization 0.85 \ --max-num-seqs 4 \ --enforce-eager \ --enable-auto-tool-choice \ --tool-call-parser qwen3_coder \ --reasoning-parser qwen3 \ --enable-prefix-caching & VLLM_PID=$! export AGENT_HARNESS=dsh export AGENT_HARNESS_TITLE="DeepSeek Harness 0.2.0-rc.2 (deepseek-ai/deepseek-harness)" export AGENT_MODEL=qwen38-27b UPSTREAM_MODEL=qwen38-27b export AGENT_CONTEXT=262144 AGENT_VISION=1 export LLM_BASE_URL=http://127.0.0.1:9000/v1 export RELAY_URL=http://127.0.0.1:9000 # the gateway's health check: vLLM's /health export NODE_USE_ENV_PROXY=1 # web access, if granted, goes through the m64 gate python3 -u /capsule/cli_shim.py & SHIM_PID=$! alive() { [ -r "/proc/$1/stat" ] && [ "$(cut -d')' -f2 "/proc/$1/stat" | cut -d' ' -f2)" != Z ]; } ( while alive "$VLLM_PID" && alive "$SHIM_PID"; do sleep 5; done echo '{"phase":"error","detail":"vLLM or the dsh shim exited"}' >> "$M64_STATUS" kill -TERM $$ ) & exec python3 /capsule/agent_gateway.py