Download scripts/validate.py from localllmrig/localllmrig-open-data: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/localllmrig/localllmrig-open-data/resolve/main/scripts/validate.py
- Command line
-
hf download hf://datasets/localllmrig/localllmrig-open-data/scripts/validate.py
-
curl -L -o validate.py https://huggingface.co/datasets/localllmrig/localllmrig-open-data/resolve/main/scripts/validate.py
1.12 kB
| #!/usr/bin/env python3 | |
| """Cross-check data/fit-estimates.csv against the live https://localllmrig.com/api/recommend. | |
| Expected result: identical fit labels; speeds within ±0.1 tok/s (KV rounding for sliding-window models).""" | |
| import csv, json, urllib.request | |
| rows = {(r["model_id"], r["hardware_id"], r["quant"]): r for r in csv.DictReader(open("data/fit-estimates.csv"))} | |
| n = bad = 0 | |
| for model in ["llama-3.3-70b", "qwen2.5-32b", "llama-3.1-8b", "gemma-2-27b", "qwen2.5-72b", "gemma-2-9b", "nemotron-3-5-bolt-74b"]: | |
| for q in ["Q4", "Q8"]: | |
| for budget in [800, 2000, 5000, 20000]: | |
| url = f"https://localllmrig.com/api/recommend?model={model}&budget={budget}&quant={q}&context=8192" | |
| for p in json.load(urllib.request.urlopen(url)).get("picks", []): | |
| r = rows[(model, p["id"], q)]; n += 1 | |
| if r["fit"] != p["fit"] or abs(float(r["est_decode_tok_s"]) - p["tokensPerSec"]) > 0.15: | |
| bad += 1; print("MISMATCH", model, q, p["id"], r["fit"], r["est_decode_tok_s"], p["fit"], p["tokensPerSec"]) | |
| print(f"checked {n} picks, {bad} outside tolerance") | |