cn0303 commited on
Commit
f3cb4af
·
verified ·
1 Parent(s): de0fb20

Pre-deadline audit: honest sealed-test numbers in parse hint + model card, lookup timeout, roofline cache fix

Browse files
Files changed (5) hide show
  1. README.md +0 -2
  2. engine/hub_lookup.py +367 -366
  3. model/README.md +4 -2
  4. static/app.js +0 -0
  5. static/index.html +178 -178
README.md CHANGED
@@ -28,8 +28,6 @@ local `python app.py` stays instant.
28
 
29
  # FitCheck
30
 
31
- ## Creator - cn0303
32
-
33
  **What AI can your computer actually run?** And the other way round: **what
34
  computer do you need for the AI you want to run?**
35
 
 
28
 
29
  # FitCheck
30
 
 
 
31
  **What AI can your computer actually run?** And the other way round: **what
32
  computer do you need for the AI you want to run?**
33
 
engine/hub_lookup.py CHANGED
@@ -1,366 +1,367 @@
1
- """
2
- Optional ONLINE lookup: "will this exact Hugging Face model run on my machine?"
3
-
4
- Deterministic — no AI involved. Given any repo id (or model page URL), this:
5
- 1. checks the local catalogue (offline) by repo id and aliases;
6
- 2. otherwise makes ONE metadata call to the Hub, reads the model-tree tags
7
- (base_model:finetune/adapter/quantized/merge), and walks up to 3 hops to
8
- find a catalogue ancestor — "your finetune runs because its base runs";
9
- 3. otherwise falls back to raw parameter-count math, clearly labelled.
10
-
11
- This is the only part of FitCheck that touches the network at runtime, and the
12
- UI labels it as a live lookup. The deterministic advisor itself makes no
13
- network calls (the model bricks do: ZeroGPU narrator + spec parser).
14
- """
15
-
16
- import re
17
- from functools import lru_cache
18
-
19
- from .hardware import HardwareSpec
20
- from .real_advisor import (
21
- USE_CASES, _SAFETY_FILL, _C_MODEL, _C_WORK, _VERDICT_WORD,
22
- _evaluate, _option_json, catalogue, catalogue_date, advise_real,
23
- )
24
-
25
- _RELATION = re.compile(r"^base_model:(finetune|adapter|quantized|merge):(.+)$")
26
-
27
- # Hugging Face pipeline_tag -> (our family, comparison use-case). Only text
28
- # families (llm/vlm) get a decode-speed chart and a catalogue comparison; other
29
- # families get a memory estimate only. (Compute-roofline FPS/latency exists for
30
- # vision-detection and diffusion, but it needs per-model GFLOPs calibrated in
31
- # the catalogue, which an arbitrary looked-up repo does not carry — so lookup
32
- # stays memory-only there rather than guessing.) Anything unrecognised is
33
- # "other": a specialised model (robot policy / VLA / 3D / etc.) we size but
34
- # don't pretend to benchmark or run in a chatbot app.
35
- _FAMILY_UC = {
36
- "text-generation": ("llm", "chat"), "text2text-generation": ("llm", "chat"),
37
- "image-text-to-text": ("vlm", "vlm"), "visual-question-answering": ("vlm", "vlm"),
38
- "image-to-text": ("vlm", "vlm"),
39
- "automatic-speech-recognition": ("audio", None), "text-to-speech": ("audio", None),
40
- "text-to-audio": ("audio", None),
41
- "text-to-image": ("imagegen", None), "image-to-image": ("imagegen", None),
42
- "object-detection": ("vision", None), "image-segmentation": ("vision", None),
43
- "image-classification": ("vision", None), "depth-estimation": ("vision", None),
44
- "image-feature-extraction": ("vision", None),
45
- "feature-extraction": ("embed", None), "sentence-similarity": ("embed", None),
46
- }
47
-
48
- # Effective bits-per-weight for a synthesised quant ladder (k-quant layouts).
49
- _SYNTH_QUANTS = [
50
- ("Q8_0", "Near-full (8-bit)", 8.5), ("Q6_K", "High (6-bit)", 6.6),
51
- ("Q5_K_M", "Balanced+ (5-bit)", 5.7), ("Q4_K_M", "Balanced (4-bit)", 4.85),
52
- ("Q3_K_M", "Compact (3-bit)", 3.9),
53
- ]
54
-
55
-
56
- def _family_uc(pipeline_tag: str) -> tuple[str, str | None]:
57
- return _FAMILY_UC.get(pipeline_tag or "", ("other", None))
58
-
59
-
60
- def _family_from_arch(arch) -> tuple[str, str | None] | None:
61
- """Fallback classifier from config.json `architectures` when pipeline_tag is
62
- missing (common for base/instruct LLM repos like Mistral-Nemo)."""
63
- names = " ".join(arch or []).lower()
64
- if not names:
65
- return None
66
- if "forcausallm" in names or "forconditionalgeneration" in names:
67
- if any(k in names for k in ("vl", "vision", "llava", "idefics", "paligemma", "florence")):
68
- return ("vlm", "vlm")
69
- return ("llm", "chat")
70
- if any(k in names for k in ("objectdetection", "imageclassification",
71
- "segmentation", "depthestimation")):
72
- return ("vision", None)
73
- return None
74
-
75
-
76
- def _synthetic_entry(repo_id: str, info, family: str) -> dict | None:
77
- """Build a catalogue-shaped entry for a model NOT in our catalogue. Text
78
- families get a quant ladder (so they flow through the GGUF memory + speed
79
- path); everything else gets one estimated memory figure and NO speed chart."""
80
- st = getattr(info, "safetensors", None)
81
- total = getattr(st, "total", None) if st else None
82
- if not total:
83
- return None
84
- params_b = round(total / 1e9, 2)
85
- card = getattr(info, "card_data", None)
86
- lic = ""
87
- if card:
88
- lic = (card.get("license") if hasattr(card, "get") else getattr(card, "license", "")) or ""
89
- e = {
90
- "key": "_lookup", "name": repo_id.split("/")[-1], "repo_id": repo_id,
91
- "params_b": params_b, "provenance": "estimated",
92
- "good_for": f"{params_b:g}B parameters, looked up live on Hugging Face.",
93
- "license": lic, "gated": bool(getattr(info, "gated", False)),
94
- "links": {"hf": f"https://huggingface.co/{repo_id}"}, "use_cases": [],
95
- }
96
- if family in ("llm", "vlm"):
97
- e["family"] = family
98
- e["quants"] = [{"key": k, "plain": p, "file_gb": round(params_b * b / 8, 2)}
99
- for k, p, b in _SYNTH_QUANTS]
100
- else:
101
- # Flat memory: fp16 weights (~2 GB/B) plus working overhead. Conservative.
102
- e["family"] = family if family in ("vision", "imagegen", "audio", "embed") else "other"
103
- e["mem_gb"] = round(params_b * 2.2 + 0.6, 2)
104
- e["mem_provenance"] = "estimated"
105
- return e
106
-
107
-
108
- # Honest "how to run it" for a LOOKED-UP model: we have NOT verified a GGUF /
109
- # Ollama tag for it (unlike catalogue entries), so we never assert "ollama run
110
- # X". We point at the model card and the realistic tool category instead.
111
- def _lookup_run_guidance(family: str, repo_id: str) -> list[dict]:
112
- card = f"https://huggingface.co/{repo_id}"
113
- start = {"name": "Read the model card", "tag": "Start here",
114
- "what": "The model's own page lists the exact, up-to-date way to run it. Always start here.",
115
- "install": card}
116
- by_family = {
117
- "llm": [
118
- {"name": "Ollama / LM Studio", "tag": "If a GGUF exists",
119
- "what": "These run GGUF builds. Many popular models have one, some don't — search the model name on ollama.com or in LM Studio first.",
120
- "install": "ollama.com / lmstudio.ai"},
121
- {"name": "Transformers or vLLM", "tag": "Universal",
122
- "what": "Run the original weights directly, no GGUF needed. The fallback that always works.",
123
- "install": "pip install transformers"},
124
- ],
125
- "vlm": [
126
- {"name": "Transformers", "tag": "Universal",
127
- "what": "Most vision-language models run via Hugging Face Transformers. Some also have GGUF builds for Ollama/LM Studio — check the card.",
128
- "install": "pip install transformers"},
129
- ],
130
- "vision": [
131
- {"name": "Its own library", "tag": "Common",
132
- "what": "Vision models usually run through their framework (e.g. Ultralytics for YOLO) or Hugging Face Transformers. Not Ollama.",
133
- "install": "pip install transformers"},
134
- ],
135
- "imagegen": [
136
- {"name": "diffusers / ComfyUI", "tag": "Common",
137
- "what": "Image and video models run via Hugging Face diffusers or ComfyUI, not chat apps. The card says which.",
138
- "install": "pip install diffusers"},
139
- ],
140
- "audio": [
141
- {"name": "Transformers", "tag": "Common",
142
- "what": "Speech and audio models run via Hugging Face Transformers or the model's own library.",
143
- "install": "pip install transformers"},
144
- ],
145
- "embed": [
146
- {"name": "sentence-transformers", "tag": "Common",
147
- "what": "Embedding models load with sentence-transformers or Transformers.",
148
- "install": "pip install sentence-transformers"},
149
- ],
150
- "other": [
151
- {"name": "Its own framework", "tag": "Specialised",
152
- "what": "This is a specialised model (for example a robot policy / VLA, or a 3D model). It does NOT run in a chatbot app like Ollama. Follow the model card; these usually need a dedicated framework (e.g. the lerobot library for LeRobot policies).",
153
- "install": "see the model card"},
154
- ],
155
- }
156
- return [start] + by_family.get(family, by_family["other"])
157
-
158
-
159
- def _standalone_estimate(entry: dict, spec: HardwareSpec, finetune: bool) -> dict:
160
- """A memory-only estimate for a non-text model (no catalogue comparison, no
161
- decode-speed chart — both would be misleading for these families)."""
162
- r = _evaluate(entry, spec, USE_CASES["chat"])
163
- est, v, need = r["est"], r["verdict"], r["est"]["total"]
164
- fast, total = spec.fast_budget_gb, spec.total_budget_gb
165
- has_fast = spec.has_fast_path
166
- if spec.is_apple_silicon:
167
- fast_label, total_label = "GPU can use", "Unified memory"
168
- elif has_fast:
169
- fast_label, total_label = "On the GPU (VRAM)", "GPU + system RAM"
170
- else:
171
- fast_label, total_label = "", "System RAM (no GPU)"
172
- name = entry["name"]
173
- opt = _option_json(r, spec)
174
- if finetune:
175
- # Training a specialised non-text model is NOT the inference path: do not
176
- # imply run-time "feel" or a fit verdict for fine-tuning. Be explicit that
177
- # we don't compute training memory for this family (audit P1 #11).
178
- opt["feel"] = ""
179
- head = f"Fine-tuning {name} isn't auto-estimated for this model type."
180
- detail = (f"{name} is a specialised model (~{entry['params_b']:g}B). FitCheck doesn't compute "
181
- f"<b>training</b> memory for this family, so it won't give a fit verdict here. For "
182
- f"reference, <b>running</b> it takes ~<b>{need:g} GB</b> (parameter-count estimate, not "
183
- f"measured). Follow the model card for its training recipe.")
184
- note = "Training memory and method for this family aren't modelled — this is a run-only estimate."
185
- else:
186
- head = (f"{name} should fit on this machine." if v == "great" else
187
- f"{name} is tight here, but should run." if v == "tight" else
188
- f"{name} is too big for this machine.")
189
- detail = (f"{name} is about {entry['params_b']:g}B parameters. A rough estimate puts it at "
190
- f"~<b>{need:g} GB</b> to run (weights plus working space), and you have ~"
191
- f"<b>{fast:g} GB</b> on the GPU / <b>{total:g} GB</b> total. This is a parameter-count "
192
- f"estimate for a specialised model, not a measured figure.")
193
- note = ""
194
- scale = max(total, need, 1) * 1.05
195
- gauge = {
196
- "need_gb": f"{need:g} GB needed", "fast_gb": f"{fast:g} GB", "total_gb": f"{total:g} GB",
197
- "fast_label": fast_label, "total_label": total_label, "has_fast": has_fast,
198
- "fill_pct": round(min(need / scale, 1.0) * 100, 1),
199
- "mark_pct": round(min(fast / scale, 1.0) * 100, 1),
200
- "total_pct": round(min(total / scale, 1.0) * 100, 1),
201
- "breakdown": [{"label": f"Model + working space {need:g} GB", "color": _C_MODEL}],
202
- }
203
- return {
204
- "catalogue_version": catalogue_date(), "verdict": ("tight" if finetune else v),
205
- "verdict_word": ("Training not estimated" if finetune else _VERDICT_WORD[v]),
206
- "headline": head, "detail": detail, "note": note, "gauge": gauge,
207
- "options": [opt], "tools": [], "commands": {"intro": "", "items": []},
208
- "provenance": "The memory figure is estimated from the model's parameter count — conservative, not measured.",
209
- "speed": None, "meets_goal": (False if finetune else v in ("great", "tight")),
210
- "use_case": "this model", "usecase": "", "focus": name, "headline_model": name,
211
- }
212
-
213
-
214
- @lru_cache(maxsize=1)
215
- def _index() -> dict:
216
- idx = {}
217
- for e in catalogue()["entries"]:
218
- idx[e["repo_id"].lower()] = e
219
- for a in e.get("aliases", []):
220
- idx[a.lower()] = e
221
- return idx
222
-
223
-
224
- def normalize_repo_id(text: str) -> str:
225
- """Accept a bare repo id or any huggingface.co URL."""
226
- text = (text or "").strip().rstrip("/")
227
- m = re.search(r"huggingface\.co/([\w.-]+/[\w.-]+)", text)
228
- if m:
229
- return m.group(1)
230
- return text
231
-
232
-
233
- def _relations(info) -> list[tuple[str, str]]:
234
- out = []
235
- for t in (getattr(info, "tags", None) or []):
236
- m = _RELATION.match(t)
237
- if m:
238
- out.append((m.group(1), m.group(2)))
239
- if not out:
240
- # cardData fallback only when tags carry no typed relation — the tag
241
- # knows whether it's a finetune or a quantized copy; cardData doesn't.
242
- card = getattr(info, "card_data", None)
243
- if card:
244
- base = card.get("base_model") if hasattr(card, "get") else getattr(card, "base_model", None)
245
- if isinstance(base, str):
246
- out.append(("finetune", base))
247
- elif isinstance(base, list):
248
- out.extend(("finetune", b) for b in base if isinstance(b, str))
249
- return out
250
-
251
-
252
- def lookup(repo_input: str, payload: dict, spec: HardwareSpec) -> dict:
253
- """Returns {found, model, chain, verdict-ish fields} or {error}."""
254
- repo_id = normalize_repo_id(repo_input)
255
- if not re.fullmatch(r"[\w.-]+/[\w.-]+", repo_id):
256
- return {"error": f"'{repo_input}' doesn't look like a Hugging Face repo id "
257
- f"(expected something like author/model-name)."}
258
-
259
- uc = USE_CASES.get(payload.get("usecase", "chat"), USE_CASES["chat"])
260
- chain = [repo_id]
261
-
262
- # 1) Offline: direct catalogue hit (also via aliases).
263
- entry = _index().get(repo_id.lower())
264
- via = None
265
-
266
- # 2) Online: one metadata call + base-model walk.
267
- info = None
268
- if entry is None:
269
- from huggingface_hub import HfApi
270
- api = HfApi()
271
- current = repo_id
272
- try:
273
- info = api.model_info(current, expand=["tags", "safetensors", "cardData",
274
- "pipeline_tag", "config", "gated"])
275
- except Exception as exc: # noqa: BLE001 — surface the real failure
276
- return {"error": f"Couldn't find '{repo_id}' on Hugging Face "
277
- f"({type(exc).__name__}). Check the spelling?"}
278
- hop_info = info
279
- for _hop in range(3):
280
- rels = _relations(hop_info)
281
- if not rels:
282
- break
283
- # Prefer finetune/merge (same memory as base) over quantized.
284
- rels.sort(key=lambda r: 0 if r[0] in ("finetune", "merge", "adapter") else 1)
285
- rel, parent = rels[0]
286
- chain.append(parent)
287
- entry = _index().get(parent.lower())
288
- if entry is not None:
289
- via = {"relation": rel, "base": parent}
290
- break
291
- try:
292
- hop_info = api.model_info(parent, expand=["tags", "cardData"])
293
- except Exception: # noqa: BLE001 — chain ends here
294
- break
295
-
296
- if entry is not None:
297
- r = _evaluate(entry, spec, uc)
298
- opt = _option_json(r, spec)
299
- explain = f"<b>{repo_id.split('/')[-1]}</b> "
300
- if via:
301
- word = {"finetune": "is fine-tuned from", "merge": "is merged from",
302
- "adapter": "is an adapter on", "quantized": "is a compressed copy of"}[via["relation"]]
303
- explain += (f"{word} <b>{entry['name']}</b> — if the base runs, this runs, "
304
- f"with the same memory needs.")
305
- if via["relation"] == "adapter":
306
- explain += " Add roughly 0.1–0.5 GB for the adapter file."
307
- else:
308
- explain += f"is <b>{entry['name']}</b> in our catalogue."
309
- # The use case to re-render the full breakdown under (cross-family aware).
310
- fam = entry.get("family")
311
- uc_key = ("vlm" if fam == "vlm" else "chat" if fam == "llm"
312
- else (entry.get("use_cases") or [None])[0])
313
- return {"found": True, "match": "catalogue", "chain": chain,
314
- "explain": explain, "option": opt, "live": via is not None or info is not None,
315
- "focus_name": entry["name"], "uc_key": uc_key}
316
-
317
- # 3) Not in the catalogue: build a synthetic entry from its real parameter
318
- # count, sized and described per its model TYPE (so a VLA / detector / image
319
- # model is not treated as a chatbot). Text models flow through the full
320
- # engine (gauge + speed + comparison); other models get a memory-only
321
- # estimate with honest run guidance. Sizes are labelled estimates.
322
- pipe = getattr(info, "pipeline_tag", None) or ""
323
- family, uc_key = _family_uc(pipe)
324
- if family == "other": # no usable pipeline_tag — try the model architecture
325
- cfg = getattr(info, "config", None) or {}
326
- arch = cfg.get("architectures") if isinstance(cfg, dict) else getattr(cfg, "architectures", None)
327
- fb = _family_from_arch(arch)
328
- if fb:
329
- family, uc_key = fb
330
- synth = _synthetic_entry(repo_id, info, family)
331
- if synth is None:
332
- return {"error": f"'{repo_id}' exists, but doesn't share its size or a known "
333
- f"base model, so an honest estimate isn't possible."}
334
- name = repo_id.split("/")[-1]
335
- finetune = payload.get("mode") == "finetune"
336
-
337
- if uc_key: # text family: full breakdown, comparison, and (capped) speed
338
- look_payload = dict(payload)
339
- look_payload["usecase"] = uc_key
340
- look_payload["focus"] = name
341
- if finetune:
342
- from .finetune import advise_finetune
343
- advice = advise_finetune(look_payload, spec, extra_entries=[synth])
344
- else:
345
- advice = advise_real(look_payload, spec, extra_entries=[synth])
346
- extra = " the speed chart," if not finetune else ""
347
- explain = (f"<b>{name}</b> isn't in our catalogue, so its sizes are estimated from its "
348
- f"{synth['params_b']:g}B parameters (not exact file sizes). The memory breakdown,"
349
- f"{extra} and the comparison are computed the same way as for catalogue models.")
350
- else: # vision / image / audio / embed / other: memory-only estimate
351
- advice = _standalone_estimate(synth, spec, finetune)
352
- kind = {"vision": "a vision model", "imagegen": "an image/video model",
353
- "audio": "an audio model", "embed": "an embedding model"}.get(family,
354
- "a specialised model (it doesn't run in chatbot apps)")
355
- explain = (f"<b>{name}</b> isn't in our catalogue. It looks like {kind}, so this is a "
356
- f"memory estimate from its {synth['params_b']:g}B parameters — no decode-speed "
357
- f"chart, because tokens/second doesn't describe this kind of model.")
358
-
359
- # For RUNNING a looked-up model we have NOT verified a GGUF/Ollama tag, so
360
- # replace any asserted run commands with honest, model-card-first guidance.
361
- # Fine-tuning guidance (Unsloth/TRL + the QLoRA recipe) is generic and stays.
362
- if not (finetune and uc_key):
363
- advice["tools"] = _lookup_run_guidance(family, repo_id)
364
- advice["commands"] = {"intro": "", "items": []}
365
- return {"found": True, "match": "estimate", "chain": chain, "live": True,
366
- "explain": explain, "advice": advice}
 
 
1
+ """
2
+ Optional ONLINE lookup: "will this exact Hugging Face model run on my machine?"
3
+
4
+ Deterministic — no AI involved. Given any repo id (or model page URL), this:
5
+ 1. checks the local catalogue (offline) by repo id and aliases;
6
+ 2. otherwise makes ONE metadata call to the Hub, reads the model-tree tags
7
+ (base_model:finetune/adapter/quantized/merge), and walks up to 3 hops to
8
+ find a catalogue ancestor — "your finetune runs because its base runs";
9
+ 3. otherwise falls back to raw parameter-count math, clearly labelled.
10
+
11
+ This is the only part of FitCheck that touches the network at runtime, and the
12
+ UI labels it as a live lookup. The deterministic advisor itself makes no
13
+ network calls (the model bricks do: ZeroGPU narrator + spec parser).
14
+ """
15
+
16
+ import re
17
+ from functools import lru_cache
18
+
19
+ from .hardware import HardwareSpec
20
+ from .real_advisor import (
21
+ USE_CASES, _SAFETY_FILL, _C_MODEL, _C_WORK, _VERDICT_WORD,
22
+ _evaluate, _option_json, catalogue, catalogue_date, advise_real,
23
+ )
24
+
25
+ _RELATION = re.compile(r"^base_model:(finetune|adapter|quantized|merge):(.+)$")
26
+
27
+ # Hugging Face pipeline_tag -> (our family, comparison use-case). Only text
28
+ # families (llm/vlm) get a decode-speed chart and a catalogue comparison; other
29
+ # families get a memory estimate only. (Compute-roofline FPS/latency exists for
30
+ # vision-detection and diffusion, but it needs per-model GFLOPs calibrated in
31
+ # the catalogue, which an arbitrary looked-up repo does not carry — so lookup
32
+ # stays memory-only there rather than guessing.) Anything unrecognised is
33
+ # "other": a specialised model (robot policy / VLA / 3D / etc.) we size but
34
+ # don't pretend to benchmark or run in a chatbot app.
35
+ _FAMILY_UC = {
36
+ "text-generation": ("llm", "chat"), "text2text-generation": ("llm", "chat"),
37
+ "image-text-to-text": ("vlm", "vlm"), "visual-question-answering": ("vlm", "vlm"),
38
+ "image-to-text": ("vlm", "vlm"),
39
+ "automatic-speech-recognition": ("audio", None), "text-to-speech": ("audio", None),
40
+ "text-to-audio": ("audio", None),
41
+ "text-to-image": ("imagegen", None), "image-to-image": ("imagegen", None),
42
+ "object-detection": ("vision", None), "image-segmentation": ("vision", None),
43
+ "image-classification": ("vision", None), "depth-estimation": ("vision", None),
44
+ "image-feature-extraction": ("vision", None),
45
+ "feature-extraction": ("embed", None), "sentence-similarity": ("embed", None),
46
+ }
47
+
48
+ # Effective bits-per-weight for a synthesised quant ladder (k-quant layouts).
49
+ _SYNTH_QUANTS = [
50
+ ("Q8_0", "Near-full (8-bit)", 8.5), ("Q6_K", "High (6-bit)", 6.6),
51
+ ("Q5_K_M", "Balanced+ (5-bit)", 5.7), ("Q4_K_M", "Balanced (4-bit)", 4.85),
52
+ ("Q3_K_M", "Compact (3-bit)", 3.9),
53
+ ]
54
+
55
+
56
+ def _family_uc(pipeline_tag: str) -> tuple[str, str | None]:
57
+ return _FAMILY_UC.get(pipeline_tag or "", ("other", None))
58
+
59
+
60
+ def _family_from_arch(arch) -> tuple[str, str | None] | None:
61
+ """Fallback classifier from config.json `architectures` when pipeline_tag is
62
+ missing (common for base/instruct LLM repos like Mistral-Nemo)."""
63
+ names = " ".join(arch or []).lower()
64
+ if not names:
65
+ return None
66
+ if "forcausallm" in names or "forconditionalgeneration" in names:
67
+ if any(k in names for k in ("vl", "vision", "llava", "idefics", "paligemma", "florence")):
68
+ return ("vlm", "vlm")
69
+ return ("llm", "chat")
70
+ if any(k in names for k in ("objectdetection", "imageclassification",
71
+ "segmentation", "depthestimation")):
72
+ return ("vision", None)
73
+ return None
74
+
75
+
76
+ def _synthetic_entry(repo_id: str, info, family: str) -> dict | None:
77
+ """Build a catalogue-shaped entry for a model NOT in our catalogue. Text
78
+ families get a quant ladder (so they flow through the GGUF memory + speed
79
+ path); everything else gets one estimated memory figure and NO speed chart."""
80
+ st = getattr(info, "safetensors", None)
81
+ total = getattr(st, "total", None) if st else None
82
+ if not total:
83
+ return None
84
+ params_b = round(total / 1e9, 2)
85
+ card = getattr(info, "card_data", None)
86
+ lic = ""
87
+ if card:
88
+ lic = (card.get("license") if hasattr(card, "get") else getattr(card, "license", "")) or ""
89
+ e = {
90
+ "key": "_lookup", "name": repo_id.split("/")[-1], "repo_id": repo_id,
91
+ "params_b": params_b, "provenance": "estimated",
92
+ "good_for": f"{params_b:g}B parameters, looked up live on Hugging Face.",
93
+ "license": lic, "gated": bool(getattr(info, "gated", False)),
94
+ "links": {"hf": f"https://huggingface.co/{repo_id}"}, "use_cases": [],
95
+ }
96
+ if family in ("llm", "vlm"):
97
+ e["family"] = family
98
+ e["quants"] = [{"key": k, "plain": p, "file_gb": round(params_b * b / 8, 2)}
99
+ for k, p, b in _SYNTH_QUANTS]
100
+ else:
101
+ # Flat memory: fp16 weights (~2 GB/B) plus working overhead. Conservative.
102
+ e["family"] = family if family in ("vision", "imagegen", "audio", "embed") else "other"
103
+ e["mem_gb"] = round(params_b * 2.2 + 0.6, 2)
104
+ e["mem_provenance"] = "estimated"
105
+ return e
106
+
107
+
108
+ # Honest "how to run it" for a LOOKED-UP model: we have NOT verified a GGUF /
109
+ # Ollama tag for it (unlike catalogue entries), so we never assert "ollama run
110
+ # X". We point at the model card and the realistic tool category instead.
111
+ def _lookup_run_guidance(family: str, repo_id: str) -> list[dict]:
112
+ card = f"https://huggingface.co/{repo_id}"
113
+ start = {"name": "Read the model card", "tag": "Start here",
114
+ "what": "The model's own page lists the exact, up-to-date way to run it. Always start here.",
115
+ "install": card}
116
+ by_family = {
117
+ "llm": [
118
+ {"name": "Ollama / LM Studio", "tag": "If a GGUF exists",
119
+ "what": "These run GGUF builds. Many popular models have one, some don't — search the model name on ollama.com or in LM Studio first.",
120
+ "install": "ollama.com / lmstudio.ai"},
121
+ {"name": "Transformers or vLLM", "tag": "Universal",
122
+ "what": "Run the original weights directly, no GGUF needed. The fallback that always works.",
123
+ "install": "pip install transformers"},
124
+ ],
125
+ "vlm": [
126
+ {"name": "Transformers", "tag": "Universal",
127
+ "what": "Most vision-language models run via Hugging Face Transformers. Some also have GGUF builds for Ollama/LM Studio — check the card.",
128
+ "install": "pip install transformers"},
129
+ ],
130
+ "vision": [
131
+ {"name": "Its own library", "tag": "Common",
132
+ "what": "Vision models usually run through their framework (e.g. Ultralytics for YOLO) or Hugging Face Transformers. Not Ollama.",
133
+ "install": "pip install transformers"},
134
+ ],
135
+ "imagegen": [
136
+ {"name": "diffusers / ComfyUI", "tag": "Common",
137
+ "what": "Image and video models run via Hugging Face diffusers or ComfyUI, not chat apps. The card says which.",
138
+ "install": "pip install diffusers"},
139
+ ],
140
+ "audio": [
141
+ {"name": "Transformers", "tag": "Common",
142
+ "what": "Speech and audio models run via Hugging Face Transformers or the model's own library.",
143
+ "install": "pip install transformers"},
144
+ ],
145
+ "embed": [
146
+ {"name": "sentence-transformers", "tag": "Common",
147
+ "what": "Embedding models load with sentence-transformers or Transformers.",
148
+ "install": "pip install sentence-transformers"},
149
+ ],
150
+ "other": [
151
+ {"name": "Its own framework", "tag": "Specialised",
152
+ "what": "This is a specialised model (for example a robot policy / VLA, or a 3D model). It does NOT run in a chatbot app like Ollama. Follow the model card; these usually need a dedicated framework (e.g. the lerobot library for LeRobot policies).",
153
+ "install": "see the model card"},
154
+ ],
155
+ }
156
+ return [start] + by_family.get(family, by_family["other"])
157
+
158
+
159
+ def _standalone_estimate(entry: dict, spec: HardwareSpec, finetune: bool) -> dict:
160
+ """A memory-only estimate for a non-text model (no catalogue comparison, no
161
+ decode-speed chart — both would be misleading for these families)."""
162
+ r = _evaluate(entry, spec, USE_CASES["chat"])
163
+ est, v, need = r["est"], r["verdict"], r["est"]["total"]
164
+ fast, total = spec.fast_budget_gb, spec.total_budget_gb
165
+ has_fast = spec.has_fast_path
166
+ if spec.is_apple_silicon:
167
+ fast_label, total_label = "GPU can use", "Unified memory"
168
+ elif has_fast:
169
+ fast_label, total_label = "On the GPU (VRAM)", "GPU + system RAM"
170
+ else:
171
+ fast_label, total_label = "", "System RAM (no GPU)"
172
+ name = entry["name"]
173
+ opt = _option_json(r, spec)
174
+ if finetune:
175
+ # Training a specialised non-text model is NOT the inference path: do not
176
+ # imply run-time "feel" or a fit verdict for fine-tuning. Be explicit that
177
+ # we don't compute training memory for this family (audit P1 #11).
178
+ opt["feel"] = ""
179
+ head = f"Fine-tuning {name} isn't auto-estimated for this model type."
180
+ detail = (f"{name} is a specialised model (~{entry['params_b']:g}B). FitCheck doesn't compute "
181
+ f"<b>training</b> memory for this family, so it won't give a fit verdict here. For "
182
+ f"reference, <b>running</b> it takes ~<b>{need:g} GB</b> (parameter-count estimate, not "
183
+ f"measured). Follow the model card for its training recipe.")
184
+ note = "Training memory and method for this family aren't modelled — this is a run-only estimate."
185
+ else:
186
+ head = (f"{name} should fit on this machine." if v == "great" else
187
+ f"{name} is tight here, but should run." if v == "tight" else
188
+ f"{name} is too big for this machine.")
189
+ detail = (f"{name} is about {entry['params_b']:g}B parameters. A rough estimate puts it at "
190
+ f"~<b>{need:g} GB</b> to run (weights plus working space), and you have ~"
191
+ f"<b>{fast:g} GB</b> on the GPU / <b>{total:g} GB</b> total. This is a parameter-count "
192
+ f"estimate for a specialised model, not a measured figure.")
193
+ note = ""
194
+ scale = max(total, need, 1) * 1.05
195
+ gauge = {
196
+ "need_gb": f"{need:g} GB needed", "fast_gb": f"{fast:g} GB", "total_gb": f"{total:g} GB",
197
+ "fast_label": fast_label, "total_label": total_label, "has_fast": has_fast,
198
+ "fill_pct": round(min(need / scale, 1.0) * 100, 1),
199
+ "mark_pct": round(min(fast / scale, 1.0) * 100, 1),
200
+ "total_pct": round(min(total / scale, 1.0) * 100, 1),
201
+ "breakdown": [{"label": f"Model + working space {need:g} GB", "color": _C_MODEL}],
202
+ }
203
+ return {
204
+ "catalogue_version": catalogue_date(), "verdict": ("tight" if finetune else v),
205
+ "verdict_word": ("Training not estimated" if finetune else _VERDICT_WORD[v]),
206
+ "headline": head, "detail": detail, "note": note, "gauge": gauge,
207
+ "options": [opt], "tools": [], "commands": {"intro": "", "items": []},
208
+ "provenance": "The memory figure is estimated from the model's parameter count — conservative, not measured.",
209
+ "speed": None, "meets_goal": (False if finetune else v in ("great", "tight")),
210
+ "use_case": "this model", "usecase": "", "focus": name, "headline_model": name,
211
+ }
212
+
213
+
214
+ @lru_cache(maxsize=1)
215
+ def _index() -> dict:
216
+ idx = {}
217
+ for e in catalogue()["entries"]:
218
+ idx[e["repo_id"].lower()] = e
219
+ for a in e.get("aliases", []):
220
+ idx[a.lower()] = e
221
+ return idx
222
+
223
+
224
+ def normalize_repo_id(text: str) -> str:
225
+ """Accept a bare repo id or any huggingface.co URL."""
226
+ text = (text or "").strip().rstrip("/")
227
+ m = re.search(r"huggingface\.co/([\w.-]+/[\w.-]+)", text)
228
+ if m:
229
+ return m.group(1)
230
+ return text
231
+
232
+
233
+ def _relations(info) -> list[tuple[str, str]]:
234
+ out = []
235
+ for t in (getattr(info, "tags", None) or []):
236
+ m = _RELATION.match(t)
237
+ if m:
238
+ out.append((m.group(1), m.group(2)))
239
+ if not out:
240
+ # cardData fallback only when tags carry no typed relation — the tag
241
+ # knows whether it's a finetune or a quantized copy; cardData doesn't.
242
+ card = getattr(info, "card_data", None)
243
+ if card:
244
+ base = card.get("base_model") if hasattr(card, "get") else getattr(card, "base_model", None)
245
+ if isinstance(base, str):
246
+ out.append(("finetune", base))
247
+ elif isinstance(base, list):
248
+ out.extend(("finetune", b) for b in base if isinstance(b, str))
249
+ return out
250
+
251
+
252
+ def lookup(repo_input: str, payload: dict, spec: HardwareSpec) -> dict:
253
+ """Returns {found, model, chain, verdict-ish fields} or {error}."""
254
+ repo_id = normalize_repo_id(repo_input)
255
+ if not re.fullmatch(r"[\w.-]+/[\w.-]+", repo_id):
256
+ return {"error": f"'{repo_input}' doesn't look like a Hugging Face repo id "
257
+ f"(expected something like author/model-name)."}
258
+
259
+ uc = USE_CASES.get(payload.get("usecase", "chat"), USE_CASES["chat"])
260
+ chain = [repo_id]
261
+
262
+ # 1) Offline: direct catalogue hit (also via aliases).
263
+ entry = _index().get(repo_id.lower())
264
+ via = None
265
+
266
+ # 2) Online: one metadata call + base-model walk.
267
+ info = None
268
+ if entry is None:
269
+ from huggingface_hub import HfApi
270
+ api = HfApi()
271
+ current = repo_id
272
+ try:
273
+ info = api.model_info(current, expand=["tags", "safetensors", "cardData",
274
+ "pipeline_tag", "config", "gated"],
275
+ timeout=10)
276
+ except Exception as exc: # noqa: BLE001 — surface the real failure
277
+ return {"error": f"Couldn't find '{repo_id}' on Hugging Face "
278
+ f"({type(exc).__name__}). Check the spelling?"}
279
+ hop_info = info
280
+ for _hop in range(3):
281
+ rels = _relations(hop_info)
282
+ if not rels:
283
+ break
284
+ # Prefer finetune/merge (same memory as base) over quantized.
285
+ rels.sort(key=lambda r: 0 if r[0] in ("finetune", "merge", "adapter") else 1)
286
+ rel, parent = rels[0]
287
+ chain.append(parent)
288
+ entry = _index().get(parent.lower())
289
+ if entry is not None:
290
+ via = {"relation": rel, "base": parent}
291
+ break
292
+ try:
293
+ hop_info = api.model_info(parent, expand=["tags", "cardData"], timeout=10)
294
+ except Exception: # noqa: BLE001 — chain ends here
295
+ break
296
+
297
+ if entry is not None:
298
+ r = _evaluate(entry, spec, uc)
299
+ opt = _option_json(r, spec)
300
+ explain = f"<b>{repo_id.split('/')[-1]}</b> "
301
+ if via:
302
+ word = {"finetune": "is fine-tuned from", "merge": "is merged from",
303
+ "adapter": "is an adapter on", "quantized": "is a compressed copy of"}[via["relation"]]
304
+ explain += (f"{word} <b>{entry['name']}</b> — if the base runs, this runs, "
305
+ f"with the same memory needs.")
306
+ if via["relation"] == "adapter":
307
+ explain += " Add roughly 0.1–0.5 GB for the adapter file."
308
+ else:
309
+ explain += f"is <b>{entry['name']}</b> in our catalogue."
310
+ # The use case to re-render the full breakdown under (cross-family aware).
311
+ fam = entry.get("family")
312
+ uc_key = ("vlm" if fam == "vlm" else "chat" if fam == "llm"
313
+ else (entry.get("use_cases") or [None])[0])
314
+ return {"found": True, "match": "catalogue", "chain": chain,
315
+ "explain": explain, "option": opt, "live": via is not None or info is not None,
316
+ "focus_name": entry["name"], "uc_key": uc_key}
317
+
318
+ # 3) Not in the catalogue: build a synthetic entry from its real parameter
319
+ # count, sized and described per its model TYPE (so a VLA / detector / image
320
+ # model is not treated as a chatbot). Text models flow through the full
321
+ # engine (gauge + speed + comparison); other models get a memory-only
322
+ # estimate with honest run guidance. Sizes are labelled estimates.
323
+ pipe = getattr(info, "pipeline_tag", None) or ""
324
+ family, uc_key = _family_uc(pipe)
325
+ if family == "other": # no usable pipeline_tag — try the model architecture
326
+ cfg = getattr(info, "config", None) or {}
327
+ arch = cfg.get("architectures") if isinstance(cfg, dict) else getattr(cfg, "architectures", None)
328
+ fb = _family_from_arch(arch)
329
+ if fb:
330
+ family, uc_key = fb
331
+ synth = _synthetic_entry(repo_id, info, family)
332
+ if synth is None:
333
+ return {"error": f"'{repo_id}' exists, but doesn't share its size or a known "
334
+ f"base model, so an honest estimate isn't possible."}
335
+ name = repo_id.split("/")[-1]
336
+ finetune = payload.get("mode") == "finetune"
337
+
338
+ if uc_key: # text family: full breakdown, comparison, and (capped) speed
339
+ look_payload = dict(payload)
340
+ look_payload["usecase"] = uc_key
341
+ look_payload["focus"] = name
342
+ if finetune:
343
+ from .finetune import advise_finetune
344
+ advice = advise_finetune(look_payload, spec, extra_entries=[synth])
345
+ else:
346
+ advice = advise_real(look_payload, spec, extra_entries=[synth])
347
+ extra = " the speed chart," if not finetune else ""
348
+ explain = (f"<b>{name}</b> isn't in our catalogue, so its sizes are estimated from its "
349
+ f"{synth['params_b']:g}B parameters (not exact file sizes). The memory breakdown,"
350
+ f"{extra} and the comparison are computed the same way as for catalogue models.")
351
+ else: # vision / image / audio / embed / other: memory-only estimate
352
+ advice = _standalone_estimate(synth, spec, finetune)
353
+ kind = {"vision": "a vision model", "imagegen": "an image/video model",
354
+ "audio": "an audio model", "embed": "an embedding model"}.get(family,
355
+ "a specialised model (it doesn't run in chatbot apps)")
356
+ explain = (f"<b>{name}</b> isn't in our catalogue. It looks like {kind}, so this is a "
357
+ f"memory estimate from its {synth['params_b']:g}B parameters — no decode-speed "
358
+ f"chart, because tokens/second doesn't describe this kind of model.")
359
+
360
+ # For RUNNING a looked-up model we have NOT verified a GGUF/Ollama tag, so
361
+ # replace any asserted run commands with honest, model-card-first guidance.
362
+ # Fine-tuning guidance (Unsloth/TRL + the QLoRA recipe) is generic and stays.
363
+ if not (finetune and uc_key):
364
+ advice["tools"] = _lookup_run_guidance(family, repo_id)
365
+ advice["commands"] = {"intro": "", "items": []}
366
+ return {"found": True, "match": "estimate", "chain": chain, "live": True,
367
+ "explain": explain, "advice": advice}
model/README.md CHANGED
@@ -51,8 +51,10 @@ Trained 2026-06-10.
51
  bootstrap CI on the median per-accelerator gain includes zero.
52
  - The "likely" interval shown in the UI is a fixed ±20% heuristic, **not
53
  calibrated** (out-of-fold coverage ≈43%). Treat it as a rough range.
54
- - An independent llama.cpp benchmark set exists but is not yet used for
55
- evaluation.
 
 
56
 
57
  **Shipping rule:** the model ships because it beats the analytical baseline on
58
  median held-out error; if a retrain fails that, FitCheck falls back to the
 
51
  bootstrap CI on the median per-accelerator gain includes zero.
52
  - The "likely" interval shown in the UI is a fixed ±20% heuristic, **not
53
  calibrated** (out-of-fold coverage ≈43%). Treat it as a rough range.
54
+ - An independent llama.cpp benchmark set (Apple unified-memory) is used as an
55
+ out-of-source check: the shipping roofline path is ~29% median APE on it
56
+ (28.6% on the current set), systematically under-predicting Apple speed. See
57
+ `scripts/eval_speed_independent.py` and `artifacts/speed_independent.json`.
58
 
59
  **Shipping rule:** the model ships because it beats the analytical baseline on
60
  median held-out error; if a retrain fails that, FitCheck falls back to the
static/app.js CHANGED
The diff for this file is too large to render. See raw diff
 
static/index.html CHANGED
@@ -1,178 +1,178 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>FitCheck - what AI can your computer run?</title>
7
- <meta name="description" content="Tell FitCheck about your computer in plain words. Get an honest answer about what AI you can actually run on it, from chatbots to object detection, and how to start." />
8
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
- <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
10
- <link rel="stylesheet" href="/static/style.css" />
11
- </head>
12
- <body>
13
- <header class="topbar">
14
- <div class="logo">
15
- <span class="logo-mark"><span class="ic" data-ic="check"></span></span>
16
- <span>Fit<span class="tick">Check</span></span>
17
- </div>
18
- <div class="spacer"></div>
19
- <nav>
20
- <a href="#how">How it works</a>
21
- <a href="#glossary-anchor">Jargon, explained</a>
22
- </nav>
23
- <div class="statuschip"><span class="dot"></span><span class="lbl">engine</span> <b id="cat-version-chip">local</b></div>
24
- </header>
25
-
26
- <main class="container">
27
- <section class="hero">
28
- <h1>What AI can <span class="accent">your computer</span> actually run?</h1>
29
- <p>Tell FitCheck about your setup in plain words. It tells you honestly what you
30
- can run today, from chatbots to object detection, what it will feel like, and exactly how to start.</p>
31
- </section>
32
-
33
- <div class="layout">
34
- <!-- ============================== INPUTS ============================== -->
35
- <aside class="panel form-panel">
36
- <div class="panel-head"><span class="lbl">input</span><span class="lbl">01</span></div>
37
- <div class="panel-body">
38
- <!-- Mode: check what I own, or advise what to buy -->
39
- <div class="field" style="margin-bottom:var(--s-5)">
40
- <div class="segmented" id="mode-seg">
41
- <button class="seg-btn active" data-val="have"><span class="ic" data-ic="monitor"></span>Check my computer</button>
42
- <button class="seg-btn" data-val="buy"><span class="ic" data-ic="search"></span>Help me pick one</button>
43
- </div>
44
- </div>
45
-
46
- <!-- Step 1: machine -->
47
- <div class="step" id="machine-step">
48
- <div class="step-head"><span class="step-num">1</span><h2>Your computer</h2></div>
49
-
50
- <div class="field">
51
- <span class="label">Describe it in your own words <span class="optional">(fastest)</span></span>
52
- <textarea id="paste" placeholder="'Dell XPS, RTX 3050, 16GB' - or paste your dxdiag / Task Manager output..."></textarea>
53
- <button class="parse-btn" id="parse-btn">Fill the form from this</button>
54
- <div class="hint" id="parse-hint">A small model fine-tuned for this reads your text and fills the pickers below. It's trained not to invent specs (about 1% invented-field rate on our dev set); anything you didn't say stays blank.</div>
55
- </div>
56
-
57
- <div class="field">
58
- <span class="label">What kind of computer?</span>
59
- <div class="segmented" id="computer-seg">
60
- <button class="seg-btn active" data-val="Windows laptop"><span class="ic brand" data-ic="brand-windows"></span>Windows laptop</button>
61
- <button class="seg-btn" data-val="Windows desktop"><span class="ic brand" data-ic="brand-windows"></span>Windows desktop</button>
62
- <button class="seg-btn" data-val="Mac"><span class="ic brand" data-ic="brand-apple"></span>Mac</button>
63
- <button class="seg-btn" data-val="Linux PC"><span class="ic brand" data-ic="brand-linux"></span>Linux PC</button>
64
- <button class="seg-btn" data-val="Mini PC / Raspberry Pi" style="grid-column:1/-1"><span class="ic brand" data-ic="brand-raspberrypi"></span>Mini PC / Raspberry Pi</button>
65
- </div>
66
- </div>
67
-
68
- <div class="field">
69
- <span class="label" id="ram-label">Memory (RAM)</span>
70
- <select id="ram">
71
- <option>2 GB</option><option>4 GB</option><option>8 GB</option>
72
- <option selected>16 GB</option><option>24 GB</option><option>32 GB</option>
73
- <option>48 GB</option><option>64 GB</option><option>96 GB</option><option>128 GB</option>
74
- </select>
75
- <div class="hint">Not sure? See "How do I find my specs?" below.</div>
76
- </div>
77
-
78
- <div class="field" id="provider-field">
79
- <span class="label">Graphics (GPU)</span>
80
- <div class="segmented cols-3" id="provider-seg">
81
- <button class="seg-btn active" data-val="none">None / built-in</button>
82
- <button class="seg-btn" data-val="nvidia"><span class="ic brand" data-ic="brand-nvidia"></span>NVIDIA</button>
83
- <button class="seg-btn" data-val="amd"><span class="ic brand" data-ic="brand-amd"></span>AMD</button>
84
- <button class="seg-btn" data-val="apple"><span class="ic brand" data-ic="brand-apple"></span>Apple</button>
85
- <button class="seg-btn" data-val="intel"><span class="ic brand" data-ic="brand-intel"></span>Intel</button>
86
- <button class="seg-btn" data-val="unsure">Not sure</button>
87
- </div>
88
- <select id="gpu" style="margin-top:var(--s-3); display:none"></select>
89
- </div>
90
-
91
- <details class="disc" id="advanced-disc">
92
- <summary>Advanced: enter exact numbers <span class="chev ic" data-ic="chevron"></span></summary>
93
- <div class="disc-body">
94
- <div class="field">
95
- <span class="label">Graphics memory (VRAM), if you know it</span>
96
- <input type="number" id="vram" placeholder="e.g. 8" min="0" max="200" step="1" />
97
- <div class="hint" id="vram-hint">Overrides the GPU picker above. Leave blank to use the picker.</div>
98
- </div>
99
- </div>
100
- </details>
101
- </div>
102
-
103
- <!-- Step 2: goal -->
104
- <div class="step">
105
- <div class="step-head"><span class="step-num">2</span><h2>What do you want to do? <span class="optional">(pick one or several)</span></h2></div>
106
- <div class="task-toggle" id="task-toggle" role="tablist"
107
- data-tip="Running a model and fine-tuning it need very different memory. Switch this and the recommendations below recompute for training.">
108
- <button class="tt-opt active" data-task="run" role="tab"><span class="ic" data-ic="run"></span>Run a model</button>
109
- <button class="tt-opt" data-task="finetune" role="tab"><span class="ic" data-ic="finetune"></span>Train / fine-tune</button>
110
- <span class="tt-slider" aria-hidden="true"></span>
111
- </div>
112
- <div id="usecase-picker"><!-- rendered by app.js --></div>
113
- <div class="field" id="repo-field" style="margin-top:var(--s-3); margin-bottom:0; display:none">
114
- <span class="label">Paste the model to check</span>
115
- <input type="text" id="repo-check" placeholder="Hugging Face model id or link, e.g. lerobot/smolvla_base" />
116
- <div class="hint">FitCheck gives a full breakdown for <b>many</b> models, memory, and for text models speed and a comparison, <b>even ones not in our catalogue</b>, via a live Hugging Face lookup (needs Safetensors metadata). The lookup needs network; the deterministic advice is local.</div>
117
- </div>
118
- </div>
119
-
120
- <!-- Step 3: preference -->
121
- <div class="step" id="priority-step">
122
- <div class="step-head"><span class="step-num">3</span><h2>What matters most? <span class="optional">(optional)</span></h2></div>
123
- <div class="field" style="margin-bottom:0">
124
- <div class="segmented" id="priority-seg">
125
- <button class="seg-btn active" data-val="balanced" data-tip="Our default: the best mix of quality and speed your machine can comfortably handle."><span class="ic" data-ic="balanced"></span>Balanced</button>
126
- <button class="seg-btn" data-val="quality" data-tip="Pick the most capable model that runs, even if it's slower or tight on memory."><span class="ic" data-ic="quality"></span>Best quality</button>
127
- <button class="seg-btn" data-val="speed" data-tip="Prefer the snappiest model (smaller, or mixture-of-experts) for instant replies."><span class="ic" data-ic="speed"></span>Fastest</button>
128
- <button class="seg-btn" data-val="open" data-tip="Prefers open-licensed, ungated, commercial-friendly models (no sign-in or non-commercial licence). Any downloaded model then runs locally."><span class="ic" data-ic="offline"></span>Fully open</button>
129
- </div>
130
- </div>
131
- </div>
132
-
133
- <button class="cta" id="check-btn">Check my setup <span class="ic" data-ic="arrow"></span></button>
134
-
135
- <details class="disc" id="find-specs">
136
- <summary><span class="ic sum-ic" data-ic="search"></span>How do I find my specs? <span class="chev ic" data-ic="chevron"></span></summary>
137
- <div class="disc-body" id="find-specs-body"><!-- filled by app.js per computer type --></div>
138
- </details>
139
-
140
- <span id="glossary-anchor"></span>
141
- <details class="disc" id="glossary">
142
- <summary><span class="ic sum-ic" data-ic="book"></span>What do these words mean? <span class="chev ic" data-ic="chevron"></span></summary>
143
- <div class="disc-body">
144
- <dl>
145
- <div><dt>Model</dt><dd>The AI's "brain". Bigger means smarter, but heavier.</dd></div>
146
- <div><dt>Parameters (e.g. 7B)</dt><dd>How big the brain is. 7B is 7 billion. More means smarter and hungrier for memory.</dd></div>
147
- <div><dt>Quantisation (4-bit, 8-bit)</dt><dd>Shrinking a model so it fits. 4-bit is the popular sweet spot: much smaller, barely-noticeable quality loss.</dd></div>
148
- <div><dt>VRAM</dt><dd>The fast memory on a graphics card. The biggest factor in what runs quickly.</dd></div>
149
- <div><dt>RAM</dt><dd>Your computer's normal memory. Models can use it too, but it is slower.</dd></div>
150
- <div><dt>GGUF</dt><dd>A single-file model format made for running locally.</dd></div>
151
- </dl>
152
- </div>
153
- </details>
154
- </div>
155
- </aside>
156
-
157
- <!-- ============================== RESULTS ============================== -->
158
- <section class="panel results-panel" id="results">
159
- <div class="empty-state">
160
- <div class="big"><span class="ic" data-ic="monitor"></span></div>
161
- <h2>Your honest answer appears here</h2>
162
- <p>Fill in your computer and what you want to do, then press <b>Check my setup</b>. Results update as you change things.</p>
163
- </div>
164
- </section>
165
- </div>
166
-
167
- <footer class="foot" id="how">
168
- <p>FitCheck gives <b>conservative</b> estimates from a transparent rules engine.
169
- GGUF sizes are <b>real Hugging Face file sizes</b> (shown rounded); other sizes and all chat-memory
170
- figures are deliberately pessimistic estimates. It would rather under-promise than over-promise. Real speed depends on your exact chip, drivers and settings.</p>
171
- <p style="margin-top:var(--s-2)">Catalogue of real models last verified <b id="cat-version">local</b>. Built for the Hugging Face Build Small hackathon.</p>
172
- </footer>
173
- </main>
174
-
175
- <script src="/static/icons.js"></script>
176
- <script src="/static/app.js"></script>
177
- </body>
178
- </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>FitCheck - what AI can your computer run?</title>
7
+ <meta name="description" content="Tell FitCheck about your computer in plain words. Get an honest answer about what AI you can actually run on it, from chatbots to object detection, and how to start." />
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
10
+ <link rel="stylesheet" href="/static/style.css" />
11
+ </head>
12
+ <body>
13
+ <header class="topbar">
14
+ <div class="logo">
15
+ <span class="logo-mark"><span class="ic" data-ic="check"></span></span>
16
+ <span>Fit<span class="tick">Check</span></span>
17
+ </div>
18
+ <div class="spacer"></div>
19
+ <nav>
20
+ <a href="#how">How it works</a>
21
+ <a href="#glossary-anchor">Jargon, explained</a>
22
+ </nav>
23
+ <div class="statuschip"><span class="dot"></span><span class="lbl">engine</span> <b id="cat-version-chip">local</b></div>
24
+ </header>
25
+
26
+ <main class="container">
27
+ <section class="hero">
28
+ <h1>What AI can <span class="accent">your computer</span> actually run?</h1>
29
+ <p>Tell FitCheck about your setup in plain words. It tells you honestly what you
30
+ can run today, from chatbots to object detection, what it will feel like, and exactly how to start.</p>
31
+ </section>
32
+
33
+ <div class="layout">
34
+ <!-- ============================== INPUTS ============================== -->
35
+ <aside class="panel form-panel">
36
+ <div class="panel-head"><span class="lbl">input</span><span class="lbl">01</span></div>
37
+ <div class="panel-body">
38
+ <!-- Mode: check what I own, or advise what to buy -->
39
+ <div class="field" style="margin-bottom:var(--s-5)">
40
+ <div class="segmented" id="mode-seg">
41
+ <button class="seg-btn active" data-val="have"><span class="ic" data-ic="monitor"></span>Check my computer</button>
42
+ <button class="seg-btn" data-val="buy"><span class="ic" data-ic="search"></span>Help me pick one</button>
43
+ </div>
44
+ </div>
45
+
46
+ <!-- Step 1: machine -->
47
+ <div class="step" id="machine-step">
48
+ <div class="step-head"><span class="step-num">1</span><h2>Your computer</h2></div>
49
+
50
+ <div class="field">
51
+ <span class="label">Describe it in your own words <span class="optional">(fastest)</span></span>
52
+ <textarea id="paste" placeholder="'Dell XPS, RTX 3050, 16GB' - or paste your dxdiag / Task Manager output..."></textarea>
53
+ <button class="parse-btn" id="parse-btn">Fill the form from this</button>
54
+ <div class="hint" id="parse-hint">A small model fine-tuned for this reads your text and fills the pickers below. On a sealed test it gets fields right about 88% of the time, but it still guesses sometimes (about 18% invented-field rate) - so double-check the pickers, and anything you didn't say should stay blank.</div>
55
+ </div>
56
+
57
+ <div class="field">
58
+ <span class="label">What kind of computer?</span>
59
+ <div class="segmented" id="computer-seg">
60
+ <button class="seg-btn active" data-val="Windows laptop"><span class="ic brand" data-ic="brand-windows"></span>Windows laptop</button>
61
+ <button class="seg-btn" data-val="Windows desktop"><span class="ic brand" data-ic="brand-windows"></span>Windows desktop</button>
62
+ <button class="seg-btn" data-val="Mac"><span class="ic brand" data-ic="brand-apple"></span>Mac</button>
63
+ <button class="seg-btn" data-val="Linux PC"><span class="ic brand" data-ic="brand-linux"></span>Linux PC</button>
64
+ <button class="seg-btn" data-val="Mini PC / Raspberry Pi" style="grid-column:1/-1"><span class="ic brand" data-ic="brand-raspberrypi"></span>Mini PC / Raspberry Pi</button>
65
+ </div>
66
+ </div>
67
+
68
+ <div class="field">
69
+ <span class="label" id="ram-label">Memory (RAM)</span>
70
+ <select id="ram">
71
+ <option>2 GB</option><option>4 GB</option><option>8 GB</option>
72
+ <option selected>16 GB</option><option>24 GB</option><option>32 GB</option>
73
+ <option>48 GB</option><option>64 GB</option><option>96 GB</option><option>128 GB</option>
74
+ </select>
75
+ <div class="hint">Not sure? See "How do I find my specs?" below.</div>
76
+ </div>
77
+
78
+ <div class="field" id="provider-field">
79
+ <span class="label">Graphics (GPU)</span>
80
+ <div class="segmented cols-3" id="provider-seg">
81
+ <button class="seg-btn active" data-val="none">None / built-in</button>
82
+ <button class="seg-btn" data-val="nvidia"><span class="ic brand" data-ic="brand-nvidia"></span>NVIDIA</button>
83
+ <button class="seg-btn" data-val="amd"><span class="ic brand" data-ic="brand-amd"></span>AMD</button>
84
+ <button class="seg-btn" data-val="apple"><span class="ic brand" data-ic="brand-apple"></span>Apple</button>
85
+ <button class="seg-btn" data-val="intel"><span class="ic brand" data-ic="brand-intel"></span>Intel</button>
86
+ <button class="seg-btn" data-val="unsure">Not sure</button>
87
+ </div>
88
+ <select id="gpu" style="margin-top:var(--s-3); display:none"></select>
89
+ </div>
90
+
91
+ <details class="disc" id="advanced-disc">
92
+ <summary>Advanced: enter exact numbers <span class="chev ic" data-ic="chevron"></span></summary>
93
+ <div class="disc-body">
94
+ <div class="field">
95
+ <span class="label">Graphics memory (VRAM), if you know it</span>
96
+ <input type="number" id="vram" placeholder="e.g. 8" min="0" max="200" step="1" />
97
+ <div class="hint" id="vram-hint">Overrides the GPU picker above. Leave blank to use the picker.</div>
98
+ </div>
99
+ </div>
100
+ </details>
101
+ </div>
102
+
103
+ <!-- Step 2: goal -->
104
+ <div class="step">
105
+ <div class="step-head"><span class="step-num">2</span><h2>What do you want to do? <span class="optional">(pick one or several)</span></h2></div>
106
+ <div class="task-toggle" id="task-toggle" role="tablist"
107
+ data-tip="Running a model and fine-tuning it need very different memory. Switch this and the recommendations below recompute for training.">
108
+ <button class="tt-opt active" data-task="run" role="tab"><span class="ic" data-ic="run"></span>Run a model</button>
109
+ <button class="tt-opt" data-task="finetune" role="tab"><span class="ic" data-ic="finetune"></span>Train / fine-tune</button>
110
+ <span class="tt-slider" aria-hidden="true"></span>
111
+ </div>
112
+ <div id="usecase-picker"><!-- rendered by app.js --></div>
113
+ <div class="field" id="repo-field" style="margin-top:var(--s-3); margin-bottom:0; display:none">
114
+ <span class="label">Paste the model to check</span>
115
+ <input type="text" id="repo-check" placeholder="Hugging Face model id or link, e.g. lerobot/smolvla_base" />
116
+ <div class="hint">FitCheck gives a full breakdown for <b>many</b> models, memory, and for text models speed and a comparison, <b>even ones not in our catalogue</b>, via a live Hugging Face lookup (needs Safetensors metadata). The lookup needs network; the deterministic advice is local.</div>
117
+ </div>
118
+ </div>
119
+
120
+ <!-- Step 3: preference -->
121
+ <div class="step" id="priority-step">
122
+ <div class="step-head"><span class="step-num">3</span><h2>What matters most? <span class="optional">(optional)</span></h2></div>
123
+ <div class="field" style="margin-bottom:0">
124
+ <div class="segmented" id="priority-seg">
125
+ <button class="seg-btn active" data-val="balanced" data-tip="Our default: the best mix of quality and speed your machine can comfortably handle."><span class="ic" data-ic="balanced"></span>Balanced</button>
126
+ <button class="seg-btn" data-val="quality" data-tip="Pick the most capable model that runs, even if it's slower or tight on memory."><span class="ic" data-ic="quality"></span>Best quality</button>
127
+ <button class="seg-btn" data-val="speed" data-tip="Prefer the snappiest model (smaller, or mixture-of-experts) for instant replies."><span class="ic" data-ic="speed"></span>Fastest</button>
128
+ <button class="seg-btn" data-val="open" data-tip="Prefers open-licensed, ungated, commercial-friendly models (no sign-in or non-commercial licence). Any downloaded model then runs locally."><span class="ic" data-ic="offline"></span>Fully open</button>
129
+ </div>
130
+ </div>
131
+ </div>
132
+
133
+ <button class="cta" id="check-btn">Check my setup <span class="ic" data-ic="arrow"></span></button>
134
+
135
+ <details class="disc" id="find-specs">
136
+ <summary><span class="ic sum-ic" data-ic="search"></span>How do I find my specs? <span class="chev ic" data-ic="chevron"></span></summary>
137
+ <div class="disc-body" id="find-specs-body"><!-- filled by app.js per computer type --></div>
138
+ </details>
139
+
140
+ <span id="glossary-anchor"></span>
141
+ <details class="disc" id="glossary">
142
+ <summary><span class="ic sum-ic" data-ic="book"></span>What do these words mean? <span class="chev ic" data-ic="chevron"></span></summary>
143
+ <div class="disc-body">
144
+ <dl>
145
+ <div><dt>Model</dt><dd>The AI's "brain". Bigger means smarter, but heavier.</dd></div>
146
+ <div><dt>Parameters (e.g. 7B)</dt><dd>How big the brain is. 7B is 7 billion. More means smarter and hungrier for memory.</dd></div>
147
+ <div><dt>Quantisation (4-bit, 8-bit)</dt><dd>Shrinking a model so it fits. 4-bit is the popular sweet spot: much smaller, barely-noticeable quality loss.</dd></div>
148
+ <div><dt>VRAM</dt><dd>The fast memory on a graphics card. The biggest factor in what runs quickly.</dd></div>
149
+ <div><dt>RAM</dt><dd>Your computer's normal memory. Models can use it too, but it is slower.</dd></div>
150
+ <div><dt>GGUF</dt><dd>A single-file model format made for running locally.</dd></div>
151
+ </dl>
152
+ </div>
153
+ </details>
154
+ </div>
155
+ </aside>
156
+
157
+ <!-- ============================== RESULTS ============================== -->
158
+ <section class="panel results-panel" id="results">
159
+ <div class="empty-state">
160
+ <div class="big"><span class="ic" data-ic="monitor"></span></div>
161
+ <h2>Your honest answer appears here</h2>
162
+ <p>Fill in your computer and what you want to do, then press <b>Check my setup</b>. Results update as you change things.</p>
163
+ </div>
164
+ </section>
165
+ </div>
166
+
167
+ <footer class="foot" id="how">
168
+ <p>FitCheck gives <b>conservative</b> estimates from a transparent rules engine.
169
+ GGUF sizes are <b>real Hugging Face file sizes</b> (shown rounded); other sizes and all chat-memory
170
+ figures are deliberately pessimistic estimates. It would rather under-promise than over-promise. Real speed depends on your exact chip, drivers and settings.</p>
171
+ <p style="margin-top:var(--s-2)">Catalogue of real models last verified <b id="cat-version">local</b>. Built for the Hugging Face Build Small hackathon.</p>
172
+ </footer>
173
+ </main>
174
+
175
+ <script src="/static/icons.js"></script>
176
+ <script src="/static/app.js"></script>
177
+ </body>
178
+ </html>