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
19 changes: 9 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
Releases before 0.10.0 are in the
[changelog archive](https://github.com/leehack/llamadart/blob/main/doc/changelog_archive.md).

## Unreleased
## 0.19.4

- Name the unadaptable bundle template or `ModelParams.chatTemplate` in a failed native LiteRT-LM chat send on the C API 1.0 runtime too, as the legacy runtime already does ([#1868](https://github.com/leehack/llamadart/issues/1868)).
- Keep the default WebGPU bridge assets at `v0.1.83` (unchanged from 0.19.3).
- Add tool calling to LiteRT-LM Web through `LlamaBackend.withTextHistory()` on `@litert-lm/core@0.19.0`: `create` returns the model's tool calls and takes tool results in the next request, and `supportsToolCalling` reports whether the loaded runtime reads tool declarations; `ToolChoice.required` and `parallelToolCalls` still throw `LlamaUnsupportedException`. Replies cut off at `maxTokens` or the context size now end with finish reason `length`, and automatic tool loops (`sendWithTools`, `completeWithTools`) run when a load probe finds that the runtime reports per-turn token counts; a reply that ends exactly at `maxTokens` also reports `length` ([#1790](https://github.com/leehack/llamadart/issues/1790), [#919](https://github.com/leehack/llamadart/issues/919)).
- Document that LiteRT-LM Web `generate()` wraps the prompt in one user turn of the bundle's chat template, because `@litert-lm/core@0.19.0` has no raw streaming route ([#1863](https://github.com/leehack/llamadart/issues/1863)).
- Keep `LlamaArgumentException.name` when native LiteRT-LM reports an argument error from its worker isolate, and say in the native LiteRT-LM raw-prompt refusal whether the prompt is empty or holds only the model's start token ([#1861](https://github.com/leehack/llamadart/issues/1861)).
- Add manual tool calling to LiteRT-LM Web through `LlamaBackend.withTextHistory()` on `@litert-lm/core@0.19.0`: tools reach the model, `create` returns its tool calls, and tool results go back in the next request. `supportsToolCalling` reports whether the loaded runtime reads tool declarations; `ToolChoice.required` and `parallelToolCalls` still throw `LlamaUnsupportedException` ([#1790](https://github.com/leehack/llamadart/issues/1790)).
- Report LiteRT-LM Web replies cut off at `maxTokens` or the context size as finish reason `length`, and run automatic tool loops (`sendWithTools`, `completeWithTools`) there, through `LlamaBackend.withTextHistory()` on `@litert-lm/core@0.19.0`. A load probe checks that the runtime reports per-turn token counts; a reply that ends exactly at `maxTokens` is also reported as `length` ([#919](https://github.com/leehack/llamadart/issues/919)).
- When the prompt opened no thought, take a thought only at the start of the reply, as llama.cpp does: any other thinking tag, such as a `</think>` before any `<think>`, a `<think>` later in the reply or a second `</think>`, is now content in generic, Llama 3, GLM 4.5, Kimi K2, LFM2, Laguna, Granite, MiniCPM5, Mistral Nemo, Apertus, Hunyuan V3 and DeepSeek R1, V3.2 and V4 replies, and after the start of a Hermes or Qwen3-Coder XML reply. The stream used to depend on how the reply was chunked and could repeat text as both content and reasoning ([#1865](https://github.com/leehack/llamadart/issues/1865)).
- Parse Qwen3-Coder XML replies (Qwen3-Coder, Qwen3.5, StepFun3.5-Flash) as llama.cpp does: text from the first `<tool_call>` on that is not a valid call, such as an invalid call or text after the calls, is dropped instead of kept as content, and only the first call counts without `parallelToolCalls`. Qwen3-Coder replies have no reasoning, and StepFun3.5-Flash with thinking off ends its thought at `</think>` or `<tool_call>` ([#1531](https://github.com/leehack/llamadart/issues/1531)).
- With `ToolChoice.required`, Qwen3-Coder XML replies (Qwen3-Coder, Qwen3.5, StepFun3.5-Flash) may think and write text before their tool calls, as with llama.cpp, instead of having to start with `<tool_call>`, so a reply that spends `maxTokens` first ends with `length` and no call; with `ToolChoice.required`, a Qwen3-Coder call that leaves out the first `<tool_call>` is now a tool call ([#1531](https://github.com/leehack/llamadart/issues/1531)).
- MiniMax M3 replies to a prompt that opens no thought, as with thinking off, now take a thought only where `<mm:think>` starts the reply, as llama.cpp does: a `<mm:think>` later in the reply or after leading whitespace, and a `</mm:think>` after text, stay content instead of becoming reasoning ([#1887](https://github.com/leehack/llamadart/issues/1887)).
- Start Seed-OSS tool calls only at a `<seed:tool_call>` followed by a line break, as llama.cpp does, in the parse and the tool-call grammar; a scope such as `<seed:tool_call><function=` is now content, and a call after it is found. An unknown tool or a missing required argument still parses as a call unless the tools came from `ToolDefinition.fromJsonSchema` ([#1542](https://github.com/leehack/llamadart/pull/1542#issuecomment-6758592134)).
- Make native LiteRT-LM errors more specific: a failed chat send on the C API 1.0 runtime names the unadaptable bundle template or `ModelParams.chatTemplate`, as the legacy runtime does; an argument error from the worker isolate keeps `LlamaArgumentException.name`; and the raw-prompt refusal says whether the prompt is empty or holds only the model's start token ([#1868](https://github.com/leehack/llamadart/issues/1868), [#1861](https://github.com/leehack/llamadart/issues/1861)).
- When the prompt opened no thought, take a thought only at the start of the reply, as llama.cpp does: any other thinking tag, such as a `</think>` before any `<think>`, a later `<think>` or a second `</think>`, is now content in generic, Llama 3, GLM 4.5, Kimi K2, LFM2, Laguna, Granite, MiniCPM5, Mistral Nemo, Apertus, Hunyuan V3 and DeepSeek R1, V3.2 and V4 replies, and after the start of a Hermes or Qwen3-Coder XML reply. The stream used to depend on how the reply was chunked and could repeat text as both content and reasoning. MiniMax M3 does the same: a `<mm:think>` after leading whitespace or later in the reply, and a `</mm:think>` after text, stay content ([#1865](https://github.com/leehack/llamadart/issues/1865), [#1887](https://github.com/leehack/llamadart/issues/1887)).
- Parse Qwen3-Coder XML replies (Qwen3-Coder, Qwen3.5, StepFun3.5-Flash) as llama.cpp does: text from the first `<tool_call>` on that is not a valid call, such as an invalid call or text after the calls, is dropped instead of kept as content; only the first call counts without `parallelToolCalls`; Qwen3-Coder replies have no reasoning; and StepFun3.5-Flash with thinking off ends its thought at `</think>` or `<tool_call>`. With `ToolChoice.required`, these replies may think and write text before their calls instead of having to start with `<tool_call>`, so one that spends `maxTokens` first ends with `length` and no call, and a Qwen3-Coder call that leaves out the first `<tool_call>` is now a tool call ([#1531](https://github.com/leehack/llamadart/issues/1531)).
- Start Seed-OSS tool calls only at a `<seed:tool_call>` followed by a line break, as llama.cpp does, in both the parser and the tool-call grammar: a scope such as `<seed:tool_call><function=` is now content, and a call after it is still found. An unknown tool or a missing required argument still parses as a call; Seed-OSS requests refuse `ToolDefinition.fromJsonSchema` tools, so validate the tool name and arguments before running a call ([#1542](https://github.com/leehack/llamadart/pull/1542#issuecomment-6758592134)).

Runtime baseline: native llama.cpp `v0.9.0` and Web use upstream `v0.9.0@cd959bae99ff4bed22bef2604f45241c09bbb8c8`; native LiteRT-LM uses `v0.19.1-2` and stable-diffusion uses `v0.3.0-3`. Web LiteRT-LM uses `@litert-lm/core@0.19.0`. Manifest SHA-256: `ae6f488408672f9ba28d8f9e664a2b85f4e12048f290e259e18dd0b750c038e5`.

## 0.19.3

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LFM2 replies cut off at a reported length limit expose raw `partialToolCalls` di

```yaml
dependencies:
llamadart: ^0.19.3
llamadart: ^0.19.4
```

```bash
Expand All @@ -55,10 +55,10 @@ companion shares its core's `MAJOR.MINOR` and constrains `llamadart` to it.

```yaml
dependencies:
llamadart: ^0.19.3
llamadart_llama_cpp_flutter: ^0.19.3 # GGUF / llama.cpp
llamadart_litert_lm_flutter: ^0.19.3 # Apple .litertlm / LiteRT-LM targets
llamadart_stable_diffusion_flutter: ^0.19.3 # Apple image generation, opt-in
llamadart: ^0.19.4
llamadart_llama_cpp_flutter: ^0.19.4 # GGUF / llama.cpp
llamadart_litert_lm_flutter: ^0.19.4 # Apple .litertlm / LiteRT-LM targets
llamadart_stable_diffusion_flutter: ^0.19.4 # Apple image generation, opt-in
```

Pairing rules, the SwiftPM bootstrap and the privacy manifest are in
Expand Down
8 changes: 4 additions & 4 deletions example/chat_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -421,28 +421,28 @@ packages:
path: "../.."
relative: true
source: path
version: "0.19.3"
version: "0.19.4"
llamadart_litert_lm_flutter:
dependency: "direct main"
description:
path: "../../packages/llamadart_litert_lm_flutter"
relative: true
source: path
version: "0.19.3"
version: "0.19.4"
llamadart_llama_cpp_flutter:
dependency: "direct main"
description:
path: "../../packages/llamadart_llama_cpp_flutter"
relative: true
source: path
version: "0.19.3"
version: "0.19.4"
llamadart_stable_diffusion_flutter:
dependency: "direct main"
description:
path: "../../packages/llamadart_stable_diffusion_flutter"
relative: true
source: path
version: "0.19.3"
version: "0.19.4"
llamadart_validation:
dependency: "direct main"
description:
Expand Down
4 changes: 4 additions & 0 deletions packages/llamadart_litert_lm_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.19.4

- Refresh README installation guidance for core `0.19.4`; Apple SwiftPM stays pinned to `leehack/litert-lm-native@v0.19.1-2`.

## 0.19.3

- Refresh README installation guidance for core `0.19.3`; Apple SwiftPM stays pinned to `leehack/litert-lm-native@v0.19.1-2`.
Expand Down
4 changes: 2 additions & 2 deletions packages/llamadart_litert_lm_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ also request an x86_64 Simulator slice must exclude x86_64 for LiteRT-LM builds.

```yaml
dependencies:
llamadart: ^0.19.3
llamadart_litert_lm_flutter: ^0.19.3
llamadart: ^0.19.4
llamadart_litert_lm_flutter: ^0.19.4
```

This package has no runtime Dart API of its own. Import `package:llamadart`
Expand Down
2 changes: 1 addition & 1 deletion packages/llamadart_litert_lm_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: llamadart_litert_lm_flutter
description: Flutter Apple SwiftPM runtime companion package for llamadart LiteRT-LM support.
version: 0.19.3
version: 0.19.4
repository: https://github.com/leehack/llamadart/tree/main/packages/llamadart_litert_lm_flutter
homepage: https://github.com/leehack/llamadart
issue_tracker: https://github.com/leehack/llamadart/issues
Expand Down
4 changes: 4 additions & 0 deletions packages/llamadart_llama_cpp_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.19.4

- Refresh README installation guidance for core `0.19.4`; Apple SwiftPM stays pinned to `leehack/llamadart-native@v0.9.0`.

## 0.19.3

- Refresh README installation guidance for core `0.19.3`; Apple SwiftPM stays pinned to `leehack/llamadart-native@v0.9.0`.
Expand Down
4 changes: 2 additions & 2 deletions packages/llamadart_llama_cpp_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ with core `0.19.x`. Upgrade both together. Earlier pairings are in the

```yaml
dependencies:
llamadart: ^0.19.3
llamadart_llama_cpp_flutter: ^0.19.3
llamadart: ^0.19.4
llamadart_llama_cpp_flutter: ^0.19.4
```

This package has no runtime Dart API of its own. Import `package:llamadart`
Expand Down
2 changes: 1 addition & 1 deletion packages/llamadart_llama_cpp_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: llamadart_llama_cpp_flutter
description: Flutter Apple SwiftPM runtime companion package for llamadart llama.cpp and GGUF support.
version: 0.19.3
version: 0.19.4
repository: https://github.com/leehack/llamadart/tree/main/packages/llamadart_llama_cpp_flutter
homepage: https://github.com/leehack/llamadart
issue_tracker: https://github.com/leehack/llamadart/issues
Expand Down
4 changes: 4 additions & 0 deletions packages/llamadart_stable_diffusion_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.19.4

- Refresh README installation guidance for core `0.19.4`; Apple SwiftPM stays pinned to `leehack/stable-diffusion-native@v0.3.0-3`.

## 0.19.3

- Refresh README installation guidance for core `0.19.3`; Apple SwiftPM stays pinned to `leehack/stable-diffusion-native@v0.3.0-3`.
Expand Down
4 changes: 2 additions & 2 deletions packages/llamadart_stable_diffusion_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ with core `0.19.x`. Upgrade both together. Earlier pairings are in the

```yaml
dependencies:
llamadart: ^0.19.3
llamadart_stable_diffusion_flutter: ^0.19.3
llamadart: ^0.19.4
llamadart_stable_diffusion_flutter: ^0.19.4
```

Adding the package selects the `stable_diffusion` runtime for Flutter iOS and
Expand Down
2 changes: 1 addition & 1 deletion packages/llamadart_stable_diffusion_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: llamadart_stable_diffusion_flutter
description: Flutter Apple SwiftPM runtime companion package for llamadart stable-diffusion.cpp image generation.
version: 0.19.3
version: 0.19.4
repository: https://github.com/leehack/llamadart/tree/main/packages/llamadart_stable_diffusion_flutter
homepage: https://github.com/leehack/llamadart
issue_tracker: https://github.com/leehack/llamadart/issues
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 @@ -215,7 +215,7 @@ packages:
path: "../.."
relative: true
source: path
version: "0.19.3"
version: "0.19.4"
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.19.3
version: 0.19.4
homepage: https://llamadart.leehack.com
repository: https://github.com/leehack/llamadart
issue_tracker: https://github.com/leehack/llamadart/issues
Expand Down
Loading
Loading