#!/usr/bin/env bash # Download the frank-medium payload for Dankserver (2x Radeon AI PRO R9700): # the target GGUF and the DFlash2 draft model, into /home/dank/models. # # bash scripts/download-frank-medium-gguf.sh # bash scripts/download-frank-medium-gguf.sh --verify-only # # Both repositories are public (anonymous download; no token needed). If a # token exists at ~/.cache/huggingface/token it is used, which keeps a 31 GB # transfer clear of the anonymous rate limit. The script is resumable # (curl -C -) and checks every artifact's exact byte count afterwards, so a # truncated file fails here instead of load-crashing the server. # # WHY THESE TWO FILES: # * Target: ajgazin/Swift-Qwen3.8-27B-Uncensored-Dynamic-MTP-GGUF at # UD-Q8_K_XL -- Unsloth Dynamic 3.0 quant (per-tensor types from Unsloth's # own quant of the same size, on Unsloth's importance matrix). The file # carries the model's MTP layer (`blk.64.nextn.*`), so llama.cpp can also # draft from the model itself with no second copy in VRAM. # * Draft: z-lab/Qwen3.8-27B-DFlash2-GGUF at Q8_0 -- the block-diffusion # drafter with the candidate selector (5 layers, hidden 5120). Q8_0 is # 2.0 GiB against BF16's 3.9 GiB and the drafter's job is throughput, not # output quality (verification is lossless either way). set -euo pipefail MODEL_REPO="ajgazin/Swift-Qwen3.8-27B-Uncensored-Dynamic-MTP-GGUF" MODEL_DIR="/home/dank/models/Swift-Qwen3.8-27B-Uncensored-Dynamic-MTP-GGUF" MODEL_FILE="Swift-Qwen3.8-27B-Uncensored-Dynamic-MTP-UD-Q8_K_XL.gguf" MODEL_SIZE=31457990112 DRAFT_REPO="z-lab/Qwen3.8-27B-DFlash2-GGUF" DRAFT_DIR="/home/dank/models/Qwen3.8-27B-DFlash2-GGUF" DRAFT_FILE="Qwen3.8-27B-DFlash2-Q8_0.gguf" DRAFT_SIZE=2056414816 mode="download" [[ "${1:-}" == "--verify-only" ]] && mode="verify" token="" auth=() if [[ -r "$HOME/.cache/huggingface/token" ]]; then token="$(cat "$HOME/.cache/huggingface/token")" auth=(-H "Authorization: Bearer $token") else echo "no HF token at ~/.cache/huggingface/token; downloading anonymously" fi dl() { # dl mkdir -p "$2" echo " fetching $3" curl -fL -C - -o "$2/$3" --retry 10 --retry-delay 5 --retry-max-time 21600 \ "${auth[@]}" "https://huggingface.co/$1/resolve/main/$3" } if [[ "$mode" == "download" ]]; then echo "target: $MODEL_REPO" dl "$MODEL_REPO" "$MODEL_DIR" "$MODEL_FILE" echo "draft: $DRAFT_REPO" dl "$DRAFT_REPO" "$DRAFT_DIR" "$DRAFT_FILE" fi echo "verifying sizes" ok=1 check() { # check local act act="$(stat -c%s "$1" 2>/dev/null || echo 0)" if [[ "$act" -eq "$2" ]]; then echo " OK $1 ($act bytes)" else echo " BAD $1 ($act bytes, want $2)" >&2 ok=0 fi } check "$MODEL_DIR/$MODEL_FILE" "$MODEL_SIZE" check "$DRAFT_DIR/$DRAFT_FILE" "$DRAFT_SIZE" [[ -z "$token" ]] && echo "note: no token used; the byte counts above are the integrity check" [[ "$ok" -eq 1 ]] || exit 1 echo "all artifacts present and sized correctly"