swift-ai-sdk
View on GitHubUnified AI SDK for Swift, bringing the power of Vercel AI SDK to Apple platforms
Swift port of the Vercel AI SDK offering one provider-agnostic API for streaming text, structured outputs, tool calling, MCP tools, and middleware across 38 providers via SwiftPM. Built for iOS/macOS apps needing OpenAI, Anthropic, Google and others from Swift.
Use Cases
Streaming chat and text generation in iOS/macOS appsStructured output extraction with typed Codable schemasTool/function calling from Swift clientsCalling MCP tools from Apple-platform appsSwitching LLM providers without changing call sitesMiddleware hooks for LLM request/response pipelinesExperimental video generation from Swift
Built With
- Language
- Swift
- Frameworks
- Swift · SwiftPM · Vercel AI SDK · Swift Concurrency (async/await) · Swift Codable · JSON Schema · pnpm monorepo · Node.js
Tags
swift · sdk · llm · streaming · tool-calling · structured-outputs · mcp · multi-provider · apple-platforms · ios · macos · vercel-ai-sdk · middleware · text-generation · function-calling · provider-agnostic