RunAnywhere Swift SDK

August 25, 2026 · View on GitHub

On-device AI for iOS and macOS — LLM, VLM, speech-to-text, text-to-speech, VAD, embeddings, reranking, RAG, diarization, segmentation, and diffusion, running locally on the user's device.

This repository is the lightweight SwiftPM distribution of the RunAnywhere Swift SDK. It carries the Swift sources and a manifest that pulls checksum-verified native binaries from GitHub Releases — nothing else. Adding it as a dependency does not clone the C++ core, the other four language bindings, or the engine sources.

Generated repository. The canonical source lives in RunanywhereAI/runanywhere-sdks. Open issues and pull requests there. Changes made directly here are overwritten on the next release.

Installation

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/RunanywhereAI/runanywhere-swift.git", from: "0.20.28"),
]

Then depend on the core product plus whichever backends you need:

.target(
    name: "MyApp",
    dependencies: [
        .product(name: "RunAnywhere", package: "runanywhere-swift"),
        .product(name: "RunAnywhereLlamaCPP", package: "runanywhere-swift"),
    ]
)

In Xcode: File → Add Package Dependencies… and paste the URL above.

Products

ProductAddsEngine
RunAnywhereCore SDK — required by every backend
RunAnywhereLlamaCPPLLM text generation, VLMllama.cpp
RunAnywhereONNXEmbeddings, STT, TTS, VAD, CoreML diffusionONNX Runtime + Sherpa-ONNX
RunAnywhereMLXLLM, VLM, embeddings, STT, TTS on Apple SiliconApple MLX
RunAnywhereNeuRTApple Neural Engine LLM, CoreML diffusionNeuRT

Backends are additive: link only what you use and the linker drops the rest. RunAnywhereONNX also bundles the NeuRT/CoreML diffusion engine.

Requirements

  • iOS 17.5+ / macOS 14.5+
  • Swift 6.2+ (Xcode 26+)

Usage

import RunAnywhere
import RunAnywhereLlamaCPP

// Phase 1 — synchronous, registers platform services.
try RunAnywhere.initialize(apiKey: "…", environment: .production)

// Register the backends you linked.
LlamaCPP.register()

// Phase 2 — async: authenticate, register device, discover local models.
try await RunAnywhere.completeServicesInitialization()

// Generate.
let result = try await RunAnywhere.llm.generate(
    prompt: "Explain on-device inference in one sentence."
)
print(result.text)

Streaming, speech, and every other modality follow the same shape — one entry point per feature on the RunAnywhere namespace. See the monorepo documentation for the full API surface.

Native binaries

The manifest declares remote binaryTargets pointing at the release archives attached to the matching runanywhere-sdks tag:

XCFrameworkContents
RACommonsC++ core — all AI business logic behind the rac_* C ABI
RABackendLLAMACPPllama.cpp LLM + VLM engine
RABackendONNXONNX Runtime embeddings (ORT statically linked)
RABackendSherpaSherpa-ONNX STT / TTS / VAD
RABackendNeuRTApple Neural Engine LLM + CoreML diffusion
RABackendMLXApple MLX engine

Each ships iOS device, iOS simulator, and macOS arm64 slices, and each is pinned by SHA-256 in Package.swift. SwiftPM downloads and verifies them on swift package resolve.

Versioning

This repository's tags track the RunAnywhere SDK version exactly. Tag 0.20.28 here consumes the binaries from runanywhere-sdks release v0.20.28.

License

See LICENSE.