litertlm 0.0.1
litertlm: ^0.0.1 copied to clipboard
Unified Flutter package for LiteRT-LM on every platform.
flutter_litertlm #
Unified Flutter package for LiteRT-LM on every platform.
Project Strategy #
This project is intended to be a lightweight bridge to prebuilt LiteRT-LM packages. It uses the official LiteRT-LM package on each platform if it exists to maximize platform-level optimizations. This package therefore provides official, platform-optimized binaries while exposing a unified Dart interface across all supported platforms.
Platform Support #
| Platform | Runtime artifact | Integration | Limitations |
|---|---|---|---|
| iOS | Official Swift package | C FFI | N/A |
| Android | Official Gradle package | JNI FFI | N/A |
| macOS | Official Swift package | C FFI | N/A |
| Windows | Prebuilt C library | C FFI | x86_64 only |
| Linux | Prebuilt C library | C FFI | x86_64 only |
| Web | Official npm package | JS interop | N/A |
Code Layout #
lib/litertlm.dart: Public API entrylib/contracts/*.dart: Public contractslib/native/runtime.dart: Unified runtime interface and platform selectorlib/native/ffi/c.dart: C FFI runtimelib/native/ffi/jni.dart: JNI FFI runtimelib/native/js_interop/runtime.dart: JS interop runtimesrc/native_ffi_support.c: Native C FFI support for allocation and callback bridging
Runtime Reliability #
This package works as a lightweight bridge to the official LiteRT-LM prebuilt runtime libraries. Native runtime failures may crash or emit process-level signals that Dart cannot catch. This package aims to expose the runtime interface as close to the original as possible, it will not try to fix/repair/fallback for known unsupported cases.