LeapSDK is a powerful iOS SDK that enables running AI models locally on device using the Liquid Inference Engine. It provides a high-level Swift API for chat functionality with real-time token streaming.
- 🚀 On-device AI inference - Run models locally without network dependencies
- 💬 Streaming chat API - Real-time token streaming with AsyncStream
- 🎯 Protocol-oriented design - Clean, extensible architecture
- 📱 Multi-platform support - iOS, macOS, and Mac Catalyst
- 🛡️ Type-safe Swift API - Modern Swift with full Codable support
- iOS 18.0+ / macOS 14.0+
Add LeapSDK to your project in Xcode:
- Open your project in Xcode
- Go to File → Add Package Dependencies
- Enter the repository URL:
https://github.com/Liquid4All/leap-ios.git - Select the latest version and add to your target
Or add it to your Package.swift:
dependencies: [
.package(url: "https://github.com/Liquid4All/leap-ios.git", from: "0.7.7")
]Add LeapSDK to your Podfile:
pod 'Leap-SDK', '~> 0.7.7'Then run:
pod install- Download the latest
LeapSDK.xcframework.zipfrom Releases - Unzip and drag
LeapSDK.xcframeworkinto your Xcode project - Ensure "Embed & Sign" is selected in the frameworks settings
import LeapSDK
// Load a model
let modelURL = Bundle.main.url(forResource: "model", withExtension: "bundle")!
let runner = try await Leap.load(options: .init(bundlePath: modelURL.path()))
// Create a conversation
let conversation = Conversation(modelRunner: runner, history: [])
// Generate streaming response
let userMessage = ChatMessage(role: .user, content: [.text("Hello!")])
for await response in conversation.generateResponse(message: userMessage) {
switch response {
case .chunk(let text):
print(text, terminator: "")
case .reasoningChunk(let reasoning):
print("Reasoning: \(reasoning)")
case .complete(let usage, let reason):
print("\\nComplete! Usage: \(usage)")
}
}Download pre-trained model bundles from the Leap Model Library. Models are distributed as .bundle files that can be included in your app bundle.
Complete example applications are available in the Examples directory:
- LeapChatExample: SwiftUI chat interface with streaming responses
- LeapSloganExample: Simple text generation app
- On-device inference: No network required, works offline
- Optimized for mobile: Efficient memory usage and battery life
- Real-time streaming: Token-by-token generation for responsive UIs
- Multi-platform: Native performance on iOS, macOS, and Mac Catalyst
- Issues: GitHub Issues
- Documentation: leap.liquid.ai
LeapSDK is proprietary software. See the license terms included with the SDK for details.