Overview of Swift AI SDK components
mainThe Swift AI SDK is a toolkit for building AI applications in Swift across Apple platforms and server-side Swift. It ports the AI SDK Core from the TypeScript version, providing a unified API for text generation, structured data, and tool calling.
Included Components
- SwiftAISDK (Core): The main API for
generateText,streamText, andgenerateObject. - Provider System: Integrations for 38+ providers (e.g.,
OpenAIProvider,AnthropicProvider,GoogleProvider). - AISDKProvider: Foundation types and protocols like
LanguageModelV3. - AISDKProviderUtils: Utilities for HTTP, JSON, schema validation, and retries.
- AISDKZodAdapter: A Zod-like DSL for defining structured data schemas.
Not Included
Unlike the TypeScript SDK, this does not include web-specific UI libraries (like useChat or useCompletion) or React Server Components (RSC) utilities. For hybrid apps, use the Swift AI SDK on the server and the TypeScript AI SDK UI on the frontend.