Skip to main content
The LEAP Edge SDK provides native Kotlin integration for deploying LFM2 models on Android devices. The SDK handles model loading, inference, and streaming responses, making it straightforward to add on-device AI capabilities to your Android applications.

Android examples

The following examples demonstrate different use cases and capabilities of the LEAP SDK on Android:

LeapChat

Full-featured chat app with real-time streaming, persistent conversation history, and modern Android UI

LeapAudioDemo

Audio input and output processing with LFM2.5-Audio-1.5B for voice-enabled AI features

LeapKoogAgent

Integration with the Koog framework for building AI agents with tool calling capabilities

SloganApp

Single-turn marketing slogan generation demonstrating Android Views integration

ShareAI

Website summary generator that processes shared URLs

Recipe Generator

Structured output generation demonstrating JSON schema validation with the LEAP SDK

VLM Example

Visual Language Model integration for image understanding and generation

Example overview

ExampleDescriptionKey Features
LeapChatChat interface with streamingReal-time streaming, conversation history, modern UI
LeapAudioDemoAudio processingSpeech input/output with LFM2.5-Audio-1.5B
LeapKoogAgentAI agent frameworkKoog integration, tool calling, agent workflows
SloganAppText generationSingle-turn generation, Android Views
ShareAIWebsite summarizationURL processing, content extraction
RecipeGeneratorStructured outputJSON schema, formatted responses
VLMExampleVision modelImage understanding, VLM integration

Getting started

All Android examples are available in the LeapSDK-Examples repository. Each example includes:
  • Complete source code with Kotlin implementation
  • Gradle build configuration
  • README with setup instructions
  • Sample prompts and usage examples

Installation

  1. Clone the LeapSDK-Examples repository:
    git clone https://github.com/Liquid4All/LeapSDK-Examples.git
    cd LeapSDK-Examples/Android
    
  2. Open the example project in Android Studio
  3. Follow the example-specific README for model setup and configuration

Basic integration

The LEAP SDK makes it easy to integrate LFM models into your Android app. Here’s a basic example:
import ai.liquid.leap.LeapSDK

val sdk = LeapSDK.getInstance(context)
sdk.loadModel("lfm2-1.2b-instruct")

sdk.generateStream("Tell me a story") { token ->
    // Handle streaming tokens
    runOnUiThread {
        textView.append(token)
    }
}

Resources

Next steps

Build docs developers (and LLMs) love