File size: 1,614 Bytes
36f68cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""Preflight checks for the preferred Nemotron GGUF runtime assets.

This script only lists Hugging Face repository metadata. It does not download
model weights and it does not prove image input works in llama.cpp.
"""

from __future__ import annotations

import os
import sys

from huggingface_hub import HfApi


MODEL_REPO = os.getenv(
    "SNAP2SIM_MODEL_REPO",
    "unsloth/NVIDIA-Nemotron-3-Nano-Omni-30B-A3B-Reasoning-GGUF",
)
GGUF_QUANT = os.getenv("SNAP2SIM_GGUF_QUANT", "UD-Q4_K_M")
MMPROJ_FILE = os.getenv("SNAP2SIM_MMPROJ_FILE", "mmproj-F16.gguf")


def main() -> int:
    files = HfApi().list_repo_files(MODEL_REPO)
    quant_matches = [name for name in files if name.endswith(".gguf") and GGUF_QUANT in name]
    mmproj_matches = [name for name in files if name.startswith("mmproj") and name.endswith(".gguf")]

    print(f"repo: {MODEL_REPO}")
    print(f"quant selector: {GGUF_QUANT}")
    print(f"quant files: {', '.join(quant_matches) or 'NONE'}")
    print(f"mmproj files: {', '.join(mmproj_matches) or 'NONE'}")
    print(f"selected mmproj: {MMPROJ_FILE}")

    missing = []
    if not quant_matches:
        missing.append(f"GGUF quant containing {GGUF_QUANT}")
    if MMPROJ_FILE not in files:
        missing.append(MMPROJ_FILE)

    if missing:
        print(f"missing: {', '.join(missing)}", file=sys.stderr)
        return 1

    print("preflight: PASS")
    print(
        "next: run a GPU smoke test with llama.cpp using the selected GGUF and "
        "mmproj, then send one image prompt through the server."
    )
    return 0


if __name__ == "__main__":
    raise SystemExit(main())