mlx-swift  by ml-explore

Swift API for MLX, an array framework for Apple silicon ML

Created 1 year ago
1,331 stars

Top 30.1% on SourcePulse

GitHubView on GitHub
Project Summary

MLX Swift provides a Swift API for MLX, an array framework for machine learning on Apple silicon. It aims to simplify research and experimentation for Swift developers by enabling MLX functionalities within the Swift ecosystem, supporting applications on macOS and iOS.

How It Works

MLX Swift acts as a Swift wrapper around the core MLX library, which is optimized for Apple silicon's Metal Performance Shaders. This approach allows Swift developers to leverage MLX's efficient array operations and automatic differentiation capabilities directly from Swift code, facilitating the development of machine learning models and applications tailored for Apple hardware.

Quick Start & Requirements

  • Installation: Add https://github.com/ml-explore/mlx-swift as a package dependency in Xcode or via SwiftPM (Package.swift).
  • Prerequisites: Xcode, SwiftPM. Metal shaders require an Xcode build; command-line builds via xcodebuild are supported. CMake and Ninja are needed for CMake builds.
  • Documentation: Installation, Documentation, Examples.

Highlighted Details

  • Supports large-scale text generation (Mistral 7B) and model training (LeNet on MNIST).
  • Examples are runnable on macOS and iOS.
  • MLX Swift versions are aligned with specific MLX and MLXNN tags (v0.3.0 and v0.0.10 respectively).

Maintenance & Community

Maintained by David Koski, with initial development by David Koski and Ronan Collobert. Built upon MLX, initially developed by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

SwiftPM command-line builds cannot compile Metal shaders, necessitating an Xcode build for full functionality. The project does not specify a license, which may impact commercial adoption.

Health Check
Last Commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
4
Issues (30d)
3
Star History
34 stars in the last 30 days

Explore Similar Projects

Starred by Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), Travis Fischer Travis Fischer(Founder of Agentic), and
8 more.

corenet by apple

0.0%
7k
DNN toolkit for training standard and novel models
Created 1 year ago
Updated 3 weeks ago
Feedback? Help us improve.