Skip to content

feat: add Gemma 4 template support and projector capability gating#104

Merged
leehack merged 1 commit intomainfrom
gemma4-support-cleanup
Apr 3, 2026
Merged

feat: add Gemma 4 template support and projector capability gating#104
leehack merged 1 commit intomainfrom
gemma4-support-cleanup

Conversation

@leehack
Copy link
Copy Markdown
Owner

@leehack leehack commented Apr 3, 2026

Summary

  • add Gemma 4 chat template detection, rendering, thinking parsing, and tool-call parsing support in the core template engine
  • add Gemma 4 E2B to the chat app download library and gate multimodal attachment support from real projector capabilities instead of assuming any loaded mmproj supports audio
  • document the current Gemma 4 GGUF projector behavior, including the vision-only runtime path exposed by the current llama.cpp mtmd integration

Validation

  • dart analyze
  • dart test test/unit/core/template/chat_format_test.dart test/unit/core/template/chat_template_engine_test.dart test/unit/core/template/jinja/jinja_analyzer_test.dart test/unit/core/template/handlers/gemma4_handler_test.dart
  • flutter test test/assistant_output_service_test.dart
  • flutter analyze

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.00000% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.92%. Comparing base (140314b) to head (fe93010).

Files with missing lines Patch % Lines
lib/src/core/template/handlers/gemma4_handler.dart 89.47% 18 Missing ⚠️
lib/src/backends/llama_cpp/llama_cpp_service.dart 0.00% 16 Missing ⚠️
lib/src/backends/llama_cpp/worker.dart 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
+ Coverage   76.77%   76.92%   +0.14%     
==========================================
  Files          67       68       +1     
  Lines        8399     8592     +193     
==========================================
+ Hits         6448     6609     +161     
- Misses       1951     1983      +32     
Flag Coverage Δ
unittests 76.92% <81.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leehack leehack merged commit cfb2e0a into main Apr 3, 2026
6 checks passed
@leehack leehack deleted the gemma4-support-cleanup branch April 3, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants