#!/usr/bin/env bash # Download jcbtc/Qwen3.8-27B-IU4-Kairic-Edge (the frank-large model) on # Dankclaw. # # bash scripts/download-frank-large-kairic.sh # bash scripts/download-frank-large-kairic.sh --verify-only # # The Kairic Edge payload is four files: the main IU4 GGUF (15.5 GiB) and # three .pfs sidecars (FFN 7.99 GiB, GDN 1.88 GiB, GDN-Output 0.70 GiB). # The sidecars are the PromptForge IU4 (W4A4) weight shards the Kairic Edge # runtime loads alongside the main GGUF (PROMPTFORGE_IU4_SIDECAR, # PROMPTFORGE_GDN_SIDECAR, PROMPTFORGE_GDN_OUTPUT_SIDECAR). # # Integrity: every file is checked against its declared byte count and sha256 # (the values below are the LFS oids from the Hub, 2026-09-21). The repo is # public (gated: false); an HF token at ~/.cache/huggingface/token is used # when present to clear the anonymous rate limit on a 26 GB transfer. # # Layout after a successful run (MODEL_DIR): # Qwen3.8-27B-IU4-Kairic-Edge.gguf 16617792672 main IU4 GGUF # Qwen3.8-27B-Kairic-IU4-FFN.pfs 8576856064 FFN sidecar # Qwen3.8-27B-Kairic-IU4-GDN.pfs 2019569664 GDN sidecar # Qwen3.8-27B-Kairic-IU4-GDN-Output.pfs 756953088 GDN-Output sidecar set -euo pipefail REPO="jcbtc/Qwen3.8-27B-IU4-Kairic-Edge" MODEL_DIR="/home/dank/models/Qwen3.8-27B-IU4-Kairic-Edge" BASE="https://huggingface.co/$REPO/resolve/main" mode="download" [[ "${1:-}" == "--verify-only" ]] && mode="verify" token="" auth=() if [[ -r "$HOME/.cache/huggingface/token" ]]; then token="$(tr -d '[:space:]' < "$HOME/.cache/huggingface/token")" auth=(-H "Authorization: Bearer $token") fi dl() { # dl local rel="$1" dest="$MODEL_DIR/$rel" [[ -s "$dest" ]] && return 0 mkdir -p "$(dirname "$dest")" echo "fetching $rel" curl -fL -C - "${auth[@]}" --retry 5 --retry-delay 3 -o "$dest" "$BASE/$rel" } # filename size sha256 — the LFS oids from the Hub (2026-09-21) FILES=( "Qwen3.8-27B-IU4-Kairic-Edge.gguf 16617792672 360caf7381907c3eca7ac0afd1228efc016af747f3f38637fb1c7f94daabac2a" "Qwen3.8-27B-Kairic-IU4-FFN.pfs 8576856064 adcbb90a7b429a30a2a39043366d68320d72e8b4816a0f498e882b2f80a2ba2b" "Qwen3.8-27B-Kairic-IU4-GDN.pfs 2019569664 82f931316f1c895da104915dec4697163808d06f0e6b2dc027cee7aa3afc0f0e" "Qwen3.8-27B-Kairic-IU4-GDN-Output.pfs 756953088 3b07e7b176559e4402924ba0c368532fa6f02118a33c71e70974c809bf6208a3" ) RELS=() for line in "${FILES[@]}"; do read -r rel _ _ <<<"$line" RELS+=("$rel") done # Verify each file's byte count and sha256 (idempotent: a complete file is # re-checked, not re-downloaded). echo "verifying $MODEL_DIR against declared sizes + sha256" python3 - "$MODEL_DIR" "${RELS[@]}" <<'PY' import hashlib, os, sys model_dir = sys.argv[1] rels = sys.argv[2:] # (rel, size, sha256) triples, re-parsed from the same source of truth. specs = { "Qwen3.8-27B-IU4-Kairic-Edge.gguf": (16617792672, "360caf7381907c3eca7ac0afd1228efc016af747f3f38637fb1c7f94daabac2a"), "Qwen3.8-27B-Kairic-IU4-FFN.pfs": (8576856064, "adcbb90a7b429a30a2a39043366d68320d72e8b4816a0f498e882b2f80a2ba2b"), "Qwen3.8-27B-Kairic-IU4-GDN.pfs": (2019569664, "82f931316f1c895da104915dec4697163808d06f0e6b2dc027cee7aa3afc0f0e"), "Qwen3.8-27B-Kairic-IU4-GDN-Output.pfs": (756953088, "3b07e7b176559e4402924ba0c368532fa6f02118a33c71e70974c809bf6208a3"), } ok = True for rel in rels: dest = os.path.join(model_dir, rel) size, sha = specs[rel] if not os.path.isfile(dest): print(f" MISSING {rel}") ok = False continue actual_size = os.path.getsize(dest) if actual_size != size: print(f" SIZE MISMATCH {rel}: {actual_size} != {size}") ok = False continue h = hashlib.sha256() with open(dest, "rb") as f: for chunk in iter(lambda: f.read(1 << 24), b""): h.update(chunk) actual_sha = h.hexdigest() if actual_sha != sha: print(f" SHA256 MISMATCH {rel}: {actual_sha}") ok = False continue print(f" OK {rel} ({actual_size} bytes)") if not ok: sys.exit(1) PY if [[ "$mode" == "download" ]]; then for line in "${FILES[@]}"; do read -r rel _ _ <<<"$line" dl "$rel" done fi echo "frank-large payload complete: $MODEL_DIR"