Skip to content

Latest commit

 

History

History
191 lines (125 loc) · 4.54 KB

File metadata and controls

191 lines (125 loc) · 4.54 KB

EdgeAI SDK

Android SDK for on-device AI inference via BreezeApp Engine.

JitPack


👥 Choose Your Path

📱 I'm a Client App Developer

You want to: Integrate EdgeAI SDK into your Android app

Start here:

  1. Quick Start - 3 steps to get started
  2. Installation - Add to your project
  3. API Reference - Available APIs
  4. Complete Documentation - All guides

All documentation available in docs/client-developers/


🔧 I'm an SDK Maintainer

You want to: Contribute to EdgeAI SDK or understand its internals

Start here:

  1. SDK Architecture - Internal design
  2. Contributing - Development guide
  3. Complete Documentation - All guides

All documentation available in docs/maintainers/


Overview

EdgeAI SDK provides a type-safe Kotlin API for integrating on-device AI into Android apps.

Architecture: Your App → EdgeAI SDK → AIDL IPC → BreezeApp Engine → AI Models

Capabilities:

  • LLM - Text generation (chat completions)
  • ASR - Speech-to-text transcription
  • TTS - Text-to-speech synthesis
  • Guardrail - Content safety checking

Key Features:

  • Simple API (3 lines to get started)
  • Streaming support (real-time responses)
  • Type-safe Kotlin (coroutines + Flow)
  • Single dependency (JitPack)

Installation

Prerequisites

  • BreezeApp Engine installed on device
  • Android API 26+ (Android 8.0 Oreo)

Add Dependency

build.gradle.kts (app level):

repositories {
    maven { url = uri("https://jitpack.io") }
}

dependencies {
    implementation("com.github.mtkresearch:BreezeApp-engine:EdgeAI-vX.X.X")
}

For local development:

dependencies {
    implementation(project(":EdgeAI"))
}

Quick Start

1. Initialize

import com.mtkresearch.breezeapp.edgeai.*

lifecycleScope.launch {
    EdgeAI.initializeAndWait(context, timeoutMs = 10000)
}

2. Use API

val request = chatRequest(prompt = "Explain quantum computing")

EdgeAI.chat(request).collect { response ->
    println(response.choices.firstOrNull()?.message?.content)
}

3. Clean Up

override fun onDestroy() {
    super.onDestroy()
    EdgeAI.shutdown()
}

See: EdgeAIUsageExample.kt for complete examples


API Reference

Available APIs

API Method Description Status
Chat chat(ChatRequest) LLM text generation ✅ Stable
ASR asr(ASRRequest) Speech-to-text ✅ Stable
TTS tts(TTSRequest) Text-to-speech ✅ Stable
Guardrail guardrail(GuardrailRequest) Content safety ✅ Stable

Usage Examples

See unit tests for complete examples:

API Documentation

Detailed API docs: docs/client-developers/api-reference.md

  • Request/response models
  • All parameters
  • Return types

SDK Architecture

For SDK Maintainers

Architecture: Standard API → AIDL → Service (2-layer)

See: docs/maintainers/architecture.md for details

Package structure: See source code for implementation details


Contributing

Development Setup

  1. Clone repository
  2. Open in Android Studio
  3. Build: ./gradlew :EdgeAI:build

See: docs/maintainers/contributing.md for complete contribution guidelines


Testing

Run Tests

# Unit tests
./gradlew :EdgeAI:test

# Integration tests (requires BreezeApp Engine on device)
./gradlew :EdgeAI:connectedAndroidTest

Example Code

Unit tests serve as usage examples:

See: docs/maintainers/testing.md for complete testing guide