Skip to main content

Installation

Nexa AI Android SDK is available from Maven Central, the latest version is 0.0.10. You can also find it from Maven Repository which updates a bit slower than Maven Central.

Add Dependency

Add the following to your app/build.gradle.kts to import NexaSDK:
dependencies {
    implementation("ai.nexa:core:0.0.10")
}

Run Your First Model

1

Initialize SDK

Initialize the NexaSDK in your Android application:
NexaSdk.getInstance().init(this)
2

Download and Load Model

Create a VLM wrapper and load a model for NPU inference. You can download OmniNeural-4B model from huggingface and place it in your app’s assets folder.
VlmWrapper.builder()
    .vlmCreateInput(
        VlmCreateInput(
            model_name = "omni-neural",
            model_path = <your-model-folder-path>,
            config = ModelConfig(
                max_tokens = 2048,
                enable_thinking = false
            ),
            plugin_id = "npu"
        )
    )
    .build()
    .onSuccess { vlmWrapper = it }
Your model folder path should be like /data/data/com.nexa.demo/files/models/omni-neural-4b if you put it in your app’s asset folder.
3

Generate Content

Use the loaded model to generate responses:
vlmWrapper.generateStreamFlow("Who are you?", GenerationConfig()).collect { result ->
    println(result)
}

Supported Models

We’ve curated collections of compatible models for you to explore:

NPU Models

Optimized models for Qualcomm NPU

GGUF Models

Any GGUF format LLM and VLM models

Device Compatibility

  • Qualcomm Snapdragon 8 Gen 4
  • Qualcomm Adreno GPU
  • ARM64-v8a

Next Steps

API Reference

Explore detailed documentation for all model types and learn their usage.