Hugging Face drops unified AI API for Apple platforms
Hugging Face just launched AnyLanguageModel, an open-source Swift package that serves as a drop-in replacement for Apple's Foundation Models framework. By swapping a single import statement, developers can alternate between local engines like MLX and Core ML and cloud providers without rewriting glue code. It dramatically lowers the bar for running open-source models on Apple silicon.

AnyLanguageModel is an open-source Swift package that unifies local and remote LLM integration for Apple platforms into a single drop-in API.
Instead of wrestling with different SDKs for MLX, Core ML, llama.cpp, and cloud endpoints, you literally swap a single import line from Apple's native Foundation Models framework. The rest of your session handling, prompting, and async code stays exactly the same, letting you pivot between providers without rewriting glue code.
How it works and what it runs
The library takes Apple's Foundation Models API as its template and extends it to third-party engines. That means you get clean Swift macro ergonomics without reinventing the wheel.
On device, it connects directly to Apple's system model on macOS 26 and iOS 26, runs Core ML models with Neural Engine acceleration, powers quantized models via MLX on Apple Silicon, and loads GGUF weights through llama.cpp. It can also point to local models served through Ollama's HTTP API.
For cloud fallback and benchmarking, it includes native adapters for OpenAI, Anthropic, Google Gemini, and Hugging Face Inference Providers. You can build your pipeline on frontier cloud models and swap to local open-source weights as soon as you find one that fits the job.
To avoid dependency bloat, AnyLanguageModel uses Swift 6.1 package traits. By default, it only pulls in standard URLSession networking for cloud calls. If you only want MLX inference, you opt in to just the MLX trait without downloading llama.cpp. Xcode developers can wrap these traits in a small local package until native Xcode support arrives.
Multimodal tweaks and getting started
Apple's current Foundation Models framework has a glaring limitation: it cannot accept images in prompts. AnyLanguageModel works around this limitation ahead of time by adding image parameter support for vision models like Claude.
To see how it all fits together, Hugging Face released chat-ui-swift, an open-source SwiftUI chat app. It showcases model swapping, token streaming, chat history persistence, and Hugging Face OAuth authentication for accessing gated models.
The package is currently pre-1.0 on GitHub under mattt/AnyLanguageModel, with upcoming milestones focused on unified tool calling, MCP integration, and structured output generation across all providers.
Why it matters
For Apple platform developers, getting local AI running has always involved an annoying amount of glue code. By anchoring to Apple's official interface while opening the door to open-source models, AnyLanguageModel dramatically lowers the cost of experimenting with on-device intelligence.
The trade-off is architectural dependency on Apple's design decisions. Extending an API that Apple itself is still actively evolving means deprecations are inevitable down the road. Still, if you are building an AI app for macOS or iOS today and want hybrid flexibility without vendor lock-in, this is the cleanest abstraction layer available.
Sources (1)
- huggingface.co(opens in a new tab)Originalhuggingface.co