Fix LiteRT-LM streaming and GPU packaging#297
Merged
Conversation
Contributor
|
Chat app preview removed for |
There was a problem hiding this comment.
Pull request overview
This PR updates the pinned native LiteRT-LM runtime to v0.14.0-native.2 and aligns the Dart runtime, build hook, Flutter SwiftPM companion package, macOS app embedding script, tests, and docs with the new packaging and streaming semantics (notably avoiding misuse of LiteRT-LM “decode token” benchmark controls as response limits).
Changes:
- Bump native LiteRT-LM pin to
v0.14.0-native.2and refresh checksums / bundle requirements across hook, runtime, docs, and companion SwiftPM package. - Fix native LiteRT-LM generation so requested response limits apply per request (streaming promptly) rather than being treated as a forced benchmark decode-step count.
- Restore/adjust macOS packaging flow (prepare script + Xcode build phase) and expand iOS/macOS GPU selection/documentation.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/platforms/support-matrix.md | Updates LiteRT-LM runtime pin and platform/backend coverage notes (including iOS GPU). |
| website/docs/guides/backend-selection.md | Aligns backend capability table with iOS/macOS LiteRT-LM CPU/GPU support. |
| website/docs/changelog/recent-releases.md | Adds Unreleased notes for LiteRT-LM streaming fix and runtime pin bump. |
| tool/native/sync_native_release_pins.py | Extends pin-sync script to also update the macOS prepare script’s pinned LiteRT-LM version. |
| tool/macos_litert_lm_prepare_app.sh | Simplifies required runtime library expectations and updates pinned cache-path candidates to v0.14.0-native.2. |
| test/unit/tooling/sync_native_release_pins_script_test.dart | Adds coverage ensuring the pin-sync script updates the macOS prepare script. |
| test/unit/tooling/macos_litert_lm_prepare_app_script_test.dart | Adds regression test asserting the chat app’s macOS build phase ordering and updates library expectations. |
| test/unit/hook/build_hook_litert_lm_integration_test.dart | Updates iOS/macOS bundle expectations and tightens iOS code-asset filtering behavior. |
| test/unit/backends/litert_lm/litert_lm_service_test.dart | Updates expectations for output token defaults and adds test ensuring response limits change without recreating the client. |
| test/unit/backends/litert_lm/litert_lm_runtime_test.dart | Updates macOS required library/framework/native-SPM file expectations for the new runtime packaging. |
| test/unit/backends/litert_lm/litert_lm_platform_test.dart | Updates platform backend availability/defaults to include iOS GPU support. |
| README.md | Updates the documented default native LiteRT-LM pin to v0.14.0-native.2. |
| packages/llamadart_litert_lm_flutter/test/llamadart_litert_lm_flutter_test.dart | Updates tests for the SwiftPM manifest and macOS import expectations. |
| packages/llamadart_litert_lm_flutter/README.md | Updates companion-package documentation to the new pin and macOS SwiftPM status. |
| packages/llamadart_litert_lm_flutter/darwin/llamadart_litert_lm_flutter/Sources/llamadart_litert_lm_flutter/LlamadartLiteRtLmPlugin.swift | Imports LiteRT-LM on macOS (under conditional compilation) to match restored macOS SwiftPM artifacts. |
| packages/llamadart_litert_lm_flutter/darwin/llamadart_litert_lm_flutter/Package.swift | Bumps LiteRT-LM tag/checksums; replaces iOS Gemma provider target with consolidated upstream artifacts; enables macOS artifact set. |
| packages/llamadart_litert_lm_flutter/CHANGELOG.md | Adds Unreleased entry documenting the updated pin and consolidated artifacts/macOS enablement. |
| lib/src/backends/litert_lm/litert_lm_service.dart | Stops treating response length as a client-recreation parameter; relies on per-request max output tokens. |
| lib/src/backends/litert_lm/litert_lm_runtime.dart | Bumps runtime version; simplifies macOS required library/framework sets; fixes generation semantics by avoiding benchmark decode-token forcing and using per-request output limits. |
| lib/src/backends/litert_lm/litert_lm_runtime_stub.dart | Updates stub docs to clarify outputTokens meaning. |
| lib/src/backends/litert_lm/litert_lm_platform.dart | Extends iOS to report GPU backend availability/defaults. |
| hook/build.dart | Bumps pinned LiteRT-LM version + checksums; narrows iOS dynamic library emission to only required files. |
| example/chat_app/test/chat_generation_service_test.dart | Asserts LiteRT-LM chat defaults flush the first token immediately via stream batching threshold. |
| example/chat_app/macos/Runner.xcodeproj/project.pbxproj | Adds “Prepare LiteRT-LM Runtime” build phase after Flutter assembly to embed/sign runtime into the macOS app bundle. |
| example/chat_app/lib/services/chat_generation_service.dart | Forces LiteRT-LM chat streaming to flush the first token immediately (streamBatchTokenThreshold: 1). |
| CHANGELOG.md | Adds Unreleased entries documenting LiteRT-LM runtime pin bump, iOS Metal enablement, macOS packaging restoration, and streaming fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
maxOutputTokensoption, so EOS completes immediately.v0.14.0-native.2, which exports Android GPU plugin symbols globally and uses the checksum-pinned official Apple runtime.Production-readiness scope
Completeness checklist
PR type guidance
Test Plan
dart format --output=none --set-exit-if-changed.dart analyzefor all changed core/hook/test paths: no issues../tool/docs/build_site.shand./tool/docs/validate_links.sh.dart run tool/testing/verify_release_docs_versions.dart.dart analyze: not used because independently managed examples do not have all package dependencies resolved from the root; all changed paths were analyzed directly.Matrix Evidence
DF_1_GLOBAL; warmed run completed in 337 ms with EOS and no forced-token wait.litert-lm-native@v0.14.0-native.2Review Notes
dd5991ade.