From f37c5ae71c3233bd0809100d8d6744c9488549a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 16:43:21 +0000 Subject: [PATCH] chore(native): sync native release v0.4.1-1 --- CHANGELOG.md | 6 + README.md | 2 +- lib/src/backends/llama_cpp/bindings.dart | 138 +++++++++++------- lib/src/hook/native_release_pins.dart | 2 +- .../llamadart_llama_cpp_flutter/CHANGELOG.md | 4 + .../llamadart_llama_cpp_flutter/README.md | 2 +- .../llamadart_llama_cpp_flutter/Package.swift | 4 +- website/docs/getting-started/installation.md | 6 +- website/docs/platforms/support-matrix.md | 6 +- 9 files changed, 104 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c86439c29..04fdec71e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Unreleased +* Updated the default llama.cpp native runtime pin to + `leehack/llamadart-native@v0.4.1-1`, keeping the `v0.4.1` llama.cpp + ABI/bindings while picking up wrapper-only native fixes. Refreshed + the `llamadart_llama_cpp_flutter` Apple SwiftPM checksum and + aligned current README/website native override docs. + - Extend the GGUF speech-to-text validation pack with four synthetic edge fixtures built in-process, so no extra audio is stored: generated digital silence, plus a truncated RIFF, a stereo 44.1 kHz re-encode and a 33-second diff --git a/README.md b/README.md index dee222a86..3c7e09779 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ Current default runtime pins: | Runtime | Pin | | --- | --- | -| Native llama.cpp / GGUF | `leehack/llamadart-native@v0.4.1` | +| Native llama.cpp / GGUF | `leehack/llamadart-native@v0.4.1-1` | | Native LiteRT-LM / `.litertlm` | `leehack/litert-lm-native@v0.17.0-6` | | Web llama.cpp / GGUF | `leehack/llama-web-bridge-assets@v0.1.44` | | Web LiteRT-LM / `.litertlm` | `@litert-lm/core@0.15.0` | diff --git a/lib/src/backends/llama_cpp/bindings.dart b/lib/src/backends/llama_cpp/bindings.dart index 7635b0b03..31d10f32b 100644 --- a/lib/src/backends/llama_cpp/bindings.dart +++ b/lib/src/backends/llama_cpp/bindings.dart @@ -6298,6 +6298,15 @@ external int llama_dart_tts_api_version(); @ffi.Native)>() external void llama_dart_tts_cancel(ffi.Pointer tts); +@ffi.Native< + ffi.Bool Function(ffi.Pointer, ffi.Bool, ffi.Pointer) +>() +external bool llama_dart_tts_eval_callback( + ffi.Pointer tensor, + bool ask, + ffi.Pointer user_data, +); + @ffi.Native)>() external void llama_dart_tts_free(ffi.Pointer tts); @@ -6403,6 +6412,23 @@ llama_dart_tts_status llama_dart_tts_reset(ffi.Pointer tts) { return llama_dart_tts_status.fromValue(_llama_dart_tts_reset(tts)); } +@ffi.Native< + ffi.Int Function(ffi.Pointer, ffi.Pointer) +>(symbol: 'llama_dart_tts_set_cancel_flag') +external int _llama_dart_tts_set_cancel_flag( + ffi.Pointer tts, + ffi.Pointer flag, +); + +llama_dart_tts_status llama_dart_tts_set_cancel_flag( + ffi.Pointer tts, + ffi.Pointer flag, +) { + return llama_dart_tts_status.fromValue( + _llama_dart_tts_set_cancel_flag(tts, flag), + ); +} + @ffi.Native< ffi.Int Function( ffi.Pointer, @@ -8719,7 +8745,7 @@ external int mtmd_tokenize_from_parts( bool add_special, ); -typedef FILE = __sFILE; +typedef FILE = _IO_FILE; const int GGML_BACKEND_META_MAX_DEVICES = 16; @@ -8858,88 +8884,90 @@ final class UnnamedUnion extends ffi.Union { external ffi.Array val_str; } -typedef __darwin_off_t = __int64_t; -typedef __int64_t = ffi.LongLong; -typedef Dart__int64_t = int; +final class _IO_FILE extends ffi.Struct { + @ffi.Int() + external int _flags; -final class __sFILE extends ffi.Struct { - external ffi.Pointer _p; + external ffi.Pointer _IO_read_ptr; - @ffi.Int() - external int _r; + external ffi.Pointer _IO_read_end; - @ffi.Int() - external int _w; + external ffi.Pointer _IO_read_base; - @ffi.Short() - external int _flags; + external ffi.Pointer _IO_write_base; - @ffi.Short() - external int _file; + external ffi.Pointer _IO_write_ptr; - external __sbuf _bf; + external ffi.Pointer _IO_write_end; - @ffi.Int() - external int _lbfsize; + external ffi.Pointer _IO_buf_base; - external ffi.Pointer _cookie; + external ffi.Pointer _IO_buf_end; - external ffi.Pointer< - ffi.NativeFunction)> - > - _close; + external ffi.Pointer _IO_save_base; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int) - > - > - _read; + external ffi.Pointer _IO_backup_base; - external ffi.Pointer< - ffi.NativeFunction, fpos_t, ffi.Int)> - > - _seek; + external ffi.Pointer _IO_save_end; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int) - > - > - _write; + external ffi.Pointer<_IO_marker> _markers; - external __sbuf _ub; + external ffi.Pointer<_IO_FILE> _chain; - external ffi.Pointer<__sFILEX> _extra; + @ffi.Int() + external int _fileno; @ffi.Int() - external int _ur; + external int _flags2; - @ffi.Array.multi([3]) - external ffi.Array _ubuf; + @__off_t() + external int _old_offset; - @ffi.Array.multi([1]) - external ffi.Array _nbuf; + @ffi.UnsignedShort() + external int _cur_column; - external __sbuf _lb; + @ffi.SignedChar() + external int _vtable_offset; - @ffi.Int() - external int _blksize; + @ffi.Array.multi([1]) + external ffi.Array _shortbuf; + + external ffi.Pointer<_IO_lock_t> _lock; - @fpos_t() + @__off64_t() external int _offset; -} -final class __sFILEX extends ffi.Opaque {} + external ffi.Pointer<_IO_codecvt> _codecvt; + + external ffi.Pointer<_IO_wide_data> _wide_data; + + external ffi.Pointer<_IO_FILE> _freeres_list; + + external ffi.Pointer _freeres_buf; -final class __sbuf extends ffi.Struct { - external ffi.Pointer _base; + @ffi.Size() + external int __pad5; @ffi.Int() - external int _size; + external int _mode; + + @ffi.Array.multi([20]) + external ffi.Array _unused2; } -typedef fpos_t = __darwin_off_t; +final class _IO_codecvt extends ffi.Opaque {} + +typedef _IO_lock_t = ffi.Void; +typedef Dart_IO_lock_t = void; + +final class _IO_marker extends ffi.Opaque {} + +final class _IO_wide_data extends ffi.Opaque {} + +typedef __off64_t = ffi.Long; +typedef Dart__off64_t = int; +typedef __off_t = ffi.Long; +typedef Dart__off_t = int; typedef ggml_abort_callback = ffi.Pointer>; typedef ggml_abort_callbackFunction = diff --git a/lib/src/hook/native_release_pins.dart b/lib/src/hook/native_release_pins.dart index 92ef44d98..38ee2afcf 100644 --- a/lib/src/hook/native_release_pins.dart +++ b/lib/src/hook/native_release_pins.dart @@ -5,7 +5,7 @@ library; /// `leehack/llamadart-native` release tag downloaded for the llama.cpp runtime. -const llamaCppTag = 'v0.4.1'; +const llamaCppTag = 'v0.4.1-1'; /// `leehack/litert-lm-native` release tag downloaded for the LiteRT-LM runtime. const liteRtLmReleaseTag = 'v0.17.0-6'; diff --git a/packages/llamadart_llama_cpp_flutter/CHANGELOG.md b/packages/llamadart_llama_cpp_flutter/CHANGELOG.md index 7bbc8f80a..6350b70be 100644 --- a/packages/llamadart_llama_cpp_flutter/CHANGELOG.md +++ b/packages/llamadart_llama_cpp_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased + +* Updated Apple SwiftPM native pin to `leehack/llamadart-native@v0.4.1-1`. + ## 0.0.19 * Updated Apple SwiftPM native pin to `leehack/llamadart-native@v0.4.1`. diff --git a/packages/llamadart_llama_cpp_flutter/README.md b/packages/llamadart_llama_cpp_flutter/README.md index 13566e3f1..993820443 100644 --- a/packages/llamadart_llama_cpp_flutter/README.md +++ b/packages/llamadart_llama_cpp_flutter/README.md @@ -20,7 +20,7 @@ dependencies: This package has no runtime Dart API of its own. Import `package:llamadart` normally from the core package and use `LlamaBackend()` / `LlamaEngine` there. -The Apple SwiftPM manifest pins `leehack/llamadart-native@v0.4.1`. +The Apple SwiftPM manifest pins `leehack/llamadart-native@v0.4.1-1`. Source for this package lives in `packages/llamadart_llama_cpp_flutter` in the diff --git a/packages/llamadart_llama_cpp_flutter/darwin/llamadart_llama_cpp_flutter/Package.swift b/packages/llamadart_llama_cpp_flutter/darwin/llamadart_llama_cpp_flutter/Package.swift index bd96187d9..8f7d808d4 100644 --- a/packages/llamadart_llama_cpp_flutter/darwin/llamadart_llama_cpp_flutter/Package.swift +++ b/packages/llamadart_llama_cpp_flutter/darwin/llamadart_llama_cpp_flutter/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let packageRoot = URL(fileURLWithPath: #filePath).deletingLastPathComponent() let artifactsRoot = packageRoot.appendingPathComponent("Artifacts") -let llamaCppTag = "v0.4.1" +let llamaCppTag = "v0.4.1-1" func localArtifactPath(_ name: String) -> String? { let path = artifactsRoot.appendingPathComponent(name).path @@ -47,7 +47,7 @@ let package = Package( repository: "leehack/llamadart-native", artifactName: "llamadart-native-apple-xcframework-\(llamaCppTag).zip", tag: llamaCppTag, - checksum: "16175a4084a14af63cc66e78b9b2a8173d2e14db86775af280c859438bd8616a" + checksum: "bab353ce17dfbac9afe65ade73751d67f110b1807a1fb365b4d1df2db25a5418" ), .target( name: "llamadart_llama_cpp_flutter", diff --git a/website/docs/getting-started/installation.md b/website/docs/getting-started/installation.md index 90681fedd..d300edd9a 100644 --- a/website/docs/getting-started/installation.md +++ b/website/docs/getting-started/installation.md @@ -88,7 +88,7 @@ hooks: llamadart: # Optional. Defaults to llamadart's tested native runtime pin. # Use a leehack/llamadart-native release tag when testing another build. - llamadart_native_tag: v0.4.1 + llamadart_native_tag: v0.4.1-1 # Optional. GitHub repository slug or github.com URL. llamadart_native_repository: leehack/llamadart-native @@ -115,7 +115,7 @@ per-target module list. Native source overrides are for compatibility testing. They do not regenerate Dart FFI bindings or symbol lookups, so the selected binary still must be ABI- and symbol-compatible with the default -`leehack/llamadart-native@v0.4.1` runtime. +`leehack/llamadart-native@v0.4.1-1` runtime. Available native tags are published on the [`leehack/llamadart-native` releases page](https://github.com/leehack/llamadart-native/releases). @@ -143,7 +143,7 @@ gh release list --repo leehack/llamadart-native --limit 20 Before overriding, confirm the release includes the asset for your target. The hook downloads files named `llamadart-native--.tar.gz`, for example -`llamadart-native-windows-x64-v0.4.1.tar.gz`. +`llamadart-native-windows-x64-v0.4.1-1.tar.gz`. For local testing, `llamadart_native_path` may point directly at a bundle archive, at an extracted bundle directory, or at a directory containing `//`, `/`, or the expected archive file. diff --git a/website/docs/platforms/support-matrix.md b/website/docs/platforms/support-matrix.md index 204a12c75..48aa4990d 100644 --- a/website/docs/platforms/support-matrix.md +++ b/website/docs/platforms/support-matrix.md @@ -8,7 +8,7 @@ backend-module configuration for `llamadart`. The native-assets hook currently pins `llamadart-native` tag -`v0.4.1` and +`v0.4.1-1` and `litert-lm-native` release `v0.17.0-6` (`lib/src/hook/native_release_pins.dart`). Apps can override the llama.cpp native GitHub source with `hooks.user_defines.llamadart.llamadart_native_tag` and @@ -306,7 +306,7 @@ device/model bundle, use `cpu` or `gpu` for that artifact. a web load failure as a package bug. The [WebGPU Bridge](./webgpu-bridge) page has the browser-console probe and Flutter Web smoke-test path. -## Current llama.cpp module availability by bundle (`v0.4.1`) +## Current llama.cpp module availability by bundle (`v0.4.1-1`) | Bundle key | Available backend modules in bundle | | --- | --- | @@ -354,7 +354,7 @@ hooks: user_defines: llamadart: # Optional. Defaults to llamadart's tested native runtime pin. - llamadart_native_tag: v0.4.1 + llamadart_native_tag: v0.4.1-1 # Optional. GitHub repository slug or github.com URL. llamadart_native_repository: leehack/llamadart-native