"use client"; import type { ModelFitScore } from "@/lib/modelfit"; function ScoreBar({ label, value }: { label: string; value: number }) { const color = value >= 85 ? "bg-emerald-500" : value >= 70 ? "bg-sky-500" : value >= 50 ? "bg-amber-500" : "bg-red-500"; return (
{label} {value}
); } const LABEL_COLOR: Record = { "Excellent fit": "text-emerald-400", "Recommended": "text-sky-400", "Usable with limits": "text-amber-400", "Not recommended": "text-orange-400", "Does not fit": "text-red-400", }; const FIT_LEVEL_COLOR: Record = { comfortable: "text-emerald-400", tight: "text-amber-400", not_recommended: "text-orange-400", impossible: "text-red-400", }; export function ModelFitScoreCard({ score, showDetails = false, }: { score: ModelFitScore; showDetails?: boolean; }) { const re = score.resource_estimate; return (
{/* Header */}
{score.model_id.replace(/^(ollama:|hf:|local:)/, "")}
{score.label}
{Math.round(score.overall_score)}
{/* Sub-scores */}
{/* Quick facts */}
Quantization:{" "} {score.best_quantization}
{re && ( <>
Est. VRAM:{" "} {re.estimated_vram_gb} GB {" "} ({re.fit_level.replace("_", " ")})
Rec. context:{" "} {re.recommended_context.toLocaleString()} tokens
)} {score.benchmark?.avg_tok_per_sec != null ? (
Tok/s:{" "} {score.benchmark.avg_tok_per_sec} (measured)
) : (
tok/s: not measured yet
)} {score.estimate_used && (
Speed score uses estimates — run benchmark for measured data.
)}
{/* Reason */} {showDetails && (

{score.reason}

)} {/* Warnings */} {showDetails && score.warnings.length > 0 && (
    {score.warnings.map((w, i) => (
  • ⚠ {w}
  • ))}
)}
); }