Skip to main content

Installation

The NexaSdk for iOS/macOS is available on GitHub. You can find the latest release there.

Add Dependency

Add the following to your Package.swift file to import NexaSdk:
dependencies: [
    .package(url: "https://github.com/NexaAI/nexasdk-mobile-iOS-framework.git", branch: "main")
]
You can also download the XCFramework directly from the GitHub releases page and drag it into your Xcode project.

Run Your First Model

1

Load Model

Create an ASR instance and load a model:
import Foundation
import NexaSdk

let asr = try Asr(plugin: .ane)
try await asr.load(from: "<path/to/model/dir>")
2

Transcribe Audio File

Use the loaded model to transcribe an audio file:
let asrResponse = try await asr.transcribe(options: .init(audioPath: "<path/to/audio>"))
print(asrResponse.asrResult.transcript)
Load Model from HuggingFaceYou can download models from the HuggingFace using the official Hub library and load them via the load(from:) API. For example:
import Hub
import NexaSdk

let modelDir = try await Hub.snapshot(from: "NexaAI/parakeet-tdt-0.6b-v3-ane") { progress in
  print(progress.fractionCompleted)
}
let asr = try Asr(plugin: .ane)
try await asr.load(from: modelDir)

Supported Models

Explore our curated collections of compatible models:

ANE Models

Optimized models for Apple Neural Engine

GGUF Models

Any GGUF format LLM and VLM models

Device Compatibility

  • Apple Neural Engine
  • arm64

Next Steps

API Reference

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