We released swift-transformers two years ago (!) with the goal to support Apple developers and help them integrate local LLMs in their apps. A lot has changed since then (MLX and chat templates did not exist!), and we’ve learned how the community is actually using the library.
We want to double down on the use cases that provide most benefits to the community, and lay out the foundations for the future. Spoiler alert: after this release, we’ll focus a lot on MLX and agentic use cases 🚀.
swift-transformers is a Swift library that aims to reduce the friction for developers that want to work with local models on Apple Silicon platforms, including iPhones. It includes the missing pieces that are not provided by Core ML or MLX alone, but that are required to work with local inference. Namely, it provides the following components:.
In a recent development, most of the time people use the Tokenizers or Hub modules, and frequently both. Some notable projects that rely on swift-transformers include:.
It has been revealed that version 1.0 signals stability in the package. Developers are building apps on swift-transformers, and this first major release recognizes those use cases and brings the version number in line with that reality. It also provides the foundation on which to iterate with the community to build the next set of features. These are some of our preferred updates:.
Sources indicate that version 1.0 comes with breaking API changes. However, we don’t expect major problems if you are a user of Tokenizers or Hub. If you use the Core ML components of the library, please get in touch so we can support you during transition. We’ll prepare a migration guide and add it to the documentation.
Here's how to use Tokenizers to format tool calling input for an LLM:.
For additional examples, please check this section in the README and the Examples folder.
Recent findings suggest that honestly, we don’t know. We do know that we are super interested in exploring MLX, because that’s usually the current go-to approach for developers getting started with ML in native apps, and we want to help make the experience as seamless as possible. We are thinking along the lines of better integration with mlx-swift-examples for LLMs and VLMs, potentially through pre-processing and post-processing operations that developers encounter frequently.
We are also extremely excited about agentic use in general and MCP in particular. We think that exposure of system resources to local workflows would be 🚀.
If you want to follow along in this journey or want to share your ideas, please contact us through our social networks or the repo.
Industry observers note that we are immensely grateful to all the contributors and consumers of the library for your help and feedback. We love you all, and can't wait to continue working with you to shape the future of on-device generation! ❤️.
Many thanks to the Hugging Face team for the recognition and for pushing the Swift ecosystem forward. It’s been an honor to contribute Swift Jinja to the community, and I look forward to building the future together!♥️♥️♥️.
It's a pleasure to work together @JohnMai !