Hugging Face has released AnyLanguageModel, a Swift package that replaces Apple’s Foundation Models framework with support for local and cloud LLMs. The library uses the same API, allowing developers to swap imports and switch providers with minimal code changes. It leverages Swift 6.1 package traits to avoid unnecessary dependencies, offering CoreML, MLX, and Llama backends. The package also extends beyond Foundation Models to support vision‑language models, a feature not yet available in Apple’s framework. The library is pre‑1.0, with a stable core API and ongoing work to match Foundation Models’ full feature set.
LLMs have become essential tools for building software. But for Apple developers, integrating them remains unnecessarily painful.
Developers building AI-powered apps typically take a hybrid approach, adopting some combination of:
Each comes with different APIs, different requirements, different integration patterns. It's a lot, and it adds up quickly. When I interviewed developers about building AI-powered apps, friction with model integration came up immediately. One developer put it bluntly:
Today we're announcing AnyLanguageModel , a Swift package that provides a drop-in replacement for Apple's Foundation Models framework with support for multiple model providers. Our goal is to reduce the friction of working with LLMs on Apple platforms and make it easier to adopt open-source models that run locally.
For Xcode projects (which don't yet support trait declarations directly), you can create a small internal Swift package that depends on AnyLanguageModel with the traits you need, then add that package as a local dependency. The README has detailed instructions.
Vision-language models are incredibly capable and widely used. They can describe images, extract text from screenshots, analyze charts, and answer questions about visual content. Unfortunately, Apple's Foundation Models framework doesn't currently support sending images with prompts.
I thought I'd quickly use the demo for a test and maybe a quick and dirty build but instead wasted so much time. Drove me nuts.
The cost to experiment is high, which discourages developers from discovering that local, open-source models might actually work great for their use case.
The focus is on local models that you can download from the Hugging Face Hub . Cloud providers are included to lower the barrier to getting started and to provide a migration path. Make it work, then make it right.
By unifying local and remote LLM access on Apple platforms, AnyLanguageModel lowers integration friction and encourages adoption of open‑source models, potentially accelerating AI app development across iOS, macOS, and related ecosystems.