Discover and explore top open-source AI tools and projects—updated daily.
huggingfaceSwift package for language model utilities in Swift apps
Top 32.9% on SourcePulse
This Swift package provides utilities for integrating large language models into Swift applications, mirroring the Python transformers API with an idiomatic Swift interface. It targets Swift developers seeking to leverage state-of-the-art NLP models without requiring prior Python or ML expertise, offering simplified model interaction and data handling.
How It Works
The library is modular, featuring Tokenizers for text-to-token conversion with chat template support, Hub for downloading models and configurations from Hugging Face, and Generation for text generation algorithms (greedy search, top-k, top-p sampling). Model inference is primarily handled via a Models module that abstracts Core ML packages, enabling efficient on-device execution.
Quick Start & Requirements
https://github.com/huggingface/swift-transformers as a dependency in Package.swift.Highlighted Details
Maintenance & Community
swift test.Licensing & Compatibility
Limitations & Caveats
Encoder-decoder models such as T5 and Flan are not currently supported. The package focuses on autoregressive models and Core ML inference.
1 week ago
1 day
guillaume-be
Morizeyao
explosion