SPB Git

spb/zyquo-local Public MIT

Native macOS AI chat that runs LLMs 100% locally on Apple Silicon with MLX — no cloud, no API keys.

Swift 97.2% Shell 1.8% Makefile 1%
10.5 KB · 163 lines swift
Raw Blame History
1//2//  ModelCatalog.swift3//  Zyquo Local4//5//  Author: Simon-Pierre Boucher6//  Mail: contact@spboucher.ai7//89import Foundation1011/// The curated Featured catalog. GENERATED FROM docs/MODELS.md §3 — the two12/// must never drift apart: any Phase 7 verification fix updates both together.13/// Sizes are decimal GB, live-verified on the Hub on 2026-07-30.14struct CatalogModel: Identifiable, Hashable, Sendable {15    enum Category: String, CaseIterable, Sendable {16        case tiny17        case mid18        case large19        case coding20        case reasoning21        case general22    }2324    var repoID: String25    var params: String26    var quant: String27    var sizeGB: Double28    var minRAMGB: Int29    var categories: [Category]30    var blurb: String3132    var id: String { repoID }3334    var sizeBytes: Int64 { Int64(sizeGB * 1_000_000_000) }3536    /// RAM verdict for THIS Mac.37    var verdict: MemoryAdvisor.Verdict {38        MemoryAdvisor.verdict(weightsBytes: sizeBytes)39    }40}4142enum ModelCatalog {43    /// Starter picks for the empty-state onboarding hero, chosen for this44    /// Mac's RAM from the featured list (smallest that fit comfortably).45    static func starterPicks(count: Int = 4) -> [CatalogModel] {46        let ramGB = Int(MemoryAdvisor.physicalMemoryBytes / 1_073_741_824)47        var picks: [CatalogModel] = []48        // One instant-download tiny, then the best generalists that fit.49        if let tiny = featured.first(where: { $0.repoID.contains("Qwen3-0.6B") }) {50            picks.append(tiny)51        }52        let comfortable = featured53            .filter { $0.minRAMGB <= ramGB && $0.verdict == .fits && !picks.contains($0) }54            .sorted { $0.sizeGB > $1.sizeGB }55        for model in comfortable where picks.count < count {56            picks.append(model)57        }58        return picks59    }6061    static let featured: [CatalogModel] = [62        // ── Tiny (≤4B) ──────────────────────────────────────────────────────63        CatalogModel(repoID: "mlx-community/Qwen3-0.6B-4bit", params: "0.6B", quant: "4bit",64                     sizeGB: 0.35, minRAMGB: 8, categories: [.tiny, .general],65                     blurb: "Smallest useful chat model; instant loads."),66        CatalogModel(repoID: "mlx-community/LFM2.5-1.2B-Instruct-4bit", params: "1.2B", quant: "4bit",67                     sizeGB: 0.66, minRAMGB: 8, categories: [.tiny, .general],68                     blurb: "Liquid AI's 2026 edge model; punchy and very fast."),69        CatalogModel(repoID: "mlx-community/Llama-3.2-1B-Instruct-4bit", params: "1B", quant: "4bit",70                     sizeGB: 0.71, minRAMGB: 8, categories: [.tiny, .general],71                     blurb: "The classic 1B; most-downloaded tiny LLM."),72        CatalogModel(repoID: "mlx-community/gemma-3-1b-it-qat-4bit", params: "1B", quant: "QAT-4bit",73                     sizeGB: 0.77, minRAMGB: 8, categories: [.tiny, .general],74                     blurb: "Google QAT checkpoint — best quality-per-byte at 1B."),75        CatalogModel(repoID: "mlx-community/Qwen3-1.7B-4bit", params: "1.7B", quant: "4bit",76                     sizeGB: 0.98, minRAMGB: 8, categories: [.tiny, .general, .reasoning],77                     blurb: "Hybrid thinking modes in under 1 GB."),78        CatalogModel(repoID: "mlx-community/SmolLM3-3B-4bit", params: "3B", quant: "4bit",79                     sizeGB: 1.75, minRAMGB: 8, categories: [.tiny, .general],80                     blurb: "HF's fully-open 3B; long context, optional reasoning."),81        CatalogModel(repoID: "mlx-community/Llama-3.2-3B-Instruct-4bit", params: "3B", quant: "4bit",82                     sizeGB: 1.82, minRAMGB: 8, categories: [.tiny, .general],83                     blurb: "The default “runs anywhere” pick."),84        CatalogModel(repoID: "mlx-community/Qwen3-4B-Instruct-2507-4bit", params: "4B", quant: "4bit",85                     sizeGB: 2.28, minRAMGB: 8, categories: [.tiny, .general],86                     blurb: "2507 refresh — best ≤4B all-rounder."),87        CatalogModel(repoID: "mlx-community/gemma-3-4b-it-qat-4bit", params: "4B", quant: "QAT-4bit",88                     sizeGB: 3.03, minRAMGB: 8, categories: [.tiny, .general],89                     blurb: "Vision-capable 4B with QAT quality."),9091        // ── Mid (7–20B) ─────────────────────────────────────────────────────92        CatalogModel(repoID: "mlx-community/Llama-3.1-8B-Instruct-4bit", params: "8B", quant: "4bit",93                     sizeGB: 4.53, minRAMGB: 16, categories: [.mid, .general],94                     blurb: "The reference 8B; huge prompt/finetune ecosystem."),95        CatalogModel(repoID: "mlx-community/Qwen3-8B-4bit", params: "8B", quant: "4bit",96                     sizeGB: 4.62, minRAMGB: 16, categories: [.mid, .general, .reasoning],97                     blurb: "Best-selling 8B; thinking mode on demand."),98        CatalogModel(repoID: "mlx-community/gemma-3-12b-it-qat-4bit", params: "12B", quant: "QAT-4bit",99                     sizeGB: 8.07, minRAMGB: 16, categories: [.mid, .general],100                     blurb: "Sweet spot for 16 GB Macs; strong writing."),101        CatalogModel(repoID: "mlx-community/Qwen3.5-9B-OptiQ-4bit", params: "9B", quant: "OptiQ-4bit",102                     sizeGB: 8.22, minRAMGB: 16, categories: [.mid, .general],103                     blurb: "2026 Qwen3.5 generation; top mid-size quality."),104        CatalogModel(repoID: "mlx-community/phi-4-4bit", params: "14.7B", quant: "4bit",105                     sizeGB: 8.26, minRAMGB: 16, categories: [.mid, .general, .reasoning],106                     blurb: "Microsoft dense 14B; excels at math and STEM."),107        CatalogModel(repoID: "mlx-community/Qwen3-14B-4bit", params: "14B", quant: "4bit",108                     sizeGB: 8.32, minRAMGB: 16, categories: [.mid, .general, .reasoning],109                     blurb: "Stronger sibling of Qwen3-8B; 16 GB flagship."),110        CatalogModel(repoID: "mlx-community/gpt-oss-20b-MXFP4-Q8", params: "20.9B MoE", quant: "MXFP4-Q8",111                     sizeGB: 12.10, minRAMGB: 16, categories: [.mid, .general, .reasoning],112                     blurb: "OpenAI's open-weights MoE; most-downloaded LLM in the org."),113114        // ── Large (24B+) ────────────────────────────────────────────────────115        CatalogModel(repoID: "mlx-community/Mistral-Small-3.2-24B-Instruct-2506-4bit", params: "24B", quant: "4bit",116                     sizeGB: 13.28, minRAMGB: 24, categories: [.large, .general],117                     blurb: "Fast dense 24B, low hallucination, good tool use."),118        CatalogModel(repoID: "mlx-community/gemma-3-27b-it-qat-4bit", params: "27B", quant: "QAT-4bit",119                     sizeGB: 16.87, minRAMGB: 32, categories: [.large, .general],120                     blurb: "Gemma 3 flagship with QAT; superb chat quality."),121        CatalogModel(repoID: "mlx-community/GLM-4.7-Flash-4bit", params: "30B MoE", quant: "4bit",122                     sizeGB: 16.87, minRAMGB: 32, categories: [.large, .general, .coding],123                     blurb: "Zhipu's 2026 fast MoE; strong agentic coding."),124        CatalogModel(repoID: "mlx-community/Qwen3-30B-A3B-Instruct-2507-4bit", params: "30B-A3B MoE", quant: "4bit",125                     sizeGB: 17.20, minRAMGB: 32, categories: [.large, .general],126                     blurb: "3B active params → big-model quality at small-model speed."),127        CatalogModel(repoID: "mlx-community/Qwen3-32B-4bit", params: "32B", quant: "4bit",128                     sizeGB: 18.45, minRAMGB: 32, categories: [.large, .general, .reasoning],129                     blurb: "Dense 32B with thinking; slower but deeper than the MoE."),130        CatalogModel(repoID: "mlx-community/Qwen3.6-27B-OptiQ-4bit", params: "27B", quant: "OptiQ-4bit",131                     sizeGB: 20.00, minRAMGB: 32, categories: [.large, .general],132                     blurb: "2026 Qwen3.6 dense; MTP head ≈1.4× faster decode."),133        CatalogModel(repoID: "mlx-community/Qwen3.6-35B-A3B-OptiQ-4bit", params: "35B-A3B MoE", quant: "OptiQ-4bit",134                     sizeGB: 24.69, minRAMGB: 48, categories: [.large, .general],135                     blurb: "2026 successor to Qwen3-30B-A3B."),136        CatalogModel(repoID: "mlx-community/Llama-3.3-70B-Instruct-4bit", params: "70B", quant: "4bit",137                     sizeGB: 39.71, minRAMGB: 64, categories: [.large, .general],138                     blurb: "The 70B reference; 64 GB+ Macs only."),139140        // ── Coding ──────────────────────────────────────────────────────────141        CatalogModel(repoID: "mlx-community/Qwen2.5-Coder-7B-Instruct-4bit", params: "7B", quant: "4bit",142                     sizeGB: 4.30, minRAMGB: 16, categories: [.coding],143                     blurb: "The default small local code model."),144        CatalogModel(repoID: "mlx-community/Qwen2.5-Coder-14B-Instruct-4bit", params: "14B", quant: "4bit",145                     sizeGB: 8.32, minRAMGB: 16, categories: [.coding],146                     blurb: "Noticeably better completions on 16 GB Macs."),147        CatalogModel(repoID: "mlx-community/Qwen3-Coder-30B-A3B-Instruct-4bit", params: "30B-A3B MoE", quant: "4bit",148                     sizeGB: 17.20, minRAMGB: 32, categories: [.coding, .large],149                     blurb: "Best local coding model for 32 GB; fast agentic loops."),150151        // ── Reasoning ───────────────────────────────────────────────────────152        CatalogModel(repoID: "mlx-community/DeepSeek-R1-0528-Qwen3-8B-4bit", params: "8B", quant: "4bit",153                     sizeGB: 4.62, minRAMGB: 16, categories: [.reasoning],154                     blurb: "R1-0528 distill onto Qwen3-8B; visible chain-of-thought."),155        CatalogModel(repoID: "mlx-community/DeepSeek-R1-Distill-Qwen-14B-4bit", params: "14B", quant: "4bit",156                     sizeGB: 8.32, minRAMGB: 16, categories: [.reasoning],157                     blurb: "Most-downloaded R1 distill; great math on 16 GB."),158        CatalogModel(repoID: "mlx-community/Qwen3-30B-A3B-Thinking-2507-4bit", params: "30B-A3B MoE", quant: "4bit",159                     sizeGB: 17.20, minRAMGB: 32, categories: [.reasoning, .large],160                     blurb: "Current best local reasoner under 32 GB."),161    ]162}163