Hi everyone! I built SwiftAI, an open source library for building LLM features in Swift.
I got into this, when our team started building features using the FoundationModels SDK, and if you’re doing the same, you’ve probably wondered how to handle cases when Apple’s LLM isn’t available (Apple Intelligence is off, old device, etc) without adding complexity into your codebase. You can check our motivation section to see why shipping production features with FoundationModels can be tricky.
SwiftAI’s first release solves this with a unified API and pluggable LLM backends. You can switch between Apple’s local models and cloud LLMs like OpenAI, Anthropic, Mistral, and Gemini using one simple interface, with type-safe structured output and built-in tool support.
> The vision is to make building GenAI in Swift as simple as SwiftUI made building UIs.
If you’re building AI features, I’d love to hear your pain points and ideas. You can also contribute in any way — code, design, docs, or examples.
System Design — for anyone who wants to understand the internals of SwiftAI.