#!/usr/bin/env bash # hermes-qwen38nvfp4-gb10 entrypoint. Runs inside the container; takes no arguments. # 127.0.0.1:9000 vllm serve qwen38-27b-nvfp4 (gx10 agents/sandbox.sh profile: util 0.85, ctx 262144) # 127.0.0.1:4096 cli_shim.py: `hermes -z` 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 NVFP4"}' >> "$M64_STATUS" vllm serve /weights/model --host 127.0.0.1 --port 9000 \ --served-model-name qwen38-27b-nvfp4 \ --quantization modelopt \ --kv-cache-dtype fp8 \ --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=hermes export AGENT_HARNESS_TITLE="Hermes Agent v2026.9.21 (NousResearch)" export AGENT_MODEL=qwen38-27b-nvfp4 UPSTREAM_MODEL=qwen38-27b-nvfp4 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 hermes shim exited"}' >> "$M64_STATUS" kill -TERM $$ ) & exec python3 /capsule/agent_gateway.py