swift-ai brings the @earendil-works/pi-ai API and event model to Swift applications and services. It uses go-ai as the audited reference implementation and exposes parity information both in STATUS.json and through SwiftAIStatus at runtime.
The package tracks the bounded pi-ai v0.84.0 release surface. Its generated catalogues contain 1,153 text models across 38 providers and 42 image models; catalogue presence does not imply that every provider has a bundled native transport.
SwiftAI.bootstrap() initialises the actor-backed model and provider registry. A request resolves its model, credentials and provider implementation before passing through a common asynchronous stream or complete API.
HTTP providers convert SSE responses into shared typed events for text, reasoning, tool calls, usage and completion. Message transformation, partial JSON parsing and JSON Schema-based tool validation help keep provider-specific wire formats out of application code.
Codable types cover models, providers, messages, tools, usage, diagnostics, stream options and the common event protocol.
Implemented streaming paths include OpenAI Chat Completions, OpenAI Responses, Azure OpenAI Responses, Codex, Anthropic Messages, Mistral, Gemini, Gemini CLI and Baseten.
OAuth support includes GitHub Copilot, OpenAI Codex, Anthropic, Gemini CLI and Antigravity.
SSE parsing, partial tool-argument JSON, JSON Schema validation, retry handling and request or response interception hooks.
Includes release-pinned pi-ai v0.84.0 text and OpenRouter image catalogues.
Bedrock request building and Codex transport surfaces are present, but heavyweight vendor SDK and WebSocket transports remain pluggable rather than bundled.