
AnyLanguageModel 1.0: Local and Hosted Models on Apple Platforms

AnyLanguageModel 1.0 is the stable release of a drop-in replacement for Apple’s Foundation Models framework, letting apps keep the same session code while choosing which model and provider to use. The project grew out of developer feedback: app developers were curious about local models, unsure how to get started, and wanted to avoid the complexity of supporting multiple inference providers. It ships alongside swift-huggingface 1.0 and swift-xet 1.0, which bring accelerated model downloads from the Hub to Swift apps.
The core API is unchanged: change import FoundationModels to import AnyLanguageModel, and the same session code works with the system model, open-weight models through llama.cpp, MLX, and Core ML, and hosted providers. Major features added over the past year include tool calling with every provider, guided generation with every provider including nested @Generable types and arrays of them, and image support using Foundation Models 27’s syntax on iOS, macOS, and visionOS 27. On OS 27, AnyLanguageModel also works with any model conforming to Foundation Models‘ LanguageModel protocol, including Core AI models.
Hosted model support also expanded. AnyLanguageModel now supports OpenAI’s Chat Completions and Responses APIs, Open Responses for any compatible endpoint, Anthropic’s Messages API with adaptive thinking and effort options, Google’s Gemini API, Ollama, Private Cloud Compute on OS 27, Hugging Face Inference Providers, and other OpenAI-compatible endpoints such as OpenRouter through a custom base URL. With Inference Providers, the same session code can use open-weight models too big for the device; the example points an OpenAILanguageModel at https://router.huggingface.co/v1/ with an HF_TOKEN environment variable and the model openai/gpt-oss-120b.
Hosted providers receive the same features as local models: guided generation, tool calling with streaming, and token usage on responses. Reasoning blocks are part of the transcript, and when switching providers they are automatically omitted from requests if the new provider cannot replay them. API keys are supplied through a closure rather than a string, so apps can fetch short-lived tokens from their own server; the README explains when to let people bring their own keys and when to route requests through a proxy. AnyLanguageModel also runs on Linux, so the same code can be used on a server.
The post also notes that small open-weight models have become more capable. It cites several most-downloaded Hub models at publication time: Gemma 4 E2B from Google in GGUF at about 3.4 GB with Q4_0 and quantization-aware training; LFM2.5 2.6B from Liquid AI in GGUF at about 1.7 GB with Q4_K_M; and Qwen3.8 27B for MLX from Alibaba at about 16 GB with 4 bits. The first two fit on an iPhone, while Qwen3.8 27B runs on a Mac with 32 GB of memory or more. Selecting the MLX model is one line: let model = MLXLanguageModel(modelId: “mlx-community/Qwen3.8-27B-4bit”). For comparison, the post mentions GLM-5.3 from Z.ai takes about 1.5 TB in BF16; for most users it is available through Inference Providers.
The 1.0 dependency manifest uses from: “1.0.0” with traits: [“MLX”], and migration guidance is available in the AnyLanguageModel, swift-huggingface, and swift-xet release notes. The post credits community feedback and contributions for shaping major features. It closes with the next step: bringing the same approach to more capabilities through familiar Swift APIs with a choice of models running on the device, and it says models that decide and models that listen are coming soon.


