Skip to content

feat(providers): add gemini provider (Google Gemini) - #129

Merged
David Koleczek (DavidKoleczek) merged 4 commits into
mainfrom
add-provider-gemini
Aug 18, 2026
Merged

feat(providers): add gemini provider (Google Gemini)#129
David Koleczek (DavidKoleczek) merged 4 commits into
mainfrom
add-provider-gemini

Conversation

@bkrabach

Copy link
Copy Markdown
Contributor

Summary

Adds gemini as a first-class provider in amplifier-agent's provider catalog, wiring up the existing official module amplifier-module-provider-gemini — Google Gemini via the Google AI API. It is a normal API-key provider (like anthropic/openai). Listed in the ecosystem MODULES.md; this completes another gap in amplifier-agent's hardcoded provider set (sibling to #127 / #128).

What changed

Code

  • config/loader.py: add gemini to _VALID_PROVIDER_MODULES.
  • provider_sources.py: add to KNOWN_PROVIDERS, PROVIDER_CATALOG, and PROVIDER_CREDENTIAL_VARS (registered as GOOGLE_API_KEY). The module also accepts GEMINI_API_KEY; only the primary is listed to avoid a spurious deprecation notice (same pattern as github-copilot). Uses the existing generic credential path — no dedicated branch, and auth set gemini works normally.
  • bundle.md: declare provider-gemini in the install-only stub list.

Docs: README, docs/spec/*, docs/CONFIGURATION.md, docs/LAYERS_AND_RELEASES.md, docs/INTEGRATION.md, docs/architecture/architecture.dot, skills/amplifier-agent/SKILL.md, CHANGELOG.md.

Also incidentally corrects two pre-existing stale provider counts in docs/spec/host-config.md ("six valid module names", "outside the 5 valid names") that had fallen behind earlier catalog merges — both now reflect the true current count.

Verification (Digital Twin, real Google Gemini — no mocks)

Verified end-to-end in an isolated container running the patched build (amplifier-agent 0.12.0) against the real Google AI API (gemini-2.5-flash). The API key was handled by reference only and never left the container.

  • providers list: gemini appears; resolvable=false/source=none with GOOGLE_API_KEY unset, flips to resolvable=true/source=env when set.
  • Loader negative control: an invalid provider.module is rejected with a valid set that now includes gemini.
  • Real turn: amplifier-agent run returned a correct gemini-2.5-flash completion ("gemini live") with a clean terminated envelope (provider=gemini, model=gemini-2.5-flash).
  • Routing proven causally: blackholing generativelanguage.googleapis.com made the same turn fail with a connect error whose traceback runs through provider-gemini; restoring it made it succeed. No fallback was possible (only gemini resolvable).
  • Cold-prepare succeeds with the 8-provider bundle.md; the prepared bundle declares provider-gemini.

- Added 'gemini' to _VALID_PROVIDER_MODULES in loader.py
- Registered in KNOWN_PROVIDERS, PROVIDER_CATALOG, and PROVIDER_CREDENTIAL_VARS
- Uses standard GOOGLE_API_KEY credential path (no custom branch needed)
- Added to bundle.md provider stub list

Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
- Updated README with gemini provider listing
- Added CHANGELOG entry for provider addition
- Updated CONFIGURATION.md with gemini config example
- Updated providers-and-models.md specification with Gemini details
- Updated host-config.md credential documentation
- Updated bundle-and-cache.md provider reference
- Updated LAYERS_AND_RELEASES.md version notes
- Updated INTEGRATION.md with gemini integration info
- Updated architecture.dot diagram to reflect new provider
- Updated SKILL.md with gemini provider documentation

Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Covers the catalog registration that made gemini the eighth supported
provider: `providers list` reports it against the provider-gemini module
and GOOGLE_API_KEY, `models list --provider gemini` returns a live listing,
a host config naming it passes validation, and a session completes against
it.

Forward GOOGLE_API_KEY through the e2e DTU profile so the suite can reach
Google. GOOGLE_API_KEY is the canonical variable: the Google GenAI SDK also
accepts GEMINI_API_KEY, but GOOGLE_API_KEY takes precedence and is the sole
entry in PROVIDER_CREDENTIAL_VARS, so it is what `providers list` and
`models list` actually consult.

The suite skips rather than fails when the credential is absent from the
container, unlike github_copilot which fails loud. Its cases guard the
shared provider catalog, so it runs on every full `cli.py run`; failing the
default run for a contributor with no Google key would be red for a reason
unrelated to their change.

Note: with a Google key present, `serve` auto-enables gemini from resolvable
credentials, so the shared in-DTU HTTP server lists gemini models alongside
anthropic. Existing HTTP suites resolve a model id at runtime and are
unaffected.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@DavidKoleczek
David Koleczek (DavidKoleczek) merged commit a4a9c04 into main Aug 18, 2026
3 checks passed
David Koleczek (DavidKoleczek) added a commit that referenced this pull request Aug 19, 2026
main added gemini as the eighth provider (#129) while this branch added vllm
as the eighth. Both are now registered, making nine, and every "eight
providers" reference has been updated to match.

Conflicts resolved by keeping both providers in each list:

- provider_sources.py: KNOWN_PROVIDERS and PROVIDER_CATALOG (verified in sync)
- config/loader.py: _VALID_PROVIDER_MODULES, reflowed to one name per line
- bundle/bundle.md: both install-only provider stubs
- CHANGELOG.md: the vllm entry moved from [0.13.0] to [Unreleased], since
  0.13.0 was cut on main before this branch's work landed
- README.md, LAYERS_AND_RELEASES.md, architecture.dot, SKILL.md,
  INTEGRATION.md, spec/host-config.md, spec/bundle-and-cache.md,
  spec/providers-and-models.md: provider counts and lists

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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.

3 participants