Changelog
What shipped in each release of swift-ai-sdk.
0.1.1
Providers
- First-class model packs for AI Gateway, Baseten, Cerebras, DeepInfra,
Fireworks, LM Studio, Ollama, OpenRouter, Sarvam, Together AI, and Vercel —
dedicated types (
BasetenModel,CerebrasModel, and so on) built on a shared OpenAI-compatible base, replacing theOpenAICompatibleProviderfactory functions for these providers (still available, deprecated).MistralModel,PerplexityModel,DeepSeekModel, andGroqModelmoved onto the same shared base for consistency, and every pack listed here now acceptsqueryParams. - Together AI, DeepInfra, and Baseten also get dedicated embedding model
types:
TogetherAIEmbeddingModel,DeepInfraEmbeddingModel, andBasetenEmbeddingModel. - OpenRouter's reasoning effort now maps to its actual nested
reasoning: {"effort": ...}wire format instead of the genericreasoning_effortfield other OpenAI-compatible providers use.
Examples
- Reorganized into
Examples/Features/(the same numbered walkthroughs as before, plus a new 23-WorkflowGuides) andExamples/Providers/<Name>, a minimal runnable example for every supported provider.
0.1.0
The first release. A Swift port of the Vercel AI SDK for iOS and macOS.
Core
generateTextandstreamText, with the tool-calling loop, steps, and streamed reasoning.- Structured output:
generateObject,streamObject(pluselementStreamfor arrays),generateEnum, andgenerateJSON. embed,embedMany,cosineSimilarity, andrerank.- A
SchemaDSL that validates arguments and output before decoding. ReasoningEffortmaps to each provider's native reasoning controls; reasoning streams as.reasoningDelta.
Agents and tools
Agent, theToolLoopAgentanalog: a model bundled with instructions, tools, and loop settings. Also works as aChatTransport.- Loop control (
stopWhen,stepCountIs,hasToolCall), plusprepareCall,prepareStep, andtoolOrder. - Closure-based
Toolwith typed arguments, execution context, approvals, and client-side tools. - Subagents: any
Agentbecomes a tool viaasTool. - Provider-defined (server-executed) tools with typed builders under
<Model>.Toolsfor xAI, OpenAI, Google, and Anthropic — web and X search, code execution, file search, computer use, and more. Calls and results come back as provider-executed.toolCall/.toolResultparts, and Anthropic's required beta headers are added for you. - MCP tools over HTTP via
MCPClient.
Providers
Native packs that speak each provider's own wire:
OpenAIModel(Responses and.chat),AnthropicModel,GoogleModel,GoogleVertexModel,AzureOpenAIProvider,BedrockModel,XaiModel(with typedSearchParameterslive search),GroqModel,DeepSeekModel,MistralModel,PerplexityModel,CohereModel.OpenAICompatibleProviderfactories for Together, Fireworks, Cerebras, OpenRouter, DeepInfra, Baseten, Vercel, Gateway, Ollama, LM Studio, and Sarvam.- Sarvam:
sarvam-30b/sarvam-105breasoning chat,SarvamSpeechModel(Bulbul), andSarvamTranscriptionModel(Saaras) for Indian languages. ProviderRegistryandcustomProviderfor"provider:model"strings and aliases.
Middleware
wrapLanguageModelwithextractReasoning,simulateStreaming,defaultSettings, andcache(backed byLanguageModelCache; ships an in-processInMemoryLanguageModelCache).- Hooks:
transformRequest,wrapStream, andwrapCall(wrap the whole call and decide whether to run the model).
Media
- Images: OpenAI, fal, Luma, Replicate.
- Speech: OpenAI, ElevenLabs, LMNT, Hume, Deepgram, Sarvam.
- Transcription: OpenAI, ElevenLabs, Deepgram, AssemblyAI, Rev.ai, Gladia, Sarvam.
- Video: xAI, Luma.
UI and realtime
ChatSession,CompletionSession, andObjectSessionas@Observableobjects for SwiftUI.- The UI-message stream protocol, wire-compatible with the AI SDK's
/api/chatroute:ChatTransport,HTTPChatTransport,LocalChatTransport,readUIMessageStream, message metadata, and stream resumption. - Realtime voice over WebSockets — OpenAI, Google (Gemini Live), and xAI —
through
RealtimeSession.
On-device
FoundationModelsModelruns Apple Intelligence through the same API as the cloud providers, with nothing leaving the device.
Tooling
AITelemetryspans, structuredAIError, and testing helpers in theAITestingmodule.