---
title: "AnyLanguageModel 1.0: One Year of Local Models on Apple Platforms"
description: "AnyLanguageModel 1.0, alongside swift-huggingface 1.0 and swift-xet 1.0, marks a year of development on a drop-in replacement for Apple’s Foundation Models framework that lets developers choose the model and provider. It provides a unified API for switching between local models (llama.cpp, MLX, Core ML) and hosted providers (OpenAI, Anthropic, Google Gemini, Ollama, Hugging Face). The update adds tool calling and guided generation support for all providers, image input using Foundation Models’ syntax on OS 27, and reasoning that appears in transcripts. API keys are supplied through closures instead of strings, enabling apps to fetch short-lived tokens from their own server. Local open-weight models such as Gemma 4 E2B and LFM2.5 2.6B fit on an iPhone, while Qwen3.8 27B runs on a Mac with 32 GB of memory, all loadable with a single line of code."
---

# AnyLanguageModel 1.0: One Year of Local Models on Apple Platforms

[Hugging Face](https://yomu.fyi/company/hugging-face) · Mattt · Oct 20, 2026

**Type:** Announcement

## Summary

AnyLanguageModel 1.0, alongside swift-huggingface 1.0 and swift-xet 1.0, marks a year of development on a drop-in replacement for Apple’s Foundation Models framework that lets developers choose the model and provider. It provides a unified API for switching between local models (llama.cpp, MLX, Core ML) and hosted providers (OpenAI, Anthropic, Google Gemini, Ollama, Hugging Face). The update adds tool calling and guided generation support for all providers, image input using Foundation Models’ syntax on OS 27, and reasoning that appears in transcripts. API keys are supplied through closures instead of strings, enabling apps to fetch short-lived tokens from their own server. Local open-weight models such as Gemma 4 E2B and LFM2.5 2.6B fit on an iPhone, while Qwen3.8 27B runs on a Mac with 32 GB of memory, all loadable with a single line of code.

## Context

A year after introducing AnyLanguageModel as a drop-in replacement for Apple’s Foundation Models framework, the team is releasing version 1.0 alongside swift-huggingface 1.0 and swift-xet 1.0.

## Approach / What changed

AnyLanguageModel provides a unified Swift API that works with Apple’s Foundation Models, local inference engines (llama.cpp, MLX, Core ML), and hosted providers (OpenAI, Anthropic, Gemini, etc.). Key features include tool calling, guided generation, image input, reasoning in transcripts, and secure API key management via closures. The library also runs on Linux.

## Takeaways

- AnyLanguageModel 1.0 provides a drop-in replacement for Apple’s Foundation Models framework, requiring only a change of import statement to switch models.
- Tool calling and guided generation are supported across all providers, including local models via llama.cpp, MLX, Core ML, and hosted providers like OpenAI and Anthropic.
- API keys are supplied through closures instead of strings, allowing apps to fetch short-lived tokens from a server for better security.

## FAQ

### How do I integrate AnyLanguageModel into my app?

Change your import statement from \`import FoundationModels\` to \`import AnyLanguageModel\`. The same session code then works with system models, open-weight models through llama.cpp, MLX, and Core ML, and with hosted providers.

### Which hosted providers are supported?

OpenAI's Chat Completions and Responses APIs, Anthropic's Messages API, Google's Gemini API, Ollama, Private Cloud Compute on OS 27, Hugging Face Inference Providers, and OpenAI-compatible endpoints like OpenRouter.

### How does API key management work?

API keys are provided via closures instead of strings, enabling apps to 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.

**Tags:** [Apple](https://yomu.fyi/topic/apple), [Hugging Face](https://yomu.fyi/topic/hugging-face), [LLMs](https://yomu.fyi/topic/llm), [Machine Learning](https://yomu.fyi/topic/machine-learning), [Swift](https://yomu.fyi/topic/swift)

- Source: [Hugging Face](https://huggingface.co/blog/anylanguagemodel-1-0)
- Source URL: https://huggingface.co/blog/anylanguagemodel-1-0
- Ingested by Yomu: 2026-10-20T15:00:16.856Z

[Read original post](https://huggingface.co/blog/anylanguagemodel-1-0)
