iOS examples
The following examples demonstrate different use cases and capabilities of the LEAP SDK on iOS:LeapChat
Full-featured chat app with real-time streaming, conversation management, and native SwiftUI interface
LeapSloganExample
Basic LEAP SDK integration for text generation demonstrating core SwiftUI patterns
Recipe Generator
Structured output generation with JSON schema validation
Audio Demo
Audio input and output processing with LEAP SDK for voice-enabled AI features
Example overview
| Example | Description | Key Features |
|---|---|---|
| LeapChat | Chat interface with streaming | Real-time streaming, conversation management, SwiftUI |
| LeapSloganExample | Text generation | Basic SDK integration, SwiftUI patterns |
| RecipeGenerator | Structured output | JSON schema, formatted responses |
| Audio Demo | Audio processing | Speech input/output, on-device inference |
Getting started
All iOS examples are available in the LeapSDK-Examples repository. Each example includes:- Complete source code with Swift implementation
- SwiftUI views and view models
- Xcode project configuration
- README with setup instructions
- Sample prompts and usage examples
Installation
-
Clone the LeapSDK-Examples repository:
- Open the example project in Xcode
- Follow the example-specific README for model setup and configuration
Basic integration
The LEAP SDK makes it easy to integrate LFM models into your iOS app. Here’s a basic SwiftUI example:SwiftUI integration
The LEAP SDK is designed to work seamlessly with SwiftUI’s reactive patterns:- Use
@StateObjector@ObservedObjectfor SDK instance management - Stream responses directly to
@Stateproperties for real-time UI updates - Leverage Swift’s async/await for model loading and inference
- Combine with SwiftUI navigation for multi-screen chat experiences
Resources
- LeapSDK-Examples Repository - Complete source code for all examples
- LEAP Edge SDK Documentation - API reference and integration guides
- Liquid AI Documentation - Main documentation hub
- Discord Community - Get help and share your projects
Next steps
- Explore the LeapChat example for a complete SwiftUI chat implementation
- Try the Recipe Generator to learn about structured output
- Check out the Audio Demo for audio processing capabilities
- Review the LEAP SDK documentation for detailed API information