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
18 changes: 13 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
## Unreleased
## 0.11.1

- Give a chat template that reads content part lists but rejects image and
audio parts the media marker in its text instead of failing in the
template, and, for a template that does not take typed content parts,
render a video part in a `chatTemplate` prompt as the media marker instead
of its JSON ([#959](https://github.com/leehack/llamadart/issues/959)).
template, and render a video part in a `chatTemplate` prompt as the media
marker on any template when the messages hold no image or audio part
([#959](https://github.com/leehack/llamadart/issues/959)). Beside an image
or audio part, a template that is given typed content parts still receives
the video part ([#963](https://github.com/leehack/llamadart/issues/963)).
- Fix a possible llama.cpp crash when an image or audio part of a multimodal
request fails to load while later parts remain, and native memory leaked
when a backend is disposed with a context still open or an embedding fails
because the model reports no embedding size
([#947](https://github.com/leehack/llamadart/issues/947),
[#610](https://github.com/leehack/llamadart/issues/610)).
- Fix Qwen 3 chat and tool-result history with LiteRT-LM runtimes that normalize message content to arrays.
- Fix Qwen 3 chat and tool-result history with LiteRT-LM runtimes that
normalize message content to arrays.
- Work around wrong llama.cpp Vulkan output on some Android GPUs for prompts
over 32 tokens (seen on a Pixel 9 Pro, Mali-G715): an Android Vulkan
context now decodes a text prompt in micro-batches of at most 8 tokens
Expand All @@ -24,6 +27,11 @@
- Document that a Flutter macOS app that quits without disposing its engines
still exits cleanly, and why disposing them in `onExitRequested` is still
recommended ([#826](https://github.com/leehack/llamadart/issues/826)).
* Aligned the default WebGPU bridge assets to `v0.1.54`, unchanged from 0.11.0:
they embed llama.cpp `v0.5.0`, are qualified against native `v0.5.0`, and keep
Web/native llama.cpp `v0.5.0@7fe450e19305b828c199d602c23a8337aaa1f03b` parity
and Web `@litert-lm/core@0.15.0`. Immutable Web asset manifest:
`8a9f83c15035eeb034a6563e6f753382d7d7f9be81503ef76902138da7841176`.

## 0.11.0

Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ experimental and may change, and the runtime is opt-in.
- **Flutter iOS/macOS apps** should add the
`llamadart_stable_diffusion_flutter` companion (see [Install](#install)),
which links the runtime through Swift Package Manager and selects it without
the entry above. Pair companion `0.0.2` with core `0.11.0`. Without it the
hook bundles the runtime, App Store Connect rejects that iOS framework's
`MinimumOSVersion`, and only Xcode and `xcodebuild` show the build warning
about it.
the entry above. Pair companion `0.0.2` with core `0.11.1` and `0.11.0`.
Without it the hook bundles the runtime, App Store Connect rejects that iOS
framework's `MinimumOSVersion`, and only Xcode and `xcodebuild` show the
build warning about it.

- **Platforms:** Android arm64 (CPU), iOS and macOS (Metal), Linux arm64/x64
and Windows x64 (CPU or Vulkan). Not available on the web yet
Expand Down Expand Up @@ -184,15 +184,16 @@ For Dart or Flutter apps:

```yaml
dependencies:
llamadart: ^0.11.0
llamadart: ^0.11.1
```

Flutter iOS/macOS apps that should link Apple XCFrameworks through Swift
Package Manager should also add the runtime companion packages they need:

Pair companion `0.0.21` with core `0.11.0` for matching llama.cpp v0.5.0
bindings. Keep core `0.10.0` and `0.9.0` paired with companion `0.0.20`, core
`0.8.23` with companion `0.0.18`, and core `0.8.22` with companion `0.0.17`.
Pair companion `0.0.21` with core `0.11.1` and `0.11.0` for matching llama.cpp
v0.5.0 bindings. Keep core `0.10.0` and `0.9.0` paired with companion `0.0.20`,
core `0.8.23` with companion `0.0.18`, and core `0.8.22` with companion
`0.0.17`.

Apple builds verify the resolved companion's SwiftPM runtime pin before native
symbol lookup. Incompatible companions or unverified local `Artifacts`
Expand All @@ -201,16 +202,16 @@ overrides fail the build; resolve the matching companion and rerun

```yaml
dependencies:
llamadart: ^0.11.0
llamadart: ^0.11.1
llamadart_llama_cpp_flutter: ^0.0.21 # GGUF / llama.cpp
llamadart_litert_lm_flutter: ^0.0.13 # Apple .litertlm / LiteRT-LM targets
llamadart_stable_diffusion_flutter: ^0.0.2 # Apple image generation, opt-in
```

Pair `llamadart_stable_diffusion_flutter` `0.0.2` with core `0.11.0`, and
`0.0.1` with core `0.10.0`; older cores, including `0.9.x`, ignore it. Adding
it opts iOS and macOS builds into the image generation runtime (about 37 MB
per Apple target), so leave it out unless the app uses
Pair `llamadart_stable_diffusion_flutter` `0.0.2` with core `0.11.1` and
`0.11.0`, and `0.0.1` with core `0.10.0`; older cores, including `0.9.x`,
ignore it. Adding it opts iOS and macOS builds into the image generation
runtime (about 37 MB per Apple target), so leave it out unless the app uses
`ImageGenerationEngine`.

The LiteRT-LM companion manifest includes the complete iOS SwiftPM runtime
Expand Down
11 changes: 7 additions & 4 deletions doc/llama_cpp_exit_teardown.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ since a projector points at its model.
| C `exit()` while an isolate is still running (through FFI, or a native host that skips the engine shutdown) | Covered only while the isolate is idle, freeing an object, or inside a guarded call that returns within two seconds. Inside an unguarded call it is a use after free; inside a longer guarded call ggml-metal aborts. |

In a Flutter macOS quit with models idle, either layer is enough alone
(debug build on an M4 Max, each of the four paths in the table). With the
(debug build on an M4 Max, each of the five quits `chat-app-macos-quit`
drives: the four paths in the table, with `exitApplication` once as
`AppExitType.required` and once as `AppExitType.cancelable`). With the
service on `LlamaCppObjectCalls.upstream`, the isolates' frees gave a clean
quit with a llama.cpp model loaded. With `IsolateShutdownReleases.hold`
doing nothing, teardown gave one with a llama.cpp and an image model loaded,
0.2 to 0.3 s later (its settle time). With both, every quit aborted. A
Flutter hot restart shuts the old isolates down too: the tracked counts
after the restart and a second load equal the ones before it.
0.2 to 0.3 s later (its settle time). With both layers disabled at once,
every quit aborted. A Flutter hot restart shuts the old isolates down too:
the tracked counts after the restart and a second load equal the ones before
it.

Image models have their own registry in `libstable-diffusion`: see
"Image models".
Expand Down
2 changes: 1 addition & 1 deletion example/chat_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ packages:
path: "../.."
relative: true
source: path
version: "0.11.0"
version: "0.11.1"
llamadart_litert_lm_flutter:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion packages/llamadart_litert_lm_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ also request an x86_64 Simulator slice must exclude x86_64 for LiteRT-LM builds.

```yaml
dependencies:
llamadart: ^0.11.0
llamadart: ^0.11.1
llamadart_litert_lm_flutter: ^0.0.13
```

Expand Down
9 changes: 5 additions & 4 deletions packages/llamadart_llama_cpp_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ Add this package to a Flutter iOS/macOS app when the app should link the
prebuilt llama.cpp Apple XCFramework through SwiftPM instead of relying on the
core package's native-assets fallback.

Pair companion `0.0.21` with core `0.11.0` for matching llama.cpp v0.5.0
bindings. Keep core `0.10.0` and `0.9.0` paired with companion `0.0.20`, core
`0.8.23` with companion `0.0.18`, and core `0.8.22` with companion `0.0.17`.
Pair companion `0.0.21` with core `0.11.1` and `0.11.0` for matching llama.cpp
v0.5.0 bindings. Keep core `0.10.0` and `0.9.0` paired with companion `0.0.20`,
core `0.8.23` with companion `0.0.18`, and core `0.8.22` with companion
`0.0.17`.

```yaml
dependencies:
llamadart: ^0.11.0
llamadart: ^0.11.1
llamadart_llama_cpp_flutter: ^0.0.21
```

Expand Down
6 changes: 3 additions & 3 deletions packages/llamadart_stable_diffusion_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ writes `MinimumOSVersion` 13.0 into it, while the library requires iOS 16.4.
The hook reports this as an Xcode build warning, which Xcode and `xcodebuild`
show but plain `flutter build` and `flutter run` output does not.

Pair companion `0.0.2` with core `0.11.0`, and `0.0.1` with core `0.10.0`;
older cores, including `0.9.x`, ignore it.
Pair companion `0.0.2` with core `0.11.1` and `0.11.0`, and `0.0.1` with core
`0.10.0`; older cores, including `0.9.x`, ignore it.

```yaml
dependencies:
llamadart: ^0.11.0
llamadart: ^0.11.1
llamadart_stable_diffusion_flutter: ^0.0.2
```

Expand Down
2 changes: 1 addition & 1 deletion packages/llamadart_validation/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ packages:
path: "../.."
relative: true
source: path
version: "0.11.0"
version: "0.11.1"
logging:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: llamadart
description: Cross-platform, on-device LLM inference for Dart and Flutter. Run GGUF (llama.cpp) and LiteRT-LM models locally on Android, iOS, macOS, Windows, Linux and web.
version: 0.11.0
version: 0.11.1
homepage: https://llamadart.leehack.com
repository: https://github.com/leehack/llamadart
issue_tracker: https://github.com/leehack/llamadart/issues
Expand Down
4 changes: 2 additions & 2 deletions skills/llamadart-image-generation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ description: >-
on iOS and macOS without the entry above. Without it the hook bundles the
runtime, and App Store Connect rejects that iOS framework's
`MinimumOSVersion`; only Xcode and `xcodebuild` show the build warning about
it. Pair companion `0.0.2` with core `0.11.0`; adding it opts the app
into the runtime (about 37 MB per Apple target).
it. Pair companion `0.0.2` with core `0.11.1` and `0.11.0`; adding it opts
the app into the runtime (about 37 MB per Apple target).
- Platforms: Android arm64 (CPU only; Armv8.2 dot-product and fp16), iOS 16.4+
and macOS 13.3+ (Metal), Linux arm64/x64 and Windows x64 (CPU or Vulkan; x64
CPUs need AVX2, FMA, F16C and BMI2). Web, Android x64 and Windows arm64
Expand Down
18 changes: 13 additions & 5 deletions website/docs/changelog/recent-releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ For canonical full release notes, use:

- [`CHANGELOG.md`](https://github.com/leehack/llamadart/blob/main/CHANGELOG.md)

## Unreleased
## 0.11.1

- Give a chat template that reads content part lists but rejects image and
audio parts the media marker in its text instead of failing in the
template, and, for a template that does not take typed content parts,
render a video part in a `chatTemplate` prompt as the media marker instead
of its JSON ([#959](https://github.com/leehack/llamadart/issues/959)).
template, and render a video part in a `chatTemplate` prompt as the media
marker on any template when the messages hold no image or audio part
([#959](https://github.com/leehack/llamadart/issues/959)). Beside an image
or audio part, a template that is given typed content parts still receives
the video part ([#963](https://github.com/leehack/llamadart/issues/963)).
- Fix a possible llama.cpp crash when an image or audio part of a multimodal
request fails to load while later parts remain, and native memory leaked
when a backend is disposed with a context still open or an embedding fails
because the model reports no embedding size
([#947](https://github.com/leehack/llamadart/issues/947),
[#610](https://github.com/leehack/llamadart/issues/610)).
- Fix Qwen 3 chat and tool-result history with LiteRT-LM runtimes that normalize message content to arrays.
- Fix Qwen 3 chat and tool-result history with LiteRT-LM runtimes that
normalize message content to arrays.
- Work around wrong llama.cpp Vulkan output on some Android GPUs for prompts
over 32 tokens (seen on a Pixel 9 Pro, Mali-G715): an Android Vulkan
context now decodes a text prompt in micro-batches of at most 8 tokens
Expand All @@ -33,6 +36,11 @@ For canonical full release notes, use:
- Document that a Flutter macOS app that quits without disposing its engines
still exits cleanly, and why disposing them in `onExitRequested` is still
recommended ([#826](https://github.com/leehack/llamadart/issues/826)).
- Aligned default WebGPU bridge assets to `v0.1.54`, unchanged from 0.11.0:
they embed llama.cpp `v0.5.0`, are qualified against native `v0.5.0`, and keep
Web/native llama.cpp `v0.5.0@7fe450e19305b828c199d602c23a8337aaa1f03b` parity
and Web `@litert-lm/core@0.15.0`. Immutable Web asset manifest:
`8a9f83c15035eeb034a6563e6f753382d7d7f9be81503ef76902138da7841176`.

## 0.11.0

Expand Down
32 changes: 16 additions & 16 deletions website/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ description: Add llamadart to a Dart or Flutter app, set up Apple and web target

```yaml
dependencies:
llamadart: ^0.11.0
llamadart: ^0.11.1
```

Then resolve packages:
Expand Down Expand Up @@ -51,26 +51,26 @@ companion packages you need:

```yaml
dependencies:
llamadart: ^0.11.0
llamadart: ^0.11.1
llamadart_llama_cpp_flutter: ^0.0.21 # GGUF / llama.cpp
llamadart_litert_lm_flutter: ^0.0.13 # Apple .litertlm / LiteRT-LM targets
llamadart_stable_diffusion_flutter: ^0.0.2 # Apple image generation, opt-in
```

Pair companion `0.0.21` with core `0.11.0`. The build checks the resolved
llama.cpp and stable_diffusion companions' runtime pins and fails on a
mismatch or on an unverified local `Artifacts` override; resolve the matching
companion and rerun `flutter pub get`. Flutter macOS LiteRT-LM builds still use
the core package's native-assets runtime rather than SwiftPM.

Pair `llamadart_stable_diffusion_flutter` `0.0.2` with core `0.11.0`, and
`0.0.1` with core `0.10.0`; older cores, including `0.9.x`, ignore it. Adding
it opts iOS and macOS builds into the image generation runtime (about 37 MB
per Apple target) on its own and leaves the other runtimes on their current
path, so leave it out unless the app uses `ImageGenerationEngine`. An app
that uses image generation without it gets the hook-bundled runtime, whose iOS
framework `MinimumOSVersion` App Store Connect rejects; only Xcode and
`xcodebuild` show the build warning about it.
Pair companion `0.0.21` with core `0.11.1` and `0.11.0`. The build checks the
resolved llama.cpp and stable_diffusion companions' runtime pins and fails on
a mismatch or on an unverified local `Artifacts` override; resolve the
matching companion and rerun `flutter pub get`. Flutter macOS LiteRT-LM builds
still use the core package's native-assets runtime rather than SwiftPM.

Pair `llamadart_stable_diffusion_flutter` `0.0.2` with core `0.11.1` and
`0.11.0`, and `0.0.1` with core `0.10.0`; older cores, including `0.9.x`,
ignore it. Adding it opts iOS and macOS builds into the image generation
runtime (about 37 MB per Apple target) on its own and leaves the other
runtimes on their current path, so leave it out unless the app uses
`ImageGenerationEngine`. An app that uses image generation without it gets the
hook-bundled runtime, whose iOS framework `MinimumOSVersion` App Store Connect
rejects; only Xcode and `xcodebuild` show the build warning about it.

An app bound for the App Store should use the companion for each runtime it
ships, because an Apple privacy manifest reaches an app inside a companion's
Expand Down
3 changes: 2 additions & 1 deletion website/docs/guides/image-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ selects Vulkan, which it does by default; set
Flutter iOS and macOS apps should also add the companion package, which links
the runtime's XCFramework through Swift Package Manager and selects the
runtime on those platforms by itself, adding about 37 MB per Apple target.
Pair `0.0.2` with core `0.11.0`; cores older than `0.10.0` ignore it:
Pair `0.0.2` with core `0.11.1` and `0.11.0`; cores older than `0.10.0`
ignore it:

```yaml
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion website/examples/observability/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Observability example

An application-owned OTel adapter for llamadart 0.11.0. This is not the optional
An application-owned OTel adapter for llamadart 0.11.1. This is not the optional
companion package tracked in [#696](https://github.com/leehack/llamadart/issues/696).
Core dependencies and runtime behavior are unchanged.

Expand Down
2 changes: 1 addition & 1 deletion website/examples/observability/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ packages:
path: "../../.."
relative: true
source: path
version: "0.11.0"
version: "0.11.1"
logging:
dependency: transitive
description:
Expand Down
Loading