foundation-models-language-model-protocol

Connect server-side language models to Apple's Foundation Models framework.

476|27|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/apple/foundation-models-utilities --skill foundation-models-language-model-protocol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-language-model-protocol
Source: https://github.com/apple/foundation-models-utilities/tree/main/skills/foundation-models-language-model-protocol
Command: npx skills add https://github.com/apple/foundation-models-utilities --skill foundation-models-language-model-protocol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a bridge between server-side language models and Apple's Foundation Models framework, enabling seamless integration of external models into the framework's API.

Core Features & Use Cases

  • Language Model Integration: Connects server-side inference APIs to the Foundation Models framework.
  • API Translation Layer: Translates API calls between the framework and the inference endpoint.
  • Authentication and Error Handling: Manages authentication and provides error handling for end-user accounts and developer-paid usage.
  • Use Case: For a developer working on a Swift package that needs to connect to a server-side language model, this Skill provides the necessary tools and guidelines.

Quick Start

Use the foundation-models-language-model-protocol skill to build a package that connects to a server-side language model and conforms to the LanguageModel protocol.

Frequently Asked Questions about foundation-models-language-model-protocol

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a server-side language model to Apple's Foundation Models framework?

To connect a server-side language model to Apple's Foundation Models framework, you build a Swift package conforming to the LanguageModel and LanguageModelExecutor protocols, translating API calls between the framework and your inference endpoint.

What authentication methods does the Foundation Models framework support for server-side language models?

For server-side language models, the Foundation Models framework supports OAuth authentication and API key-based usage, managing authentication alongside error handling for end-user accounts and developer-paid usage.

Can I use my own server-side inference API with Swift and Foundation Models?

Yes, you can use your server-side inference API with Swift by creating an API translation layer that integrates with the Foundation Models executor channel and conforms to the required LanguageModel protocol.

What is the LanguageModelExecutor protocol used for in Swift?

The LanguageModelExecutor protocol in Swift defines the executor channel integration for server-side language models, serving as a required conformance alongside the LanguageModel protocol to bridge external inference APIs into the Foundation Models framework.

Does the Foundation Models framework handle error handling for external server-side language models?

Yes, the Foundation Models framework handles error handling for external server-side language models by managing authentication errors and providing structured handling for both end-user accounts and developer-paid usage.

Why do I need an API translation layer for Foundation Models?

You need an API translation layer for Foundation Models to translate API calls between the framework and your server-side inference endpoint, ensuring seamless integration of external models into the framework's API structure.