AIChatKit gives every Apple-platform app a single, unified chat interface across cloud and on-device AI providers. OpenAI, Anthropic, and Apple Intelligence all share the same protocol, message model, and optional SwiftUI components — swap providers with a one-line change.
AIChatCore defines the shared message model and provider protocol. AIChatOpenAI, AIChatAnthropic, and AIChatFoundationModels each implement it — pull in only the providers your app actually uses.
A single ObservableObject drives streaming, tool calls, reasoning traces, and activity entries. session.send(_:) is non-blocking — entries append as tokens arrive, and session.isGenerating tracks in-flight state.
Most apps render session.entries into their own bubble views. Apps with no design requirements can use ChatView directly and get a complete chat UI for free.
AIChatUI ships MarkdownMessageView — syntax-highlighted fenced code blocks with a language label and copy button, plus headings, tables, and blockquotes, built on swift-markdown-ui and Splash.
loadSnapshot(entries:history:) restores a saved conversation into both the display entries and the provider's history in a single call, so session.send() has full context immediately.
AIChatFoundationModels wires Apple's on-device Foundation Models framework (macOS 26+/iOS 26+) into the same ChatSession API as the cloud providers — no separate integration path.
.package(url: "https://github.com/NerdSnipe-Inc/AIChatKit", from: "0.1.0").product(name: "AIChatCore", package: "AIChatKit"),
.product(name: "AIChatOpenAI", package: "AIChatKit"),
.product(name: "AIChatAnthropic", package: "AIChatKit"),
.product(name: "AIChatFoundationModels", package: "AIChatKit"),
.product(name: "AIChatUI", package: "AIChatKit")For on-device inference, add a companion package: AIChatKitMLX (Apple MLX) or AIChatKitLlama (llama.cpp/GGUF) — both speak the same AIChatCore protocol as the cloud providers.
Every provider — OpenAI, Anthropic, Apple Intelligence, or an on-device model via AIChatKitMLX/AIChatKitLlama — implements the same protocol and feeds the same ChatSession. Switching providers is a constructor change, not a rewrite.
No. AIChatCore is required; add only the provider modules (AIChatOpenAI, AIChatAnthropic, AIChatFoundationModels) and AIChatUI that your app actually uses.
Add AIChatKitMLX for Apple MLX models (Apple Silicon only) or AIChatKitLlama for GGUF models via llama.cpp. Both implement the same AIChatCore protocol, so your ChatSession code doesn't change.
macOS 14+ and iOS 17+, built with Swift 5.10+.
Add AIChatKit to your Package.swift and pick the providers you need. Pair it with AIChatKitMLX or AIChatKitLlama for on-device inference.