import React from "react"; import { Binary, ArrowRight, Check, Sliders, } from "lucide-react"; import { BaseModelInfo, GGUFConfig, GGUFQuantType } from "../types"; import { getGGUFSizeEstimate } from "../utils/hardwareCalculator"; interface GGUFStudioProps { selectedModel: BaseModelInfo; ggufConfig: GGUFConfig; setGgufConfig: React.Dispatch>; onProceed: () => void; } export const GGUFStudio: React.FC = ({ selectedModel, ggufConfig, setGgufConfig, onProceed, }) => { const quantOptions: { type: GGUFQuantType; label: string; desc: string; lossRating: string }[] = [ { type: "Q4_K_M", label: "Q4_K_M (Gold Standard)", desc: "Medium 4-bit k-quant. Optimal sweet spot between quality, speed, and 16GB VRAM fit.", lossRating: "<0.5% Perplexity Loss", }, { type: "IQ4_XS", label: "IQ4_XS (Importance Matrix 4-bit)", desc: "Uses importance matrix quantization for higher fidelity at smaller file size.", lossRating: "<0.3% Perplexity Loss", }, { type: "Q5_K_M", label: "Q5_K_M (High Precision 5-bit)", desc: "5-bit medium quant for maximum precision when ample VRAM is available.", lossRating: "<0.1% Perplexity Loss", }, { type: "Q4_K_S", label: "Q4_K_S (Compact 4-bit)", desc: "Small 4-bit quant for maximum memory compression.", lossRating: "<0.8% Perplexity Loss", }, { type: "IQ3_XXS", label: "IQ3_XXS (Extreme 3-bit)", desc: "Compact 3-bit format to fit 14B models comfortably in 8GB-12GB VRAM.", lossRating: "~1.5% Perplexity Loss", }, { type: "Q8_0", label: "Q8_0 (Near Lossless 8-bit)", desc: "8-bit uncompressed precision. Virtually indistinguishable from FP16.", lossRating: "0.0% Perplexity Loss", }, ]; const currentEst = getGGUFSizeEstimate(selectedModel.parametersBillion, ggufConfig.quantization); return (
{/* Header Banner */}
GGUF MULTI-TOOL & QUANTIZATION SUITE

GGUF Quantization Matrix & RTX 4080 Super Optimization

Directly export quantized GGUFs with custom context windows (up to 128k), prompt templates, stop tokens, and full GPU layer offloading (num_gpu 999) for instant loading in Ollama on Windows.

GGUF File Size
{currentEst.sizeGb} GB
Fits 16GB GDDR6X ({Math.round((currentEst.ramRequiredGb / 16) * 100)}% VRAM)
{/* Quantization Matrix Grid */}
{quantOptions.map((q) => { const isSelected = ggufConfig.quantization === q.type; const est = getGGUFSizeEstimate(selectedModel.parametersBillion, q.type); return (
setGgufConfig((prev) => ({ ...prev, quantization: q.type }))} className={`p-4 rounded-lg border transition-all cursor-pointer relative flex flex-col justify-between ${ isSelected ? "bg-[#18181b] border-blue-500/40 text-blue-400 ring-1 ring-blue-500/20" : "bg-[#121214] border-[#27272a] hover:border-zinc-700 hover:bg-[#18181b]/40 text-zinc-300" }`} > {isSelected && (
)}
{q.label}
{q.desc}
{est.sizeGb} GB {q.lossRating}
); })}
{/* GGUF Metadata & Modelfile Parameters Form */}

GGUF Inference Parameters & Modelfile Configuration

setGgufConfig((prev) => ({ ...prev, temperature: parseFloat(e.target.value) || 0.6, })) } className="w-full bg-zinc-950 border border-zinc-800 rounded px-2.5 py-1.5 text-zinc-200 font-mono text-xs focus:ring-1 focus:ring-blue-600 outline-none" />
setGgufConfig((prev) => ({ ...prev, num_gpu_layers: parseInt(e.target.value) || 999, })) } className="w-full bg-zinc-950 border border-zinc-800 rounded px-2.5 py-1.5 text-zinc-200 font-mono text-xs focus:ring-1 focus:ring-blue-600 outline-none" /> 999 = Full offload to RTX 4080 Super VRAM
{/* System Prompt */}