Skip to content

Commit bababba

Browse files
Merge main into siddhesh/lora-demo
Resolve conflicts: - Package.swift: keep main's split ONNX Runtime xcframeworks (iOS + macOS) - project.pbxproj: keep both RunAnywhereRAG and RunAnywhereWhisperKit dependencies Co-authored-by: Cursor <cursoragent@cursor.com>
2 parents b83a6ac + 4647177 commit bababba

201 files changed

Lines changed: 22108 additions & 272 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,3 +391,4 @@ sdk/runanywhere-react-native/packages/rag/ios/.testlocal
391391
# Node
392392
node_modules/
393393
/tools/
394+
*.trace

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
# See https://pre-commit.com for more information
33

44
repos:
5+
# Secret scanning (blocks commits containing API keys, tokens, URLs)
6+
- repo: https://github.com/gitleaks/gitleaks
7+
rev: v8.30.0
8+
hooks:
9+
- id: gitleaks
10+
511
# General hooks
612
- repo: https://github.com/pre-commit/pre-commit-hooks
713
rev: v4.5.0
@@ -73,6 +79,7 @@ default_language_version:
7379
# Skip these hooks during CI (they run in dedicated CI jobs)
7480
ci:
7581
skip:
82+
- gitleaks
7683
- android-sdk-lint
7784
- android-app-lint
7885
- ios-sdk-swiftlint-fix

Package.resolved

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ import Foundation
3737
// ./scripts/build-swift.sh --set-remote (sets useLocalBinaries = false)
3838
//
3939
// =============================================================================
40-
let useLocalBinaries = true // Toggle: true for local dev, false for release
40+
let useLocalBinaries = false // Toggle: true for local dev, false for release
4141

4242
// Version for remote XCFrameworks (used when testLocal = false)
4343
// Updated automatically by CI/CD during releases
44-
let sdkVersion = "0.19.1"
44+
let sdkVersion = "0.19.6"
4545

4646
// RAG binary is only available in local dev mode until the release artifact is published.
4747
// In remote mode, the RAG xcframework zip + checksum don't exist yet, so including the
@@ -80,6 +80,13 @@ let package = Package(
8080
targets: ["LlamaCPPRuntime"]
8181
),
8282

83+
// =================================================================
84+
// WhisperKit Backend - adds STT via Apple Neural Engine
85+
// =================================================================
86+
.library(
87+
name: "RunAnywhereWhisperKit",
88+
targets: ["WhisperKitRuntime"]
89+
),
8390
] + ragProducts(),
8491
dependencies: [
8592
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
@@ -91,6 +98,8 @@ let package = Package(
9198
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.40.0"),
9299
// ml-stable-diffusion for CoreML-based image generation
93100
.package(url: "https://github.com/apple/ml-stable-diffusion.git", from: "1.1.0"),
101+
// WhisperKit for Neural Engine STT
102+
.package(url: "https://github.com/argmaxinc/WhisperKit.git", from: "0.9.0"),
94103
],
95104
targets: [
96105
// =================================================================
@@ -118,7 +127,11 @@ let package = Package(
118127
// =================================================================
119128
.target(
120129
name: "ONNXBackend",
121-
dependencies: ["RABackendONNXBinary"],
130+
dependencies: [
131+
"RABackendONNXBinary",
132+
.target(name: "ONNXRuntimeiOSBinary", condition: .when(platforms: [.iOS])),
133+
.target(name: "ONNXRuntimemacOSBinary", condition: .when(platforms: [.macOS])),
134+
],
122135
path: "sdk/runanywhere-swift/Sources/ONNXRuntime/include",
123136
publicHeadersPath: "."
124137
),
@@ -159,7 +172,8 @@ let package = Package(
159172
"RunAnywhere",
160173
"ONNXBackend",
161174
"RABackendONNXBinary",
162-
"ONNXRuntimeBinary",
175+
.target(name: "ONNXRuntimeiOSBinary", condition: .when(platforms: [.iOS])),
176+
.target(name: "ONNXRuntimemacOSBinary", condition: .when(platforms: [.macOS])),
163177
],
164178
path: "sdk/runanywhere-swift/Sources/ONNXRuntime",
165179
exclude: ["include"],
@@ -192,6 +206,22 @@ let package = Package(
192206
]
193207
),
194208

209+
// =================================================================
210+
// WhisperKit Runtime Backend (Apple Neural Engine STT)
211+
// =================================================================
212+
.target(
213+
name: "WhisperKitRuntime",
214+
dependencies: [
215+
"RunAnywhere",
216+
.product(name: "WhisperKit", package: "whisperkit"),
217+
],
218+
path: "sdk/runanywhere-swift/Sources/WhisperKitRuntime",
219+
linkerSettings: [
220+
.linkedFramework("CoreML"),
221+
.linkedFramework("Accelerate"),
222+
]
223+
),
224+
195225
// =================================================================
196226
// RunAnywhere unit tests (e.g. AudioCaptureManager – Issue #198)
197227
// =================================================================
@@ -290,14 +320,19 @@ func binaryTargets() -> [Target] {
290320
),
291321
]
292322

293-
// Local combined ONNX Runtime xcframework (iOS + macOS)
294-
// Created by: cd sdk/runanywhere-swift && ./scripts/create-onnxruntime-xcframework.sh
295-
targets.append(
323+
// ONNX Runtime xcframeworks - split by platform
324+
// iOS: static library format (not embedded in app bundle)
325+
// macOS: dynamic framework format (embedded in app bundle)
326+
targets.append(contentsOf: [
296327
.binaryTarget(
297-
name: "ONNXRuntimeBinary",
298-
path: "sdk/runanywhere-swift/Binaries/onnxruntime.xcframework"
299-
)
300-
)
328+
name: "ONNXRuntimeiOSBinary",
329+
path: "sdk/runanywhere-swift/Binaries/onnxruntime-ios.xcframework"
330+
),
331+
.binaryTarget(
332+
name: "ONNXRuntimemacOSBinary",
333+
path: "sdk/runanywhere-swift/Binaries/onnxruntime-macos.xcframework"
334+
),
335+
])
301336

302337
return targets
303338
} else {
@@ -310,22 +345,27 @@ func binaryTargets() -> [Target] {
310345
.binaryTarget(
311346
name: "RACommonsBinary",
312347
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/RACommons-v\(sdkVersion).zip",
313-
checksum: "f6bc152b1689d7549d6a7b5e692f6babb0efc44fe334c0e60acfc0c12d848c44"
348+
checksum: "40ea84cf054f59fbc65e87d92550d4acb2bcbf433041438822c6b30985e3db24"
314349
),
315350
.binaryTarget(
316351
name: "RABackendLlamaCPPBinary",
317352
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/RABackendLLAMACPP-v\(sdkVersion).zip",
318-
checksum: "ba150fd924f71c2137d6cad0a294c3f9c2da5bc748b547cced87bc0910a9b327"
353+
checksum: "314dddb242caf3d2d0b19c0f919c35187023c6c66cc861de741d071faddbf58b"
319354
),
320355
.binaryTarget(
321356
name: "RABackendONNXBinary",
322357
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/RABackendONNX-v\(sdkVersion).zip",
323-
checksum: "00b28c0542ab25585c534b4e33ddacd4a1d24447aa8c2178949aad89eb56cb1f"
358+
checksum: "809e2510da49f71f6d019e77bcc0a7e12e967f3b739ba0b9eea7adb77936edc0"
359+
),
360+
.binaryTarget(
361+
name: "ONNXRuntimeiOSBinary",
362+
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/onnxruntime-ios-v\(sdkVersion).zip",
363+
checksum: "310022d76a16b2d2d106577a1aa84a9e608c721bb6221c4ba47bf962a88bd9fd"
324364
),
325365
.binaryTarget(
326-
name: "ONNXRuntimeBinary",
327-
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/onnxruntime-v\(sdkVersion).zip",
328-
checksum: "e0180262bd1b10fcda95aaf9aac595af5e6819bd454312b6fc8ffc3828db239f"
366+
name: "ONNXRuntimemacOSBinary",
367+
url: "https://github.com/RunanywhereAI/runanywhere-sdks/releases/download/v\(sdkVersion)/onnxruntime-macos-v\(sdkVersion).zip",
368+
checksum: "f73db9dc09012325b35fd3da74de794a75f4e9971d9b923af0805d6ab1dfc243"
329369
),
330370
]
331371

Playground/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,34 @@ Interactive demo projects showcasing what you can build with RunAnywhere.
44

55
| Project | Description | Platform |
66
|---------|-------------|----------|
7+
| [YapRun](YapRun/) | On-device voice dictation — custom keyboard, multiple Whisper backends, Live Activity, offline-ready — [Website](https://runanywhere.ai/yaprun) · [TestFlight](https://testflight.apple.com/join/6N7nBeG8) | iOS & macOS (Swift/SwiftUI) |
78
| [swift-starter-app](swift-starter-app/) | Privacy-first AI demo — LLM Chat, Speech-to-Text, Text-to-Speech, and Voice Pipeline with VAD | iOS (Swift/SwiftUI) |
89
| [on-device-browser-agent](on-device-browser-agent/) | On-device AI browser automation using WebLLM — no cloud, no API keys, fully private | Chrome Extension (TypeScript/React) |
910
| [android-use-agent](android-use-agent/) | Fully on-device autonomous Android agent — navigates phone UI via accessibility + on-device LLM (Qwen3-4B). See [benchmarks](android-use-agent/ASSESSMENT.md) | Android (Kotlin/Jetpack Compose) |
1011
| [linux-voice-assistant](linux-voice-assistant/) | Fully on-device voice assistant — Wake Word, VAD, STT, LLM, and TTS with zero cloud dependency | Linux (C++/ALSA) |
1112
| [openclaw-hybrid-assistant](openclaw-hybrid-assistant/) | Hybrid voice assistant — on-device Wake Word, VAD, STT, and TTS with cloud LLM via OpenClaw WebSocket | Linux (C++/ALSA) |
1213

14+
## YapRun
15+
16+
On-device voice dictation for iOS and macOS. All speech recognition runs locally — your voice never leaves your device.
17+
18+
<p align="center">
19+
<img src="YapRun/screenshots/01_welcome.png" width="160" />
20+
<img src="YapRun/screenshots/03_home.png" width="160" />
21+
<img src="YapRun/screenshots/04_keyboard.png" width="160" />
22+
<img src="YapRun/screenshots/05_playground.png" width="160" />
23+
<img src="YapRun/screenshots/06_notepad.png" width="160" />
24+
</p>
25+
26+
- **Custom Keyboard** — Tap "Yap" from any text field in any app to dictate
27+
- **Multiple Whisper Backends** — WhisperKit (Neural Engine) and ONNX (CPU) with one-tap model switching
28+
- **Live Activity** — Real-time transcription status on the Lock Screen and Dynamic Island
29+
- **ASR Playground** — Record and transcribe in-app to test speed and accuracy
30+
- **macOS Agent** — Menu bar icon, global hotkey dictation, floating flow bar
31+
- **Offline-Ready** — Download once, run without a network connection
32+
33+
**[runanywhere.ai/yaprun](https://runanywhere.ai/yaprun)** | [TestFlight Beta](https://testflight.apple.com/join/6N7nBeG8) | Free on the App Store — iOS 16.0+ / macOS 14.0+, Xcode 15.0+
34+
1335
## linux-voice-assistant
1436

1537
A complete on-device voice AI pipeline for Linux (Raspberry Pi 5, x86_64, ARM64). All inference runs locally — no cloud, no API keys:

Playground/YapRun/README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# YapRun
2+
3+
On-device voice dictation for iOS and macOS, powered by the RunAnywhere SDK. All speech recognition runs locally — your voice never leaves your device.
4+
5+
**[runanywhere.ai/yaprun](https://runanywhere.ai/yaprun)** | [TestFlight Beta](https://testflight.apple.com/join/6N7nBeG8) | Free on the App Store — no account required
6+
7+
<p align="center">
8+
<img src="screenshots/01_welcome.png" width="200" />
9+
<img src="screenshots/03_home.png" width="200" />
10+
<img src="screenshots/04_keyboard.png" width="200" />
11+
<img src="screenshots/05_playground.png" width="200" />
12+
</p>
13+
14+
## Features
15+
16+
### iOS
17+
18+
- **Custom Keyboard Extension** — Tap "Yap" from any text field in any app to dictate with on-device Whisper
19+
- **Live Activity** — Real-time transcription status on the Lock Screen and Dynamic Island
20+
- **Model Hub** — Download and switch between multiple ASR models (WhisperKit Neural Engine, ONNX CPU)
21+
- **ASR Playground** — Record and transcribe in-app to test speed and accuracy
22+
- **Notepad** — Built-in scratchpad for quick voice drafts
23+
- **Guided Onboarding** — Step-by-step setup for microphone, keyboard, and model download
24+
- **Deep Links**`yaprun://startFlow`, `yaprun://playground`, `yaprun://kill` for keyboard ↔ app communication
25+
26+
### macOS
27+
28+
- **Menu Bar Agent** — Runs as a background agent with a persistent menu bar icon
29+
- **Global Hotkey** — System-wide keyboard shortcut to dictate and insert text at the cursor
30+
- **Flow Bar** — Floating overlay showing dictation status
31+
- **Hub Window** — Model management, playground, notepad, and settings in a single window
32+
33+
### Shared (iOS + macOS)
34+
35+
- **Multiple ASR Backends** — WhisperKit (Apple Neural Engine via Core ML) and ONNX (CPU via sherpa-onnx)
36+
- **Model Registry** — Curated models with consumer-friendly names: Fast (70 MB), Accurate (134 MB), Compact CPU (118 MB), Whisper CPU (75 MB)
37+
- **Offline-Ready** — Download once during setup, run without a network connection
38+
- **Dictation History** — Recent transcriptions stored locally with timestamps
39+
40+
## Architecture
41+
42+
```
43+
YapRun/
44+
├── YapRunApp.swift # App entry point (iOS WindowGroup + macOS agent)
45+
├── ContentView.swift # iOS home screen (status cards, model hub, history)
46+
├── Core/
47+
│ ├── AppColors.swift # Design tokens (dark theme, orange CTA)
48+
│ ├── AppTypes.swift # Shared enums and type aliases
49+
│ ├── ModelRegistry.swift # ASR model definitions and SDK registration
50+
│ ├── ClipboardService.swift # Cross-platform pasteboard access
51+
│ └── DictationHistory.swift # Local history persistence
52+
├── Features/
53+
│ ├── Home/ # Model cards, download progress, home VM
54+
│ ├── Playground/ # Record → transcribe test bench
55+
│ ├── Notepad/ # Voice-first text editor
56+
│ ├── Onboarding/ # Multi-step guided setup (mic, keyboard, model)
57+
│ └── VoiceKeyboard/ # Flow session manager, Live Activity, deep links
58+
├── Shared/
59+
│ ├── SharedConstants.swift # App group keys, Darwin notification names, URL scheme
60+
│ └── SharedDataBridge.swift # App ↔ keyboard extension shared state via UserDefaults suite
61+
├── macOS/
62+
│ ├── MacAppDelegate.swift # Agent lifecycle, hub window, flow bar
63+
│ ├── Features/ # macOS-specific views (hub, playground, settings, onboarding)
64+
│ └── Services/ # Hotkey, text insertion, audio feedback, permissions
65+
├── YapRunKeyboard/ # iOS keyboard extension (separate target)
66+
└── YapRunActivity/ # Live Activity widget (separate target)
67+
```
68+
69+
### Key Patterns
70+
71+
- **Flow Session (WisprFlow pattern)**: The keyboard extension triggers the main app via deep link (`yaprun://startFlow`). The app starts `AVAudioEngine` while foregrounded, keeps alive via Live Activity, then receives Darwin notifications (`startListening` / `stopListening`) from the keyboard to gate audio buffering and transcription.
72+
- **Dual Runtime**: WhisperKit runs on Apple Neural Engine (Core ML) for speed; ONNX via sherpa-onnx runs on CPU as a fallback.
73+
- **Shared Data Bridge**: App and keyboard extension communicate through a shared `UserDefaults` suite and Darwin notifications — no network calls.
74+
75+
## Requirements
76+
77+
| Platform | Minimum | Recommended |
78+
|----------|---------|-------------|
79+
| iOS | 16.0 | 17.0+ |
80+
| macOS | 14.0 | 15.0+ |
81+
| Xcode | 15.0 | 16.0+ |
82+
83+
## Getting Started
84+
85+
1. Open the project in Xcode:
86+
87+
```bash
88+
cd Playground/YapRun
89+
open YapRun.xcodeproj
90+
```
91+
92+
2. Select the **YapRun** scheme and your target device/simulator.
93+
94+
3. Build and run. The onboarding flow will guide you through microphone permission, keyboard setup, and model download.
95+
96+
> **Keyboard Extension**: To use the custom keyboard on iOS, go to **Settings → General → Keyboard → Keyboards → Add New Keyboard** and select **YapRun**. Enable **Full Access** when prompted.
97+
98+
## Models
99+
100+
All models are downloaded from GitHub Releases and cached on-device:
101+
102+
| Model | Backend | Size | Best For |
103+
|-------|---------|------|----------|
104+
| Fast (whisperkit-tiny.en) | WhisperKit / Neural Engine | 70 MB | Quick notes, low battery |
105+
| Accurate (whisperkit-base.en) | WhisperKit / Neural Engine | 134 MB | Longer dictation, higher accuracy |
106+
| Compact CPU (moonshine-tiny-en-int8) | ONNX / sherpa-onnx | 118 MB | When Neural Engine is busy |
107+
| Whisper CPU (whisper-tiny.en) | ONNX / sherpa-onnx | 75 MB | Maximum device compatibility |

0 commit comments

Comments
 (0)