mlx-swift-examples
2,696
Stars
428
Forks
31
Watchers
41
Open Issues
MIT
许可证
Swift
语言
2024-02-22
创建时间
2026-11-09
最近更新
项目能做什么
MLX Swift 的使用示例代码集合。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# MLX Swift Examples Example [MLX Swift](https://github.com/ml-explore/mlx-swift) programs. The language model examples use models implemented in [MLX Swift LM](https://github.com/ml-explore/mlx-swift-lm). - [MNISTTrainer](Applications/MNISTTrainer/README.md): An example that runs on both iOS and macOS that downloads MNIST training data and trains a [LeNet](https://en.wikipedia.org/wiki/LeNet). - [LLMBasic](Applications/LLMBasic/README.md): A **minimal** LLM chat example application. It has only two features: load the model and evaluate a prompt. - [LLMEval](Applications/LLMEval/README.md): An example that runs on both iOS and macOS that downloads an LLM and tokenizer from Hugging Face and generates text from a given prompt. It has some preset prompts, tool integration, etc. Additionally it shows detailed statistics on the run. - [MLXChatExample](Applications/MLXChatExample/README.md): An example chat app that runs on both iOS and macOS that supports LLMs and VLMs. - [LoRATrainingExample](Applications/LoRATrainingExample/README.md): An example that runs on macOS that downloads an LLM and fine-tunes it using LoRA (Low-Rank Adaptation) with training data. - [LinearModelTraining](Tools/LinearModelTraining/README.md): An example that trains a simple linear model. - [StableDiffusionExample](Applications/StableDiffusionExample/README.md): An example that runs on both iOS and macOS that downloads a stable diffusion model from Hugging Face and and generates an image from a given prompt. - [llm-tool](Tools/llm-tool/README.md): A command line tool for generating text using a variety of LLMs available on the Hugging Face hub. - [image-tool](Tools/image-tool/README.md): A command line tool for generating images using a stable diffusion model from Hugging Face. - [mnist-tool](Tools/mnist-tool/README.md): A command line tool for training a a LeNet on MNIST. ## Numerical Computing Examples that use MLX for general numerical computing (no ML model involved), useful for seeing how MLX array idioms, `compile`, and custom Metal kernels apply to classic numerical problems. - [CurveFit](Numerical/CurveFit/README.md): Live visualization of gradient descent fitting a quadratic to noisy samples, using `MLX.grad` for automatic differentiation. - [HeatTransfer](Numerical/HeatTransfer/README.md): 2D heat-diffusion simulation comparing three Jacobi/SOR stencil implementations (`conv2d`, compiled `roll`, red/black SOR). - [Mandelbrot](Numerical/Mandelbrot/README.md): Mandelbrot set renderer comparing plain MLX, compiled MLX, and a custom Metal kernel (`MLXFast.metalKernel`) against a reference CPU implementation. > [!IMPORTANT] > `MLXLMCommon`, `MLXLLM`, `MLXVLM` and `MLXEmbedders` have moved to a new repository > containing _only_ reusable libraries: [mlx-swift-lm](https://github.com/ml-explore/mlx-swift-lm). Previous URLs and tags will continue to work, but going forward all updates to these libraries will be done阅读完整原文
项目深度分析 AI 生成
macOS 离线私人知识库与文档助手 (Native RAG App)
| 产品构想 | 基于 MLX Swift 的本地 Embeddings 和 LLM 能力,构建纯端侧运行的 macOS 菜单栏知识库检索与文档问答工具。 |
| 核心功能 | 本地文档(PDF/Markdown/Docx)自动化切片与向量化、端侧混合检索、全离线 LLM 问答生成、系统级全局划词提问快捷键。 |
| 目标用户 | 律师、研究员、对数据出境敏感的企业管理人员及 macOS 重度用户。 |
| 难度/周期 | 中等 · 4-6 周 · 成本:极低(仅需开发用 Mac 硬件设备及 Apple 开发者账号年费) |
| 收费模式 | 买断制销售(如 29-49 美元)或按主版本升级付费,配合 Setapp 上架分发。 |
| 竞争风险 | 系统内存占用过高导致老款 Mac 体验较差;同类竞品增多竞争激烈。 |
| 依据 | 已验证事实 |
Mac 本地模型微调与模型工坊工具 (LoRA Studio for Mac)
| 产品构想 | 基于 LoRATrainingExample 封装具备现代化界面的 macOS 专用本地模型微调与量化导出工具,简化开发者准备训练集到模型导出的全流程。 |
| 核心功能 | CSV/JSONL 数据集可视化清洗与配比、可视化超参数调整、一键 LoRA 微调训练曲线展示、GGUF/MLX 格式导出与端侧合并打包。 |
| 目标用户 | 个人独立开发者、中小企业 AI 工程师、算法探索者。 |
| 难度/周期 | 较高 · 6-8 周 · 成本:低(高性能 Apple Silicon 设备自测成本) |
| 收费模式 | 免费基础功能 + 专业版按月订阅(Pro License)或单机永久买断许可。 |
| 竞争风险 | 微调对内存和散热要求高,消费级设备训练速度受物理瓶颈限制。 |
| 依据 | 数据支持的判断 |
iOS/macOS 端侧 AI 功能开发 SDK 与脚手架
| 产品构想 | 基于 MLX Swift 封装更轻量、开箱即用的 UI 组件库与后端模型生命周期管理框架,让普通 iOS 开发者无需理解复杂张量与模型格式即可嵌入端侧 AI 能力。 |
| 核心功能 | 预构建 SwiftUI 对话与绘图组件、动态模型权重下载与缓存管理、自动根据芯片配置动态降级与内存熔断机制。 |
| 目标用户 | 希望为自有 App 增加本地离线 AI 问答/修图功能的 Apple 平台应用开发者。 |
| 难度/周期 | 中等 · 3-5 周 · 成本:极低(主要是文档维护与示例应用开发时间) |
| 收费模式 | 双重许可协议(GPL 开源 + 商业闭源授权收费)或技术咨询与定制支持。 |
| 竞争风险 | 目标开发者群体对引入第三方底层推理封装持观望态度;苹果官方 CoreML/Foundation 接口更新可能挤压空间。 |
| 依据 | AI推测 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| suh4s/mlx-101 | 中文介绍暂未生成 🍎 Complete MLX tutorial for Apple Silicon - From zero to neu |
5 | Swift |
| Obscyra-app/EmbeddingGemma2Swift | 中文介绍暂未生成 Native MLX Swift text, image and audio embeddings for Embedd |
4 | Swift |
| Vijaya-venkatesh/mlx-swift-example | 中文介绍暂未生成 mlx-swift-example |
0 | Swift |
| W3Mirror/mlx-swift-examples | 中文介绍暂未生成 | 0 | Swift |
| ibragullam/mlx-swift-examples | 中文介绍暂未生成 🚀 Explore large language and vision models with ready-to-use |
0 | Swift |
| mattpark01/mlx-swift-examples | 中文介绍暂未生成 | 0 | Swift |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 2024-02-22,近 30 天仍在推送,发布过 12 个 Release |
| 社区活跃 | Star 2,696 / Fork 428 / Issue 41(数据支持,可自行核实) |
| 许可证 | MIT |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。