Introducing swift-huggingface: The Complete Swift Client for Hugging Face
Blog post from HuggingFace
swift-huggingface is a newly introduced Swift package designed to enhance the developer experience by providing a complete client for the Hugging Face Hub, addressing previous issues like unreliable downloads and confusing authentication in swift-transformers. The package features comprehensive Hub API coverage, improved file operations with progress tracking and resume support, and a Python-compatible cache for seamless sharing between Swift and Python ecosystems. It introduces a flexible TokenProvider pattern for authentication and offers OAuth support for user-facing apps. Additionally, swift-huggingface supports reliable downloads with metadata tracking and file locking to prevent race conditions, and it plans integration with swift-transformers for improved functionality. The package also includes a complete inference client, allowing easy access to machine learning models from Hugging Face Inference Providers, and future updates aim to incorporate faster downloads through Xet storage backend support.