import { Cpu } from 'lucide-react'; import { cn } from '@/lib/cn'; /** * GET form for /hardware/fit — no JavaScript needed. Memory presets are grouped by platform; a free numeric field * overrides the preset when filled. Quantization and context are plain selects (the API accepts 4bit|8bit|fp16 and * any positive context; we offer the three common windows). */ export const APPLE_PRESETS = [16, 24, 32, 36, 48, 64, 96, 128, 192, 256, 512]; export const NVIDIA_PRESETS = [24, 32, 80, 141, 192]; export const QUANTS = [ { value: '4bit', label: '4-bit (≈ 0.5 byte / param)' }, { value: '8bit', label: '8-bit (1 byte / param)' }, { value: 'fp16', label: 'fp16 / bf16 (2 bytes / param)' }, ]; export const CONTEXTS = [ { value: '8192', label: '8k tokens' }, { value: '32768', label: '32k tokens' }, { value: '131072', label: '128k tokens' }, ]; export function FitForm({ memory, quant, context, className }: { memory?: string; quant?: string; context?: string; className?: string }) { const cls = 'h-11 w-full border border-rule bg-surface px-2.5 text-[15px] text-ink focus:border-accent focus:outline-none'; const presetSelected = memory && [...APPLE_PRESETS, ...NVIDIA_PRESETS].includes(Number(memory)) ? memory : ''; return (
); }