Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ artifacts/faer_int8_*
.venv/
*.env
.env
*.log

# 빌드 산출물
build/
Expand All @@ -37,6 +38,7 @@ rust/tests/
# 대용량 모델 파일 (사용자가 직접 다운로드)
assets/*
!assets/readme-sources/
/models/
*.onnx
*.bin

Expand Down Expand Up @@ -72,5 +74,6 @@ example/assets/evalsets/

# Example evaluation/performance runners (local only)
example/lib/*_runner.dart
example/lib/*_smoke.dart
example/lib/profiling/
example/test/profiling/
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.19.1
* **Packaging**:
- Fixed the publish archive so `lib/models/*.dart` is included again.

## 0.19.0
* **Compatibility**:
- Replaced the unmaintained `onnxruntime` package dependency with `flutter_onnxruntime: ^1.8.0`.
- Updated ONNX session, tensor, output, and cleanup handling to the `flutter_onnxruntime` API while keeping the existing `EmbeddingService` public API.
- Raised the documented iOS/macOS runtime requirements to match `flutter_onnxruntime`: iOS 16.0+ and macOS 14.0+.
* **Validation**:
- Validated the runtime swap with local init/embed/repeat/dispose/reinit smoke coverage.

## 0.18.6
* **PDF extraction UX**:
- Added OCR-needed classification helpers for scanned/image-only PDF extraction errors.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ Data never leaves the user's device. Perfect for privacy-focused apps (journals,

| Platform | Minimum Version |
|:---------|:----------------|
| **iOS** | 13.0+ |
| **iOS** | 16.0+ |
| **Android** | API 21+ (Android 5.0 Lollipop) |
| **macOS** | 10.15+ (Catalina) |
| **macOS** | 14.0+ |

> **ONNX Runtime** is bundled automatically via the [`onnxruntime`](https://pub.dev/packages/onnxruntime) plugin. No additional native setup required.
> ONNX Runtime is provided through [`flutter_onnxruntime`](https://pub.dev/packages/flutter_onnxruntime). CocoaPods iOS builds require static framework linkage (`use_frameworks! :linkage => :static`), and Android release builds should keep ONNX Runtime classes in ProGuard/R8 rules.

---

Expand All @@ -102,7 +102,7 @@ Data never leaves the user's device. Perfect for privacy-focused apps (journals,

```yaml
dependencies:
mobile_rag_engine:
mobile_rag_engine: ^0.19.0
```

### 2. Download Model Files
Expand Down
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

analyzer:
exclude:
- docs/promo/**

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
Expand Down
13 changes: 8 additions & 5 deletions docs/guides/model_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,15 @@ python -m onnxruntime.quantization.quantize \

## ONNX Runtime Notes

This package uses the [`onnxruntime`](https://pub.dev/packages/onnxruntime) Flutter plugin which bundles ONNX Runtime binaries for each platform.
This package uses the [`flutter_onnxruntime`](https://pub.dev/packages/flutter_onnxruntime) Flutter plugin for ONNX Runtime.

**No additional setup required** - the plugin automatically includes:
- iOS: CoreML execution provider (uses Neural Engine on A12+ chips)
- Android: NNAPI execution provider (hardware acceleration)
- macOS: CoreML execution provider
Runtime setup notes:
- iOS apps need minimum deployment target 16.0.
- macOS apps need minimum deployment target 14.0.
- CocoaPods iOS builds require static framework linkage: `use_frameworks! :linkage => :static`.
- Android release builds should keep ONNX Runtime classes in ProGuard/R8 rules.

`mobile_rag_engine` uses the default ONNX Runtime execution path for embedding inference. Do not assume CoreML, NNAPI, or another hardware execution provider is active unless you configure and validate that path in your host app.

### Performance Tips

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Get started with `mobile_rag_engine` in 5 minutes.
## Prerequisites

- Flutter 3.9+
- iOS 13.0+ / Android API 21+ / macOS 10.15+
- iOS 16.0+ / Android API 21+ / macOS 14.0+

---

Expand All @@ -16,7 +16,7 @@ Get started with `mobile_rag_engine` in 5 minutes.
```yaml
# pubspec.yaml
dependencies:
mobile_rag_engine:
mobile_rag_engine: ^0.19.0
```

```bash
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '13.0'
platform :ios, '16.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -28,7 +28,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_frameworks! :linkage => :static

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
Expand Down
30 changes: 15 additions & 15 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ PODS:
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- integration_test (0.0.1):
- flutter_onnxruntime (0.0.1):
- Flutter
- onnxruntime (0.0.1):
- onnxruntime-objc (= 1.24.2)
- integration_test (0.0.1):
- Flutter
- onnxruntime-objc (= 1.15.1)
- onnxruntime-c (1.15.1)
- onnxruntime-objc (1.15.1):
- onnxruntime-objc/Core (= 1.15.1)
- onnxruntime-objc/Core (1.15.1):
- onnxruntime-c (= 1.15.1)
- onnxruntime-c (1.24.2)
- onnxruntime-objc (1.24.2):
- onnxruntime-objc/Core (= 1.24.2)
- onnxruntime-objc/Core (1.24.2):
- onnxruntime-c (= 1.24.2)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand Down Expand Up @@ -82,8 +82,8 @@ PODS:
DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- flutter_onnxruntime (from `.symlinks/plugins/flutter_onnxruntime/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- onnxruntime (from `.symlinks/plugins/onnxruntime/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- rag_engine_flutter (from `.symlinks/plugins/rag_engine_flutter/ios`)
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/darwin`)
Expand All @@ -103,10 +103,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
:path: Flutter
flutter_onnxruntime:
:path: ".symlinks/plugins/flutter_onnxruntime/ios"
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
onnxruntime:
:path: ".symlinks/plugins/onnxruntime/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
rag_engine_flutter:
Expand All @@ -119,17 +119,17 @@ SPEC CHECKSUMS:
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
file_picker: b159e0c068aef54932bb15dc9fd1571818edaf49
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_onnxruntime: ce51ab1eeff3bc7251b14471067a23ccd9aa096b
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
onnxruntime: e9346181d75b8dea8733bdae512a22c298962e00
onnxruntime-c: ebdcfd8650bcbd10121c125262f99dea681b92a3
onnxruntime-objc: ae7acec7a3d03eaf072d340afed7a35635c1c2a6
onnxruntime-c: b58bafbc58707d165404665e46a7467a16e8e0e4
onnxruntime-objc: 99e0fe4b6d606970c6c1350c194c7629ef6e6fc9
path_provider_foundation: 0b743cbb62d8e47eab856f09262bb8c1ddcfe6ba
rag_engine_flutter: f3dbe3eeb8de973a624800ac549837972cded6b2
SDWebImage: e9c98383c7572d713c1a0d7dd2783b10599b9838
sqlite3: a51c07cf16e023d6c48abd5e5791a61a47354921
sqlite3_flutter_libs: f9114e4bbe1f2e03dd543373c53d23245982ca13
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4

PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e
PODFILE CHECKSUM: c0915517eae1a513480956f02c7781054ca94770

COCOAPODS: 1.16.2
42 changes: 21 additions & 21 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
DC72460C826EAFDD93401E06 /* [CP] Embed Pods Frameworks */,
38096AEDBDD0A0C79EEEBE18 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -270,6 +270,23 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
38096AEDBDD0A0C79EEEBE18 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down Expand Up @@ -345,23 +362,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
DC72460C826EAFDD93401E06 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -455,7 +455,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -585,7 +585,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -636,7 +636,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
2 changes: 2 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import FlutterMacOS
import Foundation

import file_picker
import flutter_onnxruntime
import path_provider_foundation
import sqlite3_flutter_libs

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
FlutterOnnxruntimePlugin.register(with: registry.registrar(forPlugin: "FlutterOnnxruntimePlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
}
4 changes: 2 additions & 2 deletions example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.15'
platform :osx, '14.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -27,7 +27,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_frameworks! :linkage => :static

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
Expand Down
24 changes: 17 additions & 7 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
PODS:
- file_picker (0.0.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)
- onnxruntime (0.0.1):
- flutter_onnxruntime (0.0.1):
- FlutterMacOS
- onnxruntime-objc (= 1.24.2)
- FlutterMacOS (1.0.0)
- onnxruntime-c (1.24.2)
- onnxruntime-objc (1.24.2):
- onnxruntime-objc/Core (= 1.24.2)
- onnxruntime-objc/Core (1.24.2):
- onnxruntime-c (= 1.24.2)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand Down Expand Up @@ -37,23 +43,25 @@ PODS:

DEPENDENCIES:
- file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`)
- flutter_onnxruntime (from `Flutter/ephemeral/.symlinks/plugins/flutter_onnxruntime/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- onnxruntime (from `Flutter/ephemeral/.symlinks/plugins/onnxruntime/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- rag_engine_flutter (from `Flutter/ephemeral/.symlinks/plugins/rag_engine_flutter/macos`)
- sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin`)

SPEC REPOS:
trunk:
- onnxruntime-c
- onnxruntime-objc
- sqlite3

EXTERNAL SOURCES:
file_picker:
:path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos
flutter_onnxruntime:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_onnxruntime/macos
FlutterMacOS:
:path: Flutter/ephemeral
onnxruntime:
:path: Flutter/ephemeral/.symlinks/plugins/onnxruntime/macos
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
rag_engine_flutter:
Expand All @@ -63,13 +71,15 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
file_picker: e716a70a9fe5fd9e09ebc922d7541464289443af
flutter_onnxruntime: b195bce8c50601372e976ed9726508b576ebff82
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
onnxruntime: 922a85d3c9ed1b3c2b515ec903fc4d9b8f51d96b
onnxruntime-c: b58bafbc58707d165404665e46a7467a16e8e0e4
onnxruntime-objc: 99e0fe4b6d606970c6c1350c194c7629ef6e6fc9
path_provider_foundation: 0b743cbb62d8e47eab856f09262bb8c1ddcfe6ba
rag_engine_flutter: a9b5919020d1c7fb0e097bfcf6f8abb423e89a22
sqlite3: a51c07cf16e023d6c48abd5e5791a61a47354921
sqlite3_flutter_libs: f9114e4bbe1f2e03dd543373c53d23245982ca13

PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009
PODFILE CHECKSUM: 429f567d9ab401e946f77b31dd025355fafef34e

COCOAPODS: 1.16.2
Loading
Loading