appleappleOfficialยท2 Agent Skills Included

foundation-models-utilities

Swift utilities for chat endpoints, skills, and history

Connects Swift apps to any OpenAI-compatible chat completions endpoint through Apple's Foundation Models framework. Adds on-demand skills the model activates via tool calls, plus history modifiers that drop tool calls, apply rolling windows, and summarize transcripts. Eliminates manual context-window management and custom networking code for server-hosted language models.
npx skills add apple/foundation-models-utilities --all -g -y

All Skills in This Repository (2)

Pure Emerald Level Indicators

Frequently Asked Questions

FAQPage Schema
How to install foundation-models-utilities?โ–ผ

Run `npx skills add apple/foundation-models-utilities --all -g -y` in your terminal to install all skills in this suite globally.

How to connect Swift apps to a local LLM server?โ–ผ

Use ChatCompletionsLanguageModel with your server's base URL, then pass it to a standard LanguageModelSession. It streams responses through the OpenAI chat completions protocol.

How to stop long chats from overflowing the context window?โ–ผ

Compose the history modifiers: droppingCompletedToolCalls, rollingWindow, and summarizeHistory. They compress the transcript automatically before each generation.

What are just-in-time skills in Foundation Models?โ–ผ

Skills keep extra instructions out of the prompt until the model activates them with a tool call. This reduces context pollution and speeds up time-to-first-token.

Does this package work on Linux?โ–ผ

Yes. It supports macOS, iOS, visionOS, watchOS, and select Linux distributions like Ubuntu via Swift Package Manager.

Related Repositories in Software Engineering

View All in Software Engineeringโ†’