v0.9.2
Prerequisites​
Make sure you have:- Xcode 15.0 or later with Swift 5.9.
- An iOS project targeting iOS 15.0+ (macOS 12.0+ or Mac Catalyst 15.0+ are also supported).
- A physical iPhone or iPad with at least 3 GB RAM for best performance. The simulator works for development but runs models much slower.
Install the SDK​
Choose your preferred installation method:- Swift Package Manager
- CocoaPods
- Manual
Recommended
- In Xcode choose File -> Add Package Dependencies.
- Enter
https://github.com/Liquid4All/leap-ios.git. - Select the
0.9.2release (or newer). - Add the
LeapSDKproduct to your app target. - (Optional) Add
LeapModelDownloaderif you plan to download model bundles at runtime.
The constrained-generation macros (
@Generatable, @Guide) ship inside the LeapSDK product. No additional package is required.Getting and Loading Models​
The SDK uses GGUF manifests for loading models (recommended for all new projects due to superior inference performance and better default generation parameters).Legacy Executorch bundle support is available in the accordion below for existing projects.
Loading from GGUF manifest
The LEAP Edge SDK supports directly downloading LEAP models in GGUF format. Given the model name and quantization method (which you can find in the LEAP Model Library), the SDK will automatically download the necessary GGUF files along with generation parameters for optimal performance.Legacy: Executorch Bundles
Legacy: Executorch Bundles
Browse the Leap Model Library and download a
Use Need custom runtime settings (threads, context size, GPU layers)? Pass a
.bundle file for the model/quantization you want. .bundle packages contain metadata plus assets for the ExecuTorch backend.You can either:- Ship it with the app - drag the bundle into your Xcode project and ensure it is added to the main target.
- Download at runtime - use
LeapModelDownloaderto fetch bundles on demand.
Alternative: Download at runtime
Alternative: Download at runtime
Leap.load(url:options:) inside an async context. Passing a .bundle loads the model through the ExecuTorch backend.Example
LiquidInferenceEngineOptions value:Stream responses​
send(_:) (shown above) launches a Task that consumes the AsyncThrowingStream returned by Conversation.generateResponse. Each MessageResponse case maps to UI updates, tool execution, or completion metadata. Cancel the task manually (for example via stopGeneration()) to interrupt generation early. You can also observe conversation.isGenerating to disable UI controls while a request is in flight.
Send images and audio (optional)​
When the loaded model ships with multimodal weights (and companion files were detected), you can mix text, image, and audio content in the same message:Add tool results back to the history​
Next steps​
- Learn how to expose structured JSON outputs with the
@Generatablemacros. - Wire up tools and external APIs with Function Calling.
- Compare on-device and cloud behaviour in Cloud AI Comparison.