AnyLanguageModel 1.0: One Year of Local Models on Apple Platforms
Hugging Face a drop-in compatible API Hosted models, too Open-weight models got better Upgrading to 1.0 What’s next Links Last November, we introduced AnyLanguageModel on this blog: a drop-in replacement for Apple’s Foundation Models framework that lets you choose the model and provider your app uses. We heard from app developers who were curious about local models but weren’t always sure how to get started.
They also wanted to avoid the added complexity of supporting multiple inference providers. AnyLanguageModel grew out of that feedback. Local and hosted inference each have their strengths, and both have a role in building this new generation of intelligent apps. A shared API makes it easier to choose the right model for each task. A year and dozens of releases later, AnyLanguageModel 1.0 is out, along with swift-huggingface 1.0 and swift-xet 1.0. The core idea of AnyLanguageModel remains the same: use the Foundation Models API with the model that fits your app. To get started, change your import statement: – import FoundationModels + import AnyLanguageModel The same session code then works with the system model, with open-weight models through llama.cpp, MLX, and Core ML, and with the hosted providers below. Over the past year, we’ve added several major features: On OS 27, AnyLanguageModel also works with any model that conforms to Foundation Models’ LanguageModel protocol, including Core AI models. Alongside AnyLanguageModel, we’ve built out swift-huggingface and swift-xet to bring accelerated model downloads from the Hub to Swift apps. Support for hosted models expanded this year, too. AnyLanguageModel now supports: With Inference Providers, you can use open-weight models that are too big to run on the device with the same session code: let model = OpenAILanguageModel( baseURL: URL(string: “https://router.huggingface.co/v1/”)!, apiKey: ProcessInfo.processInfo.environment[“HF_TOKEN”]!, model: “openai/gpt-oss-120b”, apiVariant: .chatCompletions ) Hosted providers get the same features as local models: guided generation, tool calling with streaming, and token usage on responses. Reasoning is now part of the transcript too. When you switch providers, reasoning blocks are automatically omitted from requests if the new provider can’t replay them.