{"repo":"teunlao/swift-ai-sdk","free":true,"listed":false,"github":"https://github.com/teunlao/swift-ai-sdk","clone":"git clone https://github.com/teunlao/swift-ai-sdk.git","description":"Unified AI SDK for Swift, bringing the power of Vercel AI SDK to Apple platforms","language":"Swift","stars":149,"topics":["ai","swift","sdk","vercel","openai","claude","mcp"],"license":"Apache-2.0","category":"api-integrations-sdks","readme_excerpt":"Swift AI SDK A unified AI SDK for Swift: streaming chat/completions, structured outputs, tool/function/MCP calling, and middleware — with 38 provider modules via one API (OpenAI, Anthropic, Google, Groq, xAI, Vercel, TogetherAI, and more). Based on the Vercel AI SDK with a focus on full API parity. Documentation Getting Started Examples Discussions Features - Streaming and non-streaming text generation - Structured outputs (typed Codable + JSON Schema) - Tool/function calling + MCP tools - Provider-agnostic API (swap providers without changing call sites) - Middleware hooks - Experimental video generation Installation (SwiftPM) Available on Swift Package Index. Add the package to your Package.swift : Quickstart (Streaming) Minimal text generation and streaming with OpenAI: More examples (tools, structured output, middleware) are in the docs and examples/ . Unified Provider Architecture Switch providers without changing code — the function signature stays the same regardless of provider. Structured Outputs (Typed Codable ) Generate structured data validated by JSON Schema or Codable . Example: extract a release summary into a Release type using Schema.codable . Notes: use generateObjectNoSchema(...) for raw JSONValue ; arrays/enums via generateObjectArray / generateObjectEnum . Tools (Typed) Models can call tools. Typed weather example: Notes: tool(...) auto-generates schemas from Codable types. For streaming, use streamText(..., tools: ...) and consume textStream / toolResult","default_branch":null,"files":null,"tree":[],"storefront":"/r/teunlao","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/teunlao/swift-ai-sdk/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}