Skip to content

Commit e00c21d

Browse files
Merge origin/main into smonga/fix-big-model-loading
Resolves conflicts in sdk/runanywhere-commons/src/backends/llamacpp/llamacpp_backend.cpp by adopting the PR's llama_params_fit-based model loading while adapting to main's current idioms: - Replace LOGI(...)/LOGE(...) macro calls with RAC_LOG_INFO("LLM.LlamaCpp", ...) and RAC_LOG_ERROR("LLM.LlamaCpp", ...), matching main's direct-call style. - Drop the filename heuristic (is_model_size_marker, is_large_model) and the post-load adaptive context ladder (kLargeModelContextSize et al.) since llama_params_fit now queries actual device memory. - Keep main's named-constant refactor (k* constants in anonymous namespace) untouched; only the load_model() body changes. Co-Authored-By: VyasGuru <71374747+VyasGuru@users.noreply.github.com>
2 parents c03a9f6 + b81095e commit e00c21d

194 files changed

Lines changed: 36949 additions & 5531 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.

Package.resolved

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

Package.swift

Lines changed: 2 additions & 6 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.6"
44+
let sdkVersion = "0.19.7"
4545

4646
let package = Package(
4747
name: "runanywhere-sdks",
@@ -86,9 +86,7 @@ let package = Package(
8686
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
8787
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.9.0"),
8888
.package(url: "https://github.com/JohnSundell/Files.git", from: "4.3.0"),
89-
.package(url: "https://github.com/weichsel/ZIPFoundation.git", from: "0.9.0"),
9089
.package(url: "https://github.com/devicekit/DeviceKit.git", from: "5.6.0"),
91-
.package(url: "https://github.com/tsolomko/SWCompression.git", from: "4.8.0"),
9290
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.40.0"),
9391
// ml-stable-diffusion for CoreML-based image generation
9492
.package(url: "https://github.com/apple/ml-stable-diffusion.git", from: "1.1.0"),
@@ -139,9 +137,7 @@ let package = Package(
139137
.product(name: "Crypto", package: "swift-crypto"),
140138
.product(name: "Alamofire", package: "Alamofire"),
141139
.product(name: "Files", package: "Files"),
142-
.product(name: "ZIPFoundation", package: "ZIPFoundation"),
143140
.product(name: "DeviceKit", package: "DeviceKit"),
144-
.product(name: "SWCompression", package: "SWCompression"),
145141
.product(name: "Sentry", package: "sentry-cocoa"),
146142
.product(name: "StableDiffusion", package: "ml-stable-diffusion"),
147143
"CRACommons",

Playground/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ A complete on-device voice AI pipeline for Linux (Raspberry Pi 5, x86_64, ARM64)
4242
- **Large Language Model** — Qwen2.5 0.5B Q4 via llama.cpp (fully local)
4343
- **Text-to-Speech** — Piper Lessac Medium neural TTS
4444

45-
**Requirements:** Linux (ALSA), x86_64 or ARM64, CMake 3.16+, C++17
45+
**Requirements:** Linux (ALSA), x86_64 or ARM64, CMake 3.16+, C++20
4646

4747
## swift-starter-app
4848

@@ -94,4 +94,4 @@ A hybrid voice assistant that combines on-device AI inference with cloud LLM rea
9494
- **Barge-in Support** — Wake word during TTS playback cancels speech and re-listens
9595
- **Waiting Chime** — Earcon feedback while waiting for cloud response
9696

97-
**Requirements:** Linux (ALSA), x86_64 or ARM64, CMake 3.16+, C++17
97+
**Requirements:** Linux (ALSA), x86_64 or ARM64, CMake 3.16+, C++20

Playground/linux-voice-assistant/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ project(linux-voice-assistant
3131
DESCRIPTION "Linux Voice Assistant using RunAnywhere Commons"
3232
)
3333

34-
set(CMAKE_CXX_STANDARD 17)
34+
set(CMAKE_CXX_STANDARD 20)
3535
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3636

3737
# =============================================================================

Playground/linux-voice-assistant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ linux-voice-assistant/
5656

5757
- Linux (Raspberry Pi 5, Ubuntu, Debian, etc.)
5858
- CMake 3.16+
59-
- C++17 compiler (g++ or clang++)
59+
- C++20 compiler (g++ or clang++)
6060
- ALSA development headers: `sudo apt install libasound2-dev`
6161

6262
### Build and Run

Playground/openclaw-hybrid-assistant/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.16)
22
project(openclaw-hybrid-assistant VERSION 0.1.0 LANGUAGES CXX)
33

4-
set(CMAKE_CXX_STANDARD 17)
4+
set(CMAKE_CXX_STANDARD 20)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66

77
# =============================================================================

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ println(response) // "Paris is the capital of France."
140140

141141
```kotlin
142142
dependencies {
143-
implementation("com.runanywhere.sdk:runanywhere-kotlin:0.1.4")
144-
implementation("com.runanywhere.sdk:runanywhere-core-llamacpp:0.1.4")
143+
implementation("com.runanywhere.sdk:runanywhere-kotlin:0.16.1")
144+
implementation("com.runanywhere.sdk:runanywhere-core-llamacpp:0.16.1")
145145
}
146146
```
147147

@@ -161,7 +161,7 @@ LlamaCPP.register();
161161

162162
// 2. Load a model
163163
await RunAnywhere.downloadModel('smollm2-360m');
164-
await RunAnywhere.loadModel(modelPath);
164+
await RunAnywhere.loadModel('smollm2-360m');
165165

166166
// 3. Generate
167167
const response = await RunAnywhere.chat('What is the capital of France?');
@@ -201,8 +201,9 @@ print(response); // "Paris is the capital of France."
201201

202202
```yaml
203203
dependencies:
204-
runanywhere: ^0.15.11
205-
runanywhere_llamacpp: ^0.15.11
204+
runanywhere: ^0.16.0
205+
runanywhere_llamacpp: ^0.16.0 # LLM text generation
206+
# runanywhere_onnx: ^0.16.0 # Add this if you need STT, TTS, or Voice features
206207
```
207208

208209
[Full documentation →](https://docs.runanywhere.ai/flutter/introduction) · [Source code](sdk/runanywhere-flutter/)

examples/flutter/RunAnywhereAI/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ public static void registerWith(@NonNull FlutterEngine flutterEngine) {
2020
} catch (Exception e) {
2121
Log.e(TAG, "Error registering plugin audioplayers_android, xyz.luan.audioplayers.AudioplayersPlugin", e);
2222
}
23+
try {
24+
flutterEngine.getPlugins().add(new io.flutter.plugins.camerax.CameraAndroidCameraxPlugin());
25+
} catch (Exception e) {
26+
Log.e(TAG, "Error registering plugin camera_android_camerax, io.flutter.plugins.camerax.CameraAndroidCameraxPlugin", e);
27+
}
2328
try {
2429
flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.device_info.DeviceInfoPlusPlugin());
2530
} catch (Exception e) {
2631
Log.e(TAG, "Error registering plugin device_info_plus, dev.fluttercommunity.plus.device_info.DeviceInfoPlusPlugin", e);
2732
}
33+
try {
34+
flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin());
35+
} catch (Exception e) {
36+
Log.e(TAG, "Error registering plugin flutter_plugin_android_lifecycle, io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin", e);
37+
}
2838
try {
2939
flutterEngine.getPlugins().add(new com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin());
3040
} catch (Exception e) {
@@ -35,6 +45,11 @@ public static void registerWith(@NonNull FlutterEngine flutterEngine) {
3545
} catch (Exception e) {
3646
Log.e(TAG, "Error registering plugin flutter_tts, com.tundralabs.fluttertts.FlutterTtsPlugin", e);
3747
}
48+
try {
49+
flutterEngine.getPlugins().add(new io.flutter.plugins.imagepicker.ImagePickerPlugin());
50+
} catch (Exception e) {
51+
Log.e(TAG, "Error registering plugin image_picker_android, io.flutter.plugins.imagepicker.ImagePickerPlugin", e);
52+
}
3853
try {
3954
flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin());
4055
} catch (Exception e) {

examples/flutter/RunAnywhereAI/ios/Runner/GeneratedPluginRegistrant.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
@import audioplayers_darwin;
1313
#endif
1414

15+
#if __has_include(<camera_avfoundation/CameraPlugin.h>)
16+
#import <camera_avfoundation/CameraPlugin.h>
17+
#else
18+
@import camera_avfoundation;
19+
#endif
20+
1521
#if __has_include(<device_info_plus/FPPDeviceInfoPlusPlugin.h>)
1622
#import <device_info_plus/FPPDeviceInfoPlusPlugin.h>
1723
#else
@@ -30,6 +36,12 @@
3036
@import flutter_tts;
3137
#endif
3238

39+
#if __has_include(<image_picker_ios/FLTImagePickerPlugin.h>)
40+
#import <image_picker_ios/FLTImagePickerPlugin.h>
41+
#else
42+
@import image_picker_ios;
43+
#endif
44+
3345
#if __has_include(<package_info_plus/FPPPackageInfoPlusPlugin.h>)
3446
#import <package_info_plus/FPPPackageInfoPlusPlugin.h>
3547
#else
@@ -94,9 +106,11 @@ @implementation GeneratedPluginRegistrant
94106

95107
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
96108
[AudioplayersDarwinPlugin registerWithRegistrar:[registry registrarForPlugin:@"AudioplayersDarwinPlugin"]];
109+
[CameraPlugin registerWithRegistrar:[registry registrarForPlugin:@"CameraPlugin"]];
97110
[FPPDeviceInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FPPDeviceInfoPlusPlugin"]];
98111
[FlutterSecureStoragePlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterSecureStoragePlugin"]];
99112
[FlutterTtsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterTtsPlugin"]];
113+
[FLTImagePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTImagePickerPlugin"]];
100114
[FPPPackageInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FPPPackageInfoPlusPlugin"]];
101115
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
102116
[PermissionHandlerPlugin registerWithRegistrar:[registry registrarForPlugin:@"PermissionHandlerPlugin"]];

examples/flutter/RunAnywhereAI/lib/app/runanywhere_ai_app.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:runanywhere_ai/core/utilities/constants.dart';
1212
import 'package:runanywhere_ai/core/utilities/keychain_helper.dart';
1313
import 'package:runanywhere/public/extensions/rag_module.dart';
1414
import 'package:runanywhere_llamacpp/runanywhere_llamacpp.dart';
15+
import 'package:runanywhere_onnx/runanywhere_onnx.dart';
1516

1617
/// RunAnywhereAIApp (mirroring iOS RunAnywhereAIApp.swift)
1718
///
@@ -286,6 +287,14 @@ class _RunAnywhereAIAppState extends State<RunAnywhereAIApp> {
286287
debugPrint('✅ ONNX Embedding models registered');
287288
await Future<void>.delayed(Duration.zero);
288289

290+
// --- ONNX BACKEND (required for embeddings used by RAG) ---
291+
try {
292+
await Onnx.register();
293+
debugPrint('✅ ONNX backend registered (STT + TTS + VAD + Embeddings)');
294+
} catch (e) {
295+
debugPrint('⚠️ ONNX backend not available: $e');
296+
}
297+
289298
// --- RAG BACKEND ---
290299
try {
291300
await RAGModule.register();

0 commit comments

Comments
 (0)