adds support for gemini API - #339
Open
charchit7 wants to merge 1 commit into
Open
Conversation
charchit7
marked this pull request as draft
June 22, 2026 14:15
charchit7
force-pushed
the
cs/gemini_support
branch
from
June 22, 2026 14:18
518a977 to
99de9d8
Compare
charchit7
marked this pull request as ready for review
June 22, 2026 14:20
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.
What
Adds Google Gemini as a first-class model provider, selectable via the
gemini/<model>(Google AI Studio) andvertex_ai/<model>(Vertex AI) idprefixes.
Previously any
gemini/�id fell through to the HuggingFace router catch-alland was misrouted (e.g.
openai/gemini/�). This wires Gemini throughLiteLLM's native Google adapters instead.
Changes
agent/core/llm_params.py: newgemini/+vertex_ai/branch in_resolve_llm_params. Forwardsreasoning_effortas a top-level kwarg,which LiteLLM translates into the thinking budget for Gemini 2.5+ thinking
models. Adds
_GEMINI_EFFORTS = {low, medium, high};minimalnormalizesto
low, andxhigh/maxare handled by the existing effort cascade(no per-model capability table, consistent with the other providers).
agent/core/model_switcher.py: addsgemini/gemini-2.5-proandgemini/gemini-2.5-flashto the/modelsuggestions, marksgemini/andvertex_ai/as direct prefixes (skip the HF router catalog lookup), andupdates the
/modelhelp text andis_valid_model_iddocstring.tests/unit/test_llm_params.py: 6 new tests � effort forwarding,vertex_ai/route,minimal�lownormalization, strict-mode rejection ofunsupported efforts, non-strict effort drop, and that Gemini is not routed
through the HF router.
Usage
@lewtun Please review whenever you are free.