import type { Method, Source, Support } from "@/lib/data"; /** * The four capabilities, in the order they appear on every row. Lane widths * are fixed so a capability lands at the same x on every line — that is what * makes the card scannable down a column without a header. */ const LANES = [ { key: "load", label: "load", width: "w-[42px]" }, { key: "compile", label: "compile", width: "w-[64px]" }, { key: "tune", label: "tune", width: "w-[44px]" }, { key: "save", label: "save", width: "w-[40px]" }, ] as const; interface Cell { text: string; support: Support; } function cell(label: string, support: Support): Cell { return { text: label, support }; } function cellsFor(m: Method): Cell[] { return [ cell("load", m.onTheFly ? "yes" : "no"), cell("compile", m.compile), cell("tune", m.peft), cell("save", m.serializable), ]; } /** Supported reads in the accent; everything else recedes. */ function toneFor(support: Support): string { if (support === "yes") return "text-forest"; if (support === "partial") return "text-smoke"; return "text-ash"; } /** * Methods arrive in recommendation order, best first, so the receipt keeps it. */ export default function MethodReceipt({ methods, source }: { methods: Method[]; source: Source }) { if (methods.length === 0) { return (

{source === "on-the-fly" ? "Nothing quantizes to this precision on the fly. Try a checkpoint." : "Nothing supports this precision here."}

); } return (
{methods.map((m) => (
{m.name} {cellsFor(m).map((c, i) => ( {c.text} ))}
))}

load = quantizes as it loads, no prep step

compile = works under torch.compile

tune = fine-tunes with PEFT adapters

save = save_pretrained keeps it quantized

); }