mlx-swift  by ml-explore

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

created 1 year ago
1,282 stars

Top 31.7% 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)
6
Issues (30d)
3
Star History
198 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.