AnyLanguageModel 1.0: One Year of Local Models on Apple Platforms
AnyLanguageModel 1.0 unifies local and hosted inference on Apple platforms with a dropâin API, new Swift libraries, and broader model support.

Introduction
One year after its debut, AnyLanguageModel 1.0 reaches a milestone: developers can now run a wide range of language modelsâboth locally on iOS, macOS, and visionOS devices and remotely via hosted providersâthrough a single, dropâin compatible API. The release bundles updated Swift packages (`swiftâhuggingface` and `swiftâxet`), richer feature sets such as tool calling, guided generation, and imageâaugmented prompts, and tighter integration with Appleâs Foundation Models framework.
A unified API for every inference scenario
The core promise of AnyLanguageModel remains unchanged: write once, run anywhere. By swapping a single import statement (`import FoundationModels` â `import AnyLanguageModel`) the same session code works with:
- Systemâprovided models on Apple silicon.
- Openâweight models compiled with llama.cpp, MLX, or CoreâŻML.
- Hosted endpoints from OpenAI, Anthropic, Google Gemini, Ollama, HuggingâŻFace Inference, and any OpenAIâcompatible service.
Key API enhancements include:
- Tool calling and guided generation that operate uniformly across providers, even for nested `@Generable` types.
- Image support using the Foundation Models 27 syntax, enabling multimodal prompts on iOS, macOS, and visionOS.
- Automatic handling of reasoning blocksâthey are omitted when a provider cannot replay them, preserving transcript fidelity.
- APIâkey retrieval via closures, allowing shortâlived tokens to be fetched securely from a backend.
Swift libraries that accelerate model delivery
Two companion packages ship at versionâŻ1.0:
- swiftâhuggingface â streams model files from the HuggingâŻFace Hub directly into Swift apps, handling caching and quantization automatically.
- swiftâxet â provides accelerated download and unpacking for large models hosted on external storage.
Both libraries expose a concise initializer, e.g.: ```swift let model = MLXLanguageModel(modelId: "mlx-community/Qwen3.8-27B-4bit") ``` Developers can now pull a 27âbillionâparameter model onto a Mac with 32âŻGBâŻ+ RAM in a single line of code.
Local models become more capable
The model ecosystem has matured dramatically. Popular openâweight models now fit on consumer Apple devices:
- Gemmaâ4âŻE2B (3.4âŻGB, Q4_0 quantized) â runs comfortably on an iPhone.
- LFM2.5â2.6B (1.7âŻGB, Q4KM) â a lightweight alternative for onâdevice chat.
- Qwen3.8â27Bâ4bit (â16âŻGB) â feasible on highâend Macs.
For ultraâlarge models like GLMâ5.3 (â1.5âŻTB), the framework falls back to hosted inference, preserving a consistent developer experience.
Migration path to 1.0
Existing projects can upgrade by adjusting their Swift Package Manager entry: ```swift .package(url: "https://github.com/huggingface/AnyLanguageModel", from: "1.0.0") ``` Release notes for AnyLanguageModel, swiftâhuggingface, and swiftâxet detail migration steps, including trait flags for MLX support and updated documentation on token handling.
Looking ahead
The team signals two new model families in the pipeline:
- Decision models that output structured actions rather than text.
- Listening models for audioâfirst interactions.
Both will expose the same Swiftâfriendly API, reinforcing the vision of a single entry point for all AI capabilities on Apple platforms.
--- Practical takeâaway: If youâre building an iOS or macOS app that needs languageâmodel intelligence, adopt AnyLanguageModel 1.0 to simplify provider selection, leverage the latest openâweight models locally, and futureâproof your code for upcoming decisionâ and audioâcentric models.
Source
Read original sourceWhy we picked this
Details a new local language model suite for Apple platforms, a notable AI tool release.