---
title: "Introducing AnyLanguageModel: One API for Local and Remote LLMs on Apple Platforms"
description: "AnyLanguageModel is a Swift package that mirrors Apple's Foundation Models API, so a single `import` swap lets apps target Apple's system model, Core ML, MLX, llama.cpp, Ollama, or cloud providers (OpenAI, Anthropic, Gemini, Hugging Face Inference Providers) through the same session-based interface."
url: "https://swe.quest/articles/introducing-anylanguagemodel-one-api-for-local-and-remote-llms-on-apple-049ac2052cff4c11"
canonical: "https://huggingface.co/blog/anylanguagemodel"
source: "Hugging Face"
published: "2025-11-20"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 6
tags: ["swift","llms","api-design","inference","mobile"]
---

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

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-11-20, 6 min read, Announcement. Original: [https://huggingface.co/blog/anylanguagemodel](https://huggingface.co/blog/anylanguagemodel)

## Summary

AnyLanguageModel is a Swift package that mirrors Apple's Foundation Models API, so a single \`import\` swap lets apps target Apple's system model, Core ML, MLX, llama.cpp, Ollama, or cloud providers (OpenAI, Anthropic, Gemini, Hugging Face Inference Providers) through the same session-based interface. Building on Foundation Models rather than a new abstraction keeps the API minimal and familiar. Swift 6.1 package traits let developers opt in only to the heavy local backends they need. The library already extends the API with image inputs for vision-language models, and tool calling, MCP and guided generation across providers are planned before 1.0.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Swift](https://swe.quest/tags/swift.md) (Languages)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)

## Prerequisites

- Swift Package Manager ([easy posts on Swift](https://swe.quest/tags/swift.md?difficulty=easy))
- Apple Foundation Models framework

## Keywords

AnyLanguageModel, Foundation Models, MLX, Core ML, llama.cpp, Ollama, Swift package traits, chat-ui-swift

## Related posts

- [AnyLanguageModel 1.0: One Year of Local Models on Apple Platforms](https://swe.quest/articles/anylanguagemodel-1-0-one-year-of-local-models-on-apple-platforms-2fd58a39aa0b428c.md): Hugging Face · 2026-10-20 · Medium · 4 min read · Swift, LLMs, Inference & serving, Mobile, API design
  AnyLanguageModel 1.0 is a Swift package that acts as a drop-in replacement for Apple's Foundation Models framework, letting apps swap the model and provider by changing a single import.
- [Releasing Swift Transformers: Run On-Device LLMs in Apple Devices](https://swe.quest/articles/releasing-swift-transformers-run-on-device-llms-in-apple-devices-ee6106831bf892fd.md): Hugging Face · 2023-08-08 · Medium · 15 min read · Swift, Inference & serving, LLMs, Mobile
  Hugging Face released swift-transformers, an alpha Swift package with a transformers-like API for on-device text generation, along with the swift-chat demo app, updated exporters and transformers-to-coreml conversion tools, and pre-converted Llama 2 7B and Falcon 7B Core ML models.
- [Introducing AnySpeechRecognizer and AnyDecisionModel: Open Models for Speech and Decisions on Apple Platforms](https://swe.quest/articles/introducing-anyspeechrecognizer-and-anydecisionmodel-open-models-for-speech-and-2746fca6b9690c89.md): Hugging Face · 2026-10-29 · Medium · 12 min read · Speech & audio, Swift, Inference & serving, LLMs, Machine learning
  AnySpeechRecognizer mirrors Apple's SpeechAnalyzer API but lets apps swap in other engines (NVIDIA Parakeet v3/Ultra/Unified and Alibaba Qwen3-ASR on Core ML) and adds Sortformer-based speaker diarization for up to four speakers.
- [Swift Transformers Reaches 1.0 – and Looks to the Future](https://swe.quest/articles/swift-transformers-reaches-1-0-and-looks-to-the-future-a8395154e2037c4e.md): Hugging Face · 2025-09-26 · Easy · 5 min read · Swift, Inference & serving, LLMs, Mobile
  swift-transformers, Hugging Face's Swift library for running local models on Apple Silicon, reaches 1.0.
- [Introducing swift-huggingface: The Complete Swift Client for Hugging Face](https://swe.quest/articles/introducing-swift-huggingface-the-complete-swift-client-for-hugging-face-a785ae7c4e628cdb.md): Hugging Face · 2025-12-05 · Medium · 6 min read · Swift, Developer tools, Mobile, Machine learning
  swift-huggingface is a ground-up rewrite of the Swift client for the Hugging Face Hub, replacing swift-transformers' HubApi.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
