swift-embeddings
A Swift library for running text-embedding models locally using Apple's MLTensor, supporting BERT, ModernBERT, NomicBERT, RoBERTa, XLM-RoBERTa and Qwen3 embedding architectures loaded directly from Hugging Face.
swift-embeddings loads embedding-model checkpoints from Hugging Face and runs them on-device through MLTensor, covering several BERT-family architectures such as sentence-transformers models, ModernBERT and NomicBERT variants, RoBERTa and XLM-RoBERTa multilingual models, and decoder-only Qwen3 embedding models that use last-token pooling.
Some checkpoints need a load-time configuration adjustment, such as a weight-key prefix or a custom transform, because their saved parameter names differ from the library's expectations; the README documents the specific configuration needed for each supported model.
It is written in Swift and MIT licensed, and describes itself as inspired by mlx-embeddings.