#!/usr/bin/env bash # Download the Q4_K_XL frank-dragoon payload on Dankclaw: # unsloth/Qwen3.8-27B-GGUF -> Qwen3.8-27B-UD-Q4_K_XL.gguf # # bash scripts/download-frank-dragoon-q4.sh # bash scripts/download-frank-dragoon-q4.sh --verify-only # # Integrity: the file is checked against its declared byte count and sha256 # (the LFS oid from the Hub tree API, 2026-10-01). NO AUTH HEADER IS USED: # the repo is public and ungated (gated: false), and a token on the curl # command line is world-readable via /proc//cmdline. If this ever needs # a token, put it in a mode-600 file and pass it with `curl -K`. # # Layout after a successful run (MODEL_DIR): # Qwen3.8-27B-UD-Q4_K_XL.gguf 17559178144 (16.35 GiB) # # WHY Q4 AND NOT THE Q8 SWIFT PAYLOAD: this is the vanilla (non-abliterated) # Qwen3.8-27B at UD-Q4_K_XL, ~13 GiB smaller than the Swift UD-Q8_K_XL. Every # GiB of weights saved is a GiB of f16 KV the endpoint can hold instead: the # KV costs 64 KiB/token (16 full-attention layers x 4 KV heads x 256 head_dim # x 2 (K,V) x 2 B), so 4 sessions x 163840 ctx = 640,000 tokens = 39.06 GiB. # # The speculative drafter is UNCHANGED and still fetched by its own script # (scripts/download-frank-dragoon.sh, z-lab's Hub repo). That name must not # appear here at all — the frank-dragoon seam greps THIS file for it to prove # the drafter was not folded into the payload fetch. # # NOTE ON MTP: this payload has no baked-in MTP head (the Hub repo ships one # separately as MTP/mtp-Qwen3.8-27B-Q4_0.gguf). frank-dragoon does not need it — # spec decode here is the block-diffusion drafter, not MTP. set -euo pipefail MODEL_DIR="/home/dank/models/Qwen3.8-27B-UD-Q4_K_XL" REL="Qwen3.8-27B-UD-Q4_K_XL.gguf" SIZE=17559178144 SHA=3f227079003add2511437e5b1e94812e363385225bf6a9b47b0054a72bc8b01e URL="https://huggingface.co/unsloth/Qwen3.8-27B-GGUF/resolve/main/${REL}" mode="download" [[ "${1:-}" == "--verify-only" ]] && mode="verify" if [[ "$mode" == "download" ]]; then mkdir -p "$MODEL_DIR" if [[ -s "$MODEL_DIR/$REL" ]]; then echo "already present: $MODEL_DIR/$REL" else echo "fetching $REL (17559178144 bytes) — this is ~16.4 GiB" # -f so an HTTP error is a failure, not a 153-byte "artifact". # -C - so an interrupted run resumes instead of restarting. curl -fL -C - --retry 5 --retry-delay 3 -o "$MODEL_DIR/$REL" "$URL" fi fi echo "verifying $MODEL_DIR against declared size + sha256" python3 - "$MODEL_DIR" "$REL" "$SIZE" "$SHA" <<'PY' import hashlib, os, sys model_dir, rel, size, sha = sys.argv[1], sys.argv[2], int(sys.argv[3]), sys.argv[4] dest = os.path.join(model_dir, rel) if not os.path.isfile(dest): print(f" MISSING {rel}") sys.exit(1) actual = os.path.getsize(dest) if actual != size: print(f" SIZE MISMATCH {rel}: {actual} != {size}") sys.exit(1) h = hashlib.sha256() with open(dest, "rb") as f: for chunk in iter(lambda: f.read(1 << 24), b""): h.update(chunk) if h.hexdigest() != sha: print(f" SHA256 MISMATCH {rel}: {h.hexdigest()}") sys.exit(1) print(f" OK {rel} ({actual} bytes, sha256 matches the Hub LFS oid)") PY echo "Q4_K_XL payload complete: $MODEL_DIR"