Skip to content

feat(gemma4): support Gemma4 in Gemini#5117

Open
douglas-reid wants to merge 2 commits intogoogle:mainfrom
douglas-reid:gemma4-docs-clarity
Open

feat(gemma4): support Gemma4 in Gemini#5117
douglas-reid wants to merge 2 commits intogoogle:mainfrom
douglas-reid:gemma4-docs-clarity

Conversation

@douglas-reid
Copy link
Copy Markdown
Contributor

@douglas-reid douglas-reid commented Apr 2, 2026

The main intent of this PR is to clarify Gemma 3 classes and add Gemma 4 sample now that Gemma 4 is released. As part of that work, this PR adds gemma-4-* to the allowlist for Gemini models for use in ADK.

This PR:

  • Adds gemma-4-* to the allowlist for Gemini models
  • Updates docstrings for Gemma, Gemma3Ollama, and GemmaFunctionCallingMixin to clarify they are Gemma 3-only
  • Adds Gemma 4 usage guidance pointing to Gemini/LiteLlm classes
  • Adds hello_world_gemma4 sample using standard Gemini class
  • Adds header comments and READMEs to existing Gemma 3 samples
  • Adds registry non-collision test for Gemma 4 model strings
  • Updates registration comments in models/init.py

Testing Plan

Please describe the tests that you ran to verify your changes. This is required
for all PRs that are not small documentation or typo fixes.

Unit Tests:

  • [ X ] I have added or updated unit tests for my change.
  • [ X ] All unit tests pass locally.

Please include a summary of passed pytest results.

❯ pytest tests/unittests/models/test_google_llm.py
...
tests/unittests/models/test_google_llm.py ...............................................                                                                                              [100%]
...
=============================================================================== 47 passed, 3 warnings in 4.40s ===============================================================================

❯ pytest tests/unittests/models/test_gemma_llm.py
....
tests/unittests/models/test_gemma_llm.py ......................                                                                                                                        [100%]

===================================================================================== 22 passed in 1.05s =====================================================================================

Manual End-to-End (E2E) Tests:

Ran adk run contributing/samples/hello_world_gemma4 with success

Checklist

  • [ X ] I have read the CONTRIBUTING.md document.
  • [ X ] I have performed a self-review of my own code.
  • [ X ] I have commented my code, particularly in hard-to-understand areas.
  • [ X ] I have added tests that prove my fix is effective or that my feature works.
  • [ X ] New and existing unit tests pass locally with my changes.
  • [ X ] I have manually tested my changes end-to-end.
  • [ X ] Any dependent changes have been merged and published in downstream modules.

Additional context

@adk-bot adk-bot added the models [Component] Issues related to model support label Apr 2, 2026
@douglas-reid douglas-reid changed the title docs(models): clarify Gemma 3 classes, add Gemma 4 sample feat(gemma4): support Gemma4 in Gemini Apr 2, 2026
@rohityan rohityan self-assigned this Apr 2, 2026
@rohityan
Copy link
Copy Markdown
Collaborator

Hi @douglas-reid , Thank you for your contribution through this pull request! This PR has merge conflicts that require changes from your end. Could you please rebase your branch with the latest main branch to address these? Once this is complete, please let us know so we can proceed with the review.

@rohityan rohityan added the request clarification [Status] The maintainer need clarification or more information from the author label Apr 13, 2026
@douglas-reid
Copy link
Copy Markdown
Contributor Author

Hi @douglas-reid , Thank you for your contribution through this pull request! This PR has merge conflicts that require changes from your end. Could you please rebase your branch with the latest main branch to address these? Once this is complete, please let us know so we can proceed with the review.

Should be done now. Please let me know if more is needed.

- Update docstrings for Gemma, Gemma3Ollama, and
  GemmaFunctionCallingMixin to clarify they are Gemma 3-only
- Add Gemma 4 usage guidance pointing to Gemini/LiteLlm classes
- Add hello_world_gemma4 sample using standard Gemini class
- Add header comments and READMEs to existing Gemma 3 samples
- Add registry non-collision test for Gemma 4 model strings
- Update registration comments in models/__init__.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

models [Component] Issues related to model support request clarification [Status] The maintainer need clarification or more information from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants