AnyLanguageModel 1.0 : One Year of Local Models on Apple Platforms

AnyLanguageModel 1.0 : One Year of Local Models on Apple Platforms

Hugging Face announces version 1.0 of AnyLanguageModel, a library that directly replaces Apple’s Foundation Models framework and allows developers to choose the model and provider used by their application. It is released alongside swift-huggingface 1.0 and swift-xet 1.0.

  • AnyLanguageModel 1.0 replaces Apple’s Foundation Models framework directly.
  • Developers can use local or hosted models with the same code.
  • Tool calling, guided generation and image support work across all providers.
  • Small open models like Gemma 4 E2B and LFM2.5 can run on an iPhone.

The project was born from feedback from application developers who were interested in models running locally, without always knowing how to proceed. They also wanted to avoid the complexity of supporting multiple inference providers. Local models and hosted models each have their strengths, and a common API should make it easier to choose the right model for each task.

A Compatible API and New Features

The starting principle remains the same: use the Foundation Models API with the model that suits the application. To migrate, simply replace the line import FoundationModels with import AnyLanguageModel, with the same session code then working with the system model, with open models run via llama.cpp, MLX and Core ML, as well as with hosted providers.

Several features have been added. Tool calling works with all providers, as does guided generation, including with nested @Generable types and arrays of these types. Image support allows images to be attached to requests using Foundation Models 27 syntax, including with the system model on iOS, macOS and visionOS 27. Under OS 27, the library also works with any model conforming to the Foundation Models LanguageModel protocol, notably Core AI models.

On the hosted side, the library supports OpenAI’s Chat Completions and Responses APIs, Open Responses, Anthropic’s Messages API, with adaptive reflection and effort options, Google’s Gemini API and Ollama. It also handles Private Cloud Compute under OS 27, as well as Hugging Face Inference Providers and other OpenAI-compatible endpoints, like OpenRouter, via a custom base URL. Thanks to Inference Providers, open models too large for the device can be used with the same code, for example openai/gpt-oss-120b.

Hosted providers benefit from the same features as local models: guided generation, streaming tool calling and token counting in responses. Reasoning is now part of the transcription. When switching providers, reasoning blocks are automatically removed from requests if the new provider cannot replay them. API keys are also provided via a function rather than a string, allowing the application to retrieve short-lived tokens from its own server. Finally, the library works under Linux, allowing the same code to be used server-side.

More Performant Open Models

Among the most downloaded models on the Hub at the moment, the article cites Google’s Gemma 4 E2B, in GGUF format, about 3.4 GB in Q4_0 with quantization-aware training, and Liquid AI’s LFM2.5 2.6B, about 1.7 GB in Q4_K_M. Alibaba’s Qwen3.8 27B for MLX weighs about 16 GB in 4-bit. According to the article, the first two fit on an iPhone, and Qwen3.8 27B runs on a Mac with at least 32 GB of memory.

For heavier configurations, Z.ai’s GLM-5.3 occupies about 1.5 TB in BF16, according to the text, and remains accessible via Inference Providers. Hugging Face also indicates that features for ‘models that decide’ and ‘models that listen’ are coming soon.

S’abonner
Notification pour
guest

0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
0
Nous aimerions avoir votre avis, veuillez laisser un commentaire.x