Loading…
Swift Transformers Reaches 1.0 – and Looks to the Future
Hugging FacePedro Cuenca, Christopher Fleetwood, Mattt, Vaibhav Srivastav
Summary
swift-transformers has released version 1.0 to provide a stable foundation for running local models on Apple Silicon platforms. The library supplies components missing from Core ML and MLX, focusing heavily on tokenization, chat templates, and Hugging Face Hub integration. In this major release, Tokenizers and Hub become standalone top-level modules, enabling developers to import only the components they require. The update also integrates an updated swift-jinja library for faster template processing, adopts Modern Core ML stateful models and MLTensor APIs, removes unnecessary CLI dependencies, and adds full Swift 6 support. Future development will prioritize deeper integration with MLX frameworks and agentic workflows like MCP.
Context
Developers integrating local LLMs on Apple Silicon platforms require functionality not included in Core ML or MLX alone, such as tokenization, chat templates, and downloading models from the Hugging Face Hub. As community usage matured and tools like MLX emerged, the library needed a stable release that aligns with these patterns.
Approach / What changed
The maintainers published swift-transformers 1.0, separating Tokenizers and Hub into top-level modules so downstream projects can import them independently. The update integrates a rewritten swift-jinja package for faster template execution, adopts modern Core ML APIs with stateful models and MLTensor to replace custom tensor code, adds Swift 6 support, and removes CLI targets and swift-argument-parser dependencies.
Takeaways
- Tokenizers and Hub are now top-level modules, allowing developers to import them independently rather than bringing in the entire swift-transformers package.
- The release integrates an updated swift-jinja library for faster chat template execution and adopts modern Core ML stateful models and MLTensor APIs for KV-caching.
- Version 1.0 brings breaking API changes for Core ML modules while eliminating the swift-argument-parser dependency to avoid downstream dependency conflicts.
Related reading
Transformers v5: Simple model definitions powering the AI ecosystem
Transformers v5.0.0rc-0 introduces major architectural updates focused on simplicity, training, inference, and ecosystem interoperability across modern AI workflows. The release adopts a modular modeling approach and centralizes attention implementations into a unified AttentionInterface abstraction to reduce contribution and code review overhead. Support for Flax and TensorFlow is officially sunset in favor of focusing on PyTorch as the primary backend, while tokenization is standardized around the tokenizers library. For execution workloads, v5 adds native continuous batching, paged attention mechanisms, and a dedicated transformers serve OpenAI-compatible serving system. Finally, weight loading is refactored to make low-precision quantization a first-class citizen alongside broad interoperability with formats such as GGUF, MLX, and TorchAO.
Lysandre, Arthur Zucker, Cyril Vallez, Vaibhav Srivastav