Skip to content
Closed
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: 2 additions & 1 deletion packages/genkit_llamadart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Unreleased
## 3.13.0 - 2026-11-26

- Forward image `MediaPart` values in Genkit tool results to the next model turn on native llama.cpp vision models with a qualified template, and reject audio and unsupported runtimes with `UNIMPLEMENTED`.
- Support llamadart 0.22.x alongside 0.21.x.

## 3.12.0 - 2026-11-25

Expand Down
6 changes: 4 additions & 2 deletions packages/genkit_llamadart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ embedding model. See [runtime support](https://github.com/leehack/llamadart/blob

## Install

Requires Dart 3.12 or newer, Genkit 1.x and llamadart 0.21.0 or newer in the 0.21.x series.
Requires Dart 3.12 or newer, Genkit 1.x and llamadart 0.21.0 or newer within the
adapter's declared dependency range.

```bash
dart pub add genkit genkit_llamadart
Expand All @@ -27,7 +28,8 @@ dart pub add genkit genkit_llamadart
For Flutter apps, use `flutter pub add` instead. Follow the
[llamadart installation guide](https://llamadart.leehack.com/) for runtime and
platform setup. Apple apps using Swift Package Manager need the runtime
companion matching their model family:
companion for their model family at the same minor version as llamadart. For
llamadart 0.21.x, use these commands.

```bash
flutter pub add 'llamadart_llama_cpp_flutter:^0.21.0'
Expand Down
5 changes: 3 additions & 2 deletions packages/genkit_llamadart/doc/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## Upgrading to llamadart 0.21

The adapter requires llamadart `^0.21.0`. Flutter iOS and macOS apps must
use matching `^0.21.0` runtime companions. See
The adapter requires llamadart 0.21.0 or newer within its declared dependency
range. Flutter iOS and macOS apps must use runtime companions at the same minor
version as llamadart. See
[llamadart's migration guide](https://github.com/leehack/llamadart/blob/main/MIGRATION.md).

## Upgrading to llamadart 0.20
Expand Down
7 changes: 4 additions & 3 deletions packages/genkit_llamadart/doc/tool-input-schemas.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Tool input schemas

The plugin requires llamadart `^0.21.0`. Genkit continues to own handlers,
interrupts and message history. Tool input and tool-call argument roots must
be JSON objects; scalar and array roots are unsupported.
The plugin requires llamadart 0.21.0 or newer within its declared dependency
range. Genkit continues to own handlers, interrupts and message history. Tool
input and tool-call argument roots must be JSON objects. Scalar and array roots
are unsupported.

## Schema support

Expand Down
4 changes: 2 additions & 2 deletions packages/genkit_llamadart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
Genkit Dart plugin for local AI through llamadart: GGUF and LiteRT-LM chat,
tool calling, JSON, embeddings, plus native batch transcription, speech
synthesis and image generation.
version: 3.12.0
version: 3.13.0
homepage: https://llamadart.leehack.com
repository: https://github.com/leehack/llamadart/tree/main/packages/genkit_llamadart
issue_tracker: https://github.com/leehack/llamadart/issues
Expand All @@ -29,7 +29,7 @@ dependencies:
crypto: ^3.0.7
genkit: ^1.0.0
http: ^1.6.0
llamadart: ^0.21.0
llamadart: '>=0.21.0 <0.23.0'
schemantic: ^1.0.0

dev_dependencies:
Expand Down
13 changes: 7 additions & 6 deletions test/unit/tooling/genkit_doc_floor_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ import 'dart:io';

import 'package:test/test.dart';

import 'support/genkit_dependency_floor.dart';

void main() {
final floor = RegExp(r'^ llamadart: \^(\S+)\s*$', multiLine: true)
.firstMatch(
File('packages/genkit_llamadart/pubspec.yaml').readAsStringSync(),
)![1]!;
final floor = genkitLlamadartFloor(
File('packages/genkit_llamadart/pubspec.yaml').readAsStringSync(),
);

for (final (path, claim) in <(String, String)>[
(
'website/docs/maintainers/genkit-package.md',
'published llamadart $floor',
),
('packages/genkit_llamadart/README.md', 'llamadart $floor or newer'),
('packages/genkit_llamadart/doc/migration.md', 'llamadart `^$floor`'),
('packages/genkit_llamadart/doc/migration.md', 'llamadart $floor or newer'),
(
'packages/genkit_llamadart/doc/tool-input-schemas.md',
'llamadart `^$floor`',
'llamadart $floor or newer',
),
('.github/workflows/ci.yml', 'llamadart@$floor '),
]) {
Expand Down
46 changes: 40 additions & 6 deletions test/unit/tooling/genkit_llamadart_floor_pin_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,50 @@ library;

import 'dart:io';

import 'package:pub_semver/pub_semver.dart';
import 'package:test/test.dart';

import 'support/genkit_dependency_floor.dart';

void main() {
const floor = '0.21.0';

test('reads the floor of a caret constraint', () {
expect(
genkitLlamadartFloor('dependencies:\n llamadart: ^$floor\n'),
Version.parse(floor),
);
});

test('reads the inclusive lower bound of an explicit range', () {
expect(
genkitLlamadartFloor("dependencies:\n llamadart: '>=$floor <0.23.0'\n"),
Version.parse(floor),
);
});

test('rejects a malformed range', () {
expect(
() => genkitLlamadartFloor(
"dependencies:\n llamadart: '>=$floor <next'\n",
),
throwsFormatException,
);
});

test('rejects a range without an inclusive lower bound', () {
expect(
() => genkitLlamadartFloor(
"dependencies:\n llamadart: '>$floor <0.23.0'\n",
),
throwsFormatException,
);
});

test('genkit workflow llamadart pins equal the package floor', () {
final floor =
RegExp(r'^\s*llamadart:\s*\^(\d+\.\d+\.\d+)\s*$', multiLine: true)
.firstMatch(
File('packages/genkit_llamadart/pubspec.yaml').readAsStringSync(),
)!
.group(1);
final floor = genkitLlamadartFloor(
File('packages/genkit_llamadart/pubspec.yaml').readAsStringSync(),
).toString();

for (final path in [
'.github/workflows/ci.yml',
Expand Down
24 changes: 24 additions & 0 deletions test/unit/tooling/support/genkit_dependency_floor.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:pub_semver/pub_semver.dart';
import 'package:yaml/yaml.dart';

Version genkitLlamadartFloor(String pubspec) {
final manifest = loadYaml(pubspec);
final dependencies = manifest is YamlMap ? manifest['dependencies'] : null;
final constraintText = dependencies is YamlMap
? dependencies['llamadart']
: null;
if (constraintText is! String) {
throw const FormatException('Expected a version constraint for llamadart');
}

final constraint = VersionConstraint.parse(constraintText);
if (constraint case VersionRange(
min: final Version floor,
includeMin: true,
)) {
return floor;
}
throw const FormatException(
'Expected an inclusive lower bound for llamadart',
);
}
Loading