Repository Public
1// Author: Simon-Pierre Boucher — contact@spboucher.ai2// File: Packages/LocalChatModelHub/Sources/StarterCatalog.swift3// Description: A short list of well-known open MLX repositories per task. Only repository ids and reasons are stored; metadata is always fetched live.4import Foundation5import LocalChatCore67public struct StarterEntry: Sendable, Hashable, Identifiable {8 public var repoID: String9 public var task: TaskCategory10 public var reason: String11 public var id: String { repoID }12 public init(repoID: String, task: TaskCategory, reason: String) { self.repoID = repoID; self.task = task; self.reason = reason }13}1415public enum StarterCatalog {16 /// Every repository below was checked against the Hub API on 2026-11-20 (exists, not gated, files present).17 public static let entries: [StarterEntry] = [18 .init(repoID: "mlx-community/Qwen3-0.6B-4bit", task: .everyday, reason: "Tiny and instant; fits any iPhone."),19 .init(repoID: "mlx-community/Qwen3-1.7B-4bit", task: .everyday, reason: "Small, fast, with optional thinking."),20 .init(repoID: "mlx-community/gemma-3-1b-it-qat-4bit", task: .everyday, reason: "Google's compact chat model, quantization-aware trained."),21 .init(repoID: "mlx-community/LFM2-1.2B-4bit", task: .everyday, reason: "Built for on-device speed."),22 .init(repoID: "mlx-community/Qwen3-4B-4bit", task: .multilingual, reason: "Strong multilingual all-rounder with tool calling."),23 .init(repoID: "mlx-community/Llama-3.2-3B-Instruct-4bit", task: .tools, reason: "Reliable instruction following and tool use."),24 .init(repoID: "mlx-community/Qwen3-8B-4bit", task: .reasoning, reason: "Thinking model for harder questions on 16 GB Macs."),25 .init(repoID: "mlx-community/Qwen3-14B-4bit", task: .math, reason: "Deeper reasoning when memory allows."),26 .init(repoID: "mlx-community/Qwen2.5-Coder-7B-Instruct-4bit", task: .coding, reason: "Code-specialised, fits most Macs."),27 .init(repoID: "mlx-community/Qwen3-Coder-30B-A3B-Instruct-4bit", task: .coding, reason: "Large agentic coding model for 32 GB+ Macs."),28 .init(repoID: "mlx-community/gemma-3-4b-it-qat-4bit", task: .vision, reason: "Understands images; good general assistant."),29 .init(repoID: "mlx-community/SmolVLM2-500M-Video-Instruct-mlx", task: .vision, reason: "Very small vision model for phones."),30 .init(repoID: "BAAI/bge-small-en-v1.5", task: .embeddings, reason: "Compact English embeddings for the Knowledge Studio."),31 .init(repoID: "sentence-transformers/all-MiniLM-L6-v2", task: .embeddings, reason: "Smallest dependable embedder."),32 ]3334 public static func entries(for task: TaskCategory) -> [StarterEntry] { entries.filter { $0.task == task } }3536 /// Fetches live metadata for every entry (repositories that fail to resolve are skipped, never invented).37 public static func resolve(api: HuggingFaceAPI, resolver: ModelMetadataResolver = .init(), entries: [StarterEntry] = StarterCatalog.entries)38 async -> [(entry: StarterEntry, candidate: ModelCandidate)] {39 await withTaskGroup(of: (Int, StarterEntry, ModelCandidate)?.self) { group in40 for (i, entry) in entries.enumerated() {41 group.addTask {42 guard let model = try? await api.model(entry.repoID), let candidate = resolver.mlxCandidate(for: model) else { return nil }43 return (i, entry, candidate)44 }45 }46 var found: [(Int, StarterEntry, ModelCandidate)] = []47 for await item in group { if let item { found.append(item) } }48 return found.sorted { $0.0 < $1.0 }.map { ($0.1, $0.2) }49 }50 }51}52