feat(gemini): route Gemini CLI through a Model Provider Service - #417
Open
variablenerd wants to merge 2 commits into
Open
feat(gemini): route Gemini CLI through a Model Provider Service#417variablenerd wants to merge 2 commits into
variablenerd wants to merge 2 commits into
Conversation
`ucode gemini` could only run Databricks-hosted models. Provider routing (`--provider`) was wired for claude and codex but not gemini, so a Gemini Enterprise Model Provider Service registered in Unity Catalog was unreachable. Extend the existing `--provider` path to gemini: add `gemini_enterprise` to the tool/provider-type map, emit the `Databricks-Model-Provider-Service` header via `GEMINI_CLI_CUSTOM_HEADERS`, and pin the service's target model (chosen with `--model` when it declares several). The routing header is re-emitted on token refresh, and `ucode configure` offers gemini the provider picker. Co-authored-by: Isaac <no-reply@databricks.com>
variablenerd
force-pushed
the
feat/gemini-model-provider-service
branch
from
August 30, 2026 18:01
156a672 to
e852953
Compare
Keep one test per new code path: the MPS routing header, target-model resolution (happy + not-a-target), and gemini_enterprise resolving for gemini. Co-authored-by: Isaac <no-reply@databricks.com>
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.
Users need to access Model Provider Services in Unity Gateway via ucode and Gemini CLI.
--providerrouting existed for Claude and Codex but not Gemini, so a Gemini Enterprise Model Provider Service registered in Unity Gateway was unreachable.This extends the existing
--providerpath to Gemini:databricks.py— addgemini_enterpriseto the tool→provider-type map so the service resolves for Gemini.agents/gemini.py— emit theDatabricks-Model-Provider-Serviceheader (viaGEMINI_CLI_CUSTOM_HEADERS) and pin the service's target model; re-emitted on token refresh.agents/__init__.py—resolve_gemini_provider_modelpicks the target (--modelwhen the service declares several); pass the provider throughconfigure_tool.cli.py—--provider/--modelonucode gemini;ucode configureoffers Gemini the provider picker.Commands:
Verified end-to-end against a Gemini Enterprise MPS: the gateway returns
HTTP 200forPOST /ai-gateway/gemini/v1beta/models/<target>:generateContentwith theDatabricks-Model-Provider-Serviceheader.Tests:
uv run pytest(added focused tests intest_agent_gemini.py,test_agents_init.py,test_databricks.py),uv run ruff check .,uv run ruff format --check.