#!/usr/bin/env bash # Serve unsloth/Qwen3.8-27B-GGUF:UD-Q8_K_XL as frank-large on Dankclaw's # Strix Halo iGPU (gfx1151), using gufo (gufo-org/gufo) — the inference # engine built specifically for this hardware. # # Runtime: /home/dank/GitPackages/gufo-v0.1.1/bin/gufo, built from source # against the host ROCm by scripts/build-gufo.sh. It replaces the stock # llama.cpp prebuilt (unsloth b11030) that served this endpoint from # 2026-09-21; payload, port and alias are unchanged, so no client moved. # # Shape: one session, full 262144 context (the model's native window). The # 27B dense weights (29.30 GiB) + the DFlash2 drafter (1.07 GiB) + KV + # compute buffers fit the iGPU's GTT aperture (~114 GiB); gufo's own # Q8/AR table measures 50.58 GiB peak at this context capacity. # # Spec method: DFlash2 (a block-diffusion drafter), gufo's adaptive block # policy, capped at DRAFT_TOKENS proposals per step. The drafter is the # z-lab Qwen3.8-27B-DFlash2-Q4_K_M and it has a sliding window of 2048 # (small draft KV). # # Sampling: greedy (--temperature 0). That is what this endpoint has always # served, and it keeps the swap to a pure runtime change; gufo's per-model # recommendation for Qwen3.8 thinking is sampled (1.0 / 0.95 / top-k 20) and # is a separate decision. # # Template: gufo compiles the official Qwen Jinja into the binary and takes # no --chat-template-file. Its Qwen27B default is thinking ON at xhigh effort # with prior reasoning preserved, which is the contract the fleet already # depends on, so --think auto + --preserve-thinking on is spelled out here # rather than left implicit. # # Text-only: gufo auto-discovers a mmproj beside the model and this payload # has none, so the endpoint stays text-only. # # Tunables come from frank-large.env unless FRANK_LARGE_ENV_FILE overrides # it; anything not set there falls through to the defaults below. set -euo pipefail SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" ENV_FILE="${FRANK_LARGE_ENV_FILE:-$SCRIPT_DIR/frank-large.env}" if [[ -f "$ENV_FILE" ]]; then set -a source "$ENV_FILE" set +a fi # --- defaults (used when the env file does not set them) ------------------ : "${RUNTIME_DIR:=/home/dank/GitPackages/gufo-v0.1.1}" : "${MODEL_DIR:=/home/dank/models/Qwen3.8-27B-UD-Q8_K_XL}" : "${ALIAS:=frank-large}" : "${HOST:=0.0.0.0}" : "${PORT:=7770}" : "${CONTEXT_SIZE:=262144}" : "${SESSIONS:=1}" : "${DRAFT_TOKENS:=7}" : "${DRAFT_POLICY:=adaptive}" GUFO_BIN="$RUNTIME_DIR/bin/gufo" MODEL_FILE="$MODEL_DIR/Qwen3.8-27B-UD-Q8_K_XL.gguf" DRAFTER_FILE="$MODEL_DIR/Qwen3.8-27B-DFlash2-Q4_K_M.gguf" if [[ ! -x "$GUFO_BIN" ]]; then echo "runtime not found at $GUFO_BIN" >&2 echo "frank-large: build it: bash scripts/build-gufo.sh" >&2 exit 1 fi for f in "$MODEL_FILE" "$DRAFTER_FILE"; do if [[ ! -f "$f" ]]; then echo "missing asset $f (run scripts/download-frank-large.sh)" >&2 exit 1 fi done # --- env ------------------------------------------------------------------- # gufo links against the host ROCm through its RPATH (/opt/rocm -> # /etc/alternatives/rocm), so no LD_LIBRARY_PATH is needed. The device is # already gfx1151 — `gufo diagnose` reports it natively — so no # HSA_OVERRIDE_GFX_VERSION either; the override existed for the prebuilt # llama.cpp runtime and can only misreport the arch here. export HIP_VISIBLE_DEVICES=0 # --- the serve command --------------------------------------------------- # Server options precede the subcommand, model options follow it. exec "$GUFO_BIN" serve \ --host "$HOST" \ --port "$PORT" \ --sessions "$SESSIONS" \ llm \ --model "$MODEL_FILE" \ --served-model-name "$ALIAS" \ --context "$CONTEXT_SIZE" \ --speculative dflash2 \ --dflash-model "$DRAFTER_FILE" \ --draft-tokens "$DRAFT_TOKENS" \ --draft-policy "$DRAFT_POLICY" \ --temperature 0 \ --think auto \ --preserve-thinking on