Private C++ core library providing unified ML inference across ONNX Runtime, LlamaCPP, and CoreML backends with multi-modality support.
RunAnywhere Core is the foundational C/C++ library that powers the RunAnywhere SDK family. It provides a unified, cross-platform API for running machine learning models on-device across multiple inference backends.
- π Multi-Backend Support: ONNX Runtime, LlamaCPP, CoreML, TensorFlow Lite, ExecuTorch
- π€ Multi-Modality: Speech-to-Text (ASR), Text-to-Speech (TTS), Text Generation (LLM)
- π± Cross-Platform: iOS, Android, macOS, Linux with consistent C API
- β‘ High Performance: Native C++ implementation with platform-specific optimizations
- π Clean Integration: Simple C API for easy binding to Swift, Kotlin, and other languages
- π Built-in Telemetry: Performance monitoring and device capability detection
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Platform SDKs (Swift, Kotlin) β
β (runanywhere-swift, runanywhere-kotlin, ...) β
βββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β C API
βββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββ
β RunAnywhere Core (C++) β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Common Infrastructure β β
β β β’ Telemetry β’ Device Info β’ Utilities β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ β
β β ONNX β LlamaCPP β CoreML β TFLite β β
β β Runtime β β β β β
β β Backend β Backend β Backend β Backend β β
β ββββββ¬ββββββ΄βββββ¬ββββββ΄βββββ¬ββββββ΄βββββ¬ββββββ β
βββββββββΌβββββββββββΌβββββββββββΌβββββββββββΌβββββββββββββ
β β β β
ββββββ΄ββββ βββββ΄βββββ βββββ΄βββββ ββββ΄βββββββ
β ONNX β β llama β β Core β β TFLite β
βRuntime β β .cpp β β ML β β β
ββββββββββ ββββββββββ ββββββββββ βββββββββββ
- CMake 3.22 or later
- C++17 compatible compiler
- Platform-specific tools:
- iOS/macOS: Xcode 14+
- Android: Android NDK r25+
- Linux: GCC 9+ or Clang 10+
# Download ONNX Runtime dependency (iOS only, first time)
cd /path/to/runanywhere-core
./scripts/download-onnx-ios.sh
# Build for iOS (creates XCFramework)
./scripts/build-ios-onnx.sh
# The built XCFramework will be in dist/RunAnywhereONNX.xcframeworkCopy the built XCFramework to your Swift/Kotlin SDK:
# For Swift SDK
cp -r dist/RunAnywhereONNX.xcframework \
/path/to/runanywhere-swift/XCFrameworks/See BUILD.md for detailed build instructions.
- Quick Start Guide - Get running in 5 minutes
- ONNX Runtime Setup - Detailed ONNX integration guide
- Modality Support - Multi-modality API documentation
- Implementation Status - Current implementation progress
- Scripts Documentation - Build scripts reference
- Architecture - System design and architecture
| Script | Purpose |
|---|---|
scripts/download-onnx-ios.sh |
Download ONNX Runtime iOS dependency |
scripts/build-ios-onnx.sh |
Build ONNX Runtime XCFramework for iOS |
See scripts/README.md for detailed documentation.
runanywhere-core/
βββ cmake/ # CMake modules for dependency management
βββ docs/ # Documentation
βββ include/ # Public C API headers
βββ plans/ # Architecture and planning docs
βββ scripts/ # Build automation scripts
βββ src/
β βββ backends/ # Backend implementations
β β βββ onnx/ # ONNX Runtime backend
β β βββ backend/ # Core C++ implementation
β β βββ bridge/ # Platform bridges (iOS/Android)
β βββ common/ # Shared utilities
βββ third_party/ # External dependencies (downloaded)
β βββ json/ # nlohmann/json (submodule)
β βββ onnxruntime-ios/ # ONNX Runtime (downloaded via script)
βββ BUILD.md # Build instructions
βββ README.md # This file
| Backend | Status | Platforms | Modalities |
|---|---|---|---|
| ONNX Runtime | β Implemented | iOS, Android, macOS, Linux | ASR, TTS, LLM |
| LlamaCPP | π§ Planned | iOS, Android, macOS, Linux | LLM |
| CoreML | π§ Planned | iOS, macOS | ASR, TTS, LLM |
| TensorFlow Lite | π§ Planned | iOS, Android, Linux | ASR, Vision |
| ExecuTorch | π§ Planned | iOS, Android | LLM |
- Speech-to-Text (ASR): Convert spoken audio to text
- Text-to-Speech (TTS): Generate natural speech from text
- Text Generation (LLM): Large language model inference
# macOS/iOS development
brew install cmake ninja
# Install Xcode Command Line Tools
xcode-select --install./scripts/download-onnx-ios.sh # First time only
./scripts/build-ios-onnx.sh# Coming soonmkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(sysctl -n hw.ncpu)mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)# Build with tests enabled
cmake .. -DBUILD_TESTS=ON
make
ctest --output-on-failureThis is private, proprietary software. All rights reserved.
See LICENSE for details.
This is a private repository. For RunAnywhere team members:
- Create a feature branch from
develop - Follow the code style (C++17, Google C++ Style Guide)
- Write tests for new functionality
- Submit a Pull Request
See CONTRIBUTING.md for detailed guidelines.
For issues and questions:
- Internal Team: Slack #runanywhere-core channel
- Bug Reports: GitHub Issues (private repo)
- Documentation: See
docs/directory
- runanywhere-swift - Swift SDK for iOS/macOS
- runanywhere-kotlin - Kotlin SDK for Android
- runanywhere-examples - Example applications
Current implementation status:
- β ONNX Runtime backend (iOS)
- β Multi-modality support (ASR, TTS, LLM)
- β iOS XCFramework build pipeline
- β Swift SDK integration
- π§ Android support
- π§ Additional backends
See IMPLEMENTATION_STATUS.md for detailed progress.
Made with β€οΈ by the RunAnywhere Team