Repository navigation
Route Gemini gateway traffic through Vertex AI - #9893
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 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() |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
generateContentandstreamGenerateContentusing Workload Identity / Application Default Credentials; remove the gateway Gemini Developer API-key path.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.yamland production equivalentDeployment prerequisite
Set each GitHub environment's
LLM_GATEWAY_GSAvariable 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.