# Introducing AnyLanguageModel: One API for Local and Remote LLMs on Apple Platforms

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

**Type:** Announcement

## Summary

Apple developers frequently face integration friction when trying to support a mix of local and cloud language models across disparate APIs. To resolve this fragmentation, AnyLanguageModel introduces a unified Swift package that acts as a drop-in replacement for Apple's Foundation Models framework. The package standardizes interactions across local backends such as Core ML, MLX, and llama.cpp alongside cloud providers like Anthropic and OpenAI. To avoid dependency bloat from multi-backend support, the library employs Swift 6.1 package traits so projects only import the specific runtime engines they require. Furthermore, the library extends beyond current Foundation Models limitations by adding prompt image support for vision-language models.

## Context

Apple developers face friction when integrating language models because local engines like Core ML and MLX, cloud services, and Apple's Foundation Models all require disparate APIs and setup requirements.

## Approach / What changed

The author created AnyLanguageModel, a Swift package mirroring Apple's Foundation Models API as a drop-in replacement across local and remote backends. It uses Swift 6.1 package traits to selectively include dependencies such as Core ML, MLX, or llama.cpp, and extends the base API to support multimodal image inputs.

## Takeaways

- AnyLanguageModel acts as a drop-in replacement for Apple's Foundation Models framework, enabling model swaps across Apple's system models, Core ML, MLX, llama.cpp, Ollama, and remote cloud APIs.
- To prevent dependency bloat, AnyLanguageModel leverages Swift 6.1 package traits so developers only import required backends like CoreML, MLX, or Llama while using URLSession for cloud providers by default.
- Because Apple's Foundation Models API lacks native prompt image support, AnyLanguageModel extends the interface ahead of official support to allow vision-language requests.

**Tags:** [Developer Experience](https://yomu.fyi/topic/developer-experience), [iOS](https://yomu.fyi/topic/ios), [LLMs](https://yomu.fyi/topic/llm), [Open Source](https://yomu.fyi/topic/open-source)

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