Skip to content

Route Gemini gateway traffic through Vertex AI - #9893

Merged
Git-on-my-level merged 1 commit into
mainfrom
codex/vertex-gemini-gateway
Jul 16, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
codex/vertex-gemini-gateway

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Route Gemini gateway traffic through native Vertex AI generateContent and streamGenerateContent using Workload Identity / Application Default Credentials; remove the gateway Gemini Developer API-key path.
  • Keep direct legacy fallbacks on Vertex, surface gateway configuration/authentication failures, and allow temporary fallback only for hard transport failures.
  • Add opt-in, route-owned output budgets for session titles plus bounded completion/budget telemetry, deployment validation, and a real Gemini smoke lane.

Verification

  • cd backend && .venv/bin/pytest -q tests/unit/test_llm_gateway_chat_extraction_pilot.py tests/unit/test_llm_gateway_client_config.py tests/unit/test_llm_gateway_vertex_provider.py tests/unit/test_llm_gateway_output_budget.py tests/unit/test_llm_gateway_validator.py tests/unit/test_llm_gateway_metrics.py tests/unit/test_llm_gateway_openai_compatible.py tests/unit/test_llm_gateway_openai_provider.py tests/unit/test_llm_gateway_executor.py tests/unit/test_llm_gateway_config.py tests/unit/test_llm_gateway_deploy_contract.py tests/unit/test_backend_runtime_env_validator.py (222 passed)
  • PATH="backend/.venv/bin:$PATH" backend/scripts/pre-deploy-check.sh (87 passed)
  • make preflight (21 checks passed)
  • helm lint backend/charts/llm-gateway -f backend/charts/llm-gateway/dev_omi_llm_gateway_values.yaml and production equivalent

Deployment prerequisite

Set each GitHub environment's LLM_GATEWAY_GSA variable and establish its GKE Workload Identity binding plus Vertex invocation IAM permission before deployment. The exact dev/prod Google service-account identities remain platform-owned.

Review in cubic

@mintlify

mintlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 16, 2026, 8:04 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0de6032f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

translated, _ = _vertex_to_openai_stream_chunk(parsed, requested_model=provider_ref.model)
if translated is not None:
yield translated
yield _openai_sse_done()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate DONE on Vertex terminal chunks

For streaming Gemini requests, this always synthesizes an OpenAI [DONE] when the Vertex response iterator ends, even if Vertex never sent a final chunk with a finishReason (for example, an upstream EOF/truncated stream that does not raise httpx.HTTPError). In that case the router sees the fabricated [DONE] and records/delivers a successful complete stream with partial output; the terminal flag returned by _vertex_to_openai_stream_chunk should be tracked and a missing terminal chunk should fail instead of emitting [DONE].

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 3ec21a9 into main Jul 16, 2026
32 of 35 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/vertex-gemini-gateway branch July 16, 2026 20:32

This branch was successfully deployed

1 active deployment
staging - docs — d0de6032 Deployed Jul 16, 2026 by mintlify[bot]
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.

1 participant