Back to Runanywhere Sdks

RunAnywhereONNX

sdk/runanywhere-swift/Sources/ONNXRuntime/README.md

0.20.121.4 KB
Original Source

RunAnywhereONNX

ONNX/Sherpa backend for the RunAnywhere Swift SDK — on-device STT, TTS, and VAD on Apple platforms.


Installation

Add the Swift package and include the RunAnywhereONNX product (pin 0.20.12):

swift
dependencies: [
    .package(url: "https://github.com/RunanywhereAI/runanywhere-sdks", exact: "0.20.12"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "RunAnywhere", package: "runanywhere-sdks"),
            .product(name: "RunAnywhereONNX", package: "runanywhere-sdks"),
        ]
    )
]

See the Swift SDK README for Xcode setup and API keys.


Usage

swift
import RunAnywhere
import ONNXRuntime

@MainActor
func bootstrap() throws {
    ONNX.register()
    try RunAnywhere.initialize(
        apiKey: "<YOUR_API_KEY>",
        baseURL: "https://api.runanywhere.ai",
        environment: .production
    )
}

// Load models and transcribe via RunAnywhere core APIs
let output = try await RunAnywhere.transcribe(audio: audioData)
print(output.text)

See the Swift SDK README for TTS, VAD, and voice-agent flows.


Requirements

  • iOS 17.5+ / macOS 14.5+

Support


License

RunAnywhere License. See LICENSE.