Uh oh!
There was an error while loading. Please reload this page.
refactor: rename provider 'gemini' to 'google' to match models.dev - #279
Conversation
Align the data-plane provider ID with models.dev's canonical provider identifier. The upstream API endpoint and behavior are unchanged — only the wire-level provider string changes from "gemini" to "google". - Rename Provider::Gemini → Provider::Google - Rename crate aisix-provider-gemini → aisix-provider-google - Update all schema enums, OpenAPI specs, test fixtures, and docs Ref: api7/AISIX-Cloud#290
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR replaces the upstream provider identity ChangesProvider Identity Refactor: Gemini → Google
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/aisix-core/src/models/model.rs (1)
22-27:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPreserve backward deserialization for legacy
"gemini"provider values.After this rename, any persisted model JSON still containing
"provider": "gemini"will fail to deserialize. Add a serde alias so reads stay backward-compatible while writes continue emitting"google".Suggested patch
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum Provider { Openai, Anthropic, + #[serde(alias = "gemini")] Google, Deepseek,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/aisix-core/src/models/model.rs` around lines 22 - 27, The Provider enum's Google variant must accept legacy "gemini" strings when deserializing; update the enum definition (enum Provider) to add a serde alias for the Google variant (e.g., annotate the Google variant with a serde alias "gemini") so reads remain backward-compatible while writes still emit "google" (leaving the existing #[serde(rename_all = "lowercase")] in place).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/aisix-admin/src/openapi.rs`:
- Line 274: OpenAPI's Model.provider enum is missing "cohere" and "jina",
causing the spec to diverge from runtime validation; update the provider enum
definition (the line containing "provider": {"type":"string","enum":[...]} in
openapi.rs) to include "cohere" and "jina" so the documented values match the
runtime Model.provider validation and accepted inputs.
In `@docs/tutorials/openai-client-to-anthropic-upstream.md`:
- Line 155: Two remaining docs still reference "Gemini"/"gemini"; update those
mentions to "Google"/"google" to match the code/schema change. Specifically,
search for the literal strings "Gemini", "gemini", and the phrase "Gemini's
OpenAI-compatible surface" in the documentation and replace them with "Google",
"google", and "Google's OpenAI-compatible surface" respectively so the provider
name is consistent with the enum and earlier diff.
---
Outside diff comments:
In `@crates/aisix-core/src/models/model.rs`:
- Around line 22-27: The Provider enum's Google variant must accept legacy
"gemini" strings when deserializing; update the enum definition (enum Provider)
to add a serde alias for the Google variant (e.g., annotate the Google variant
with a serde alias "gemini") so reads remain backward-compatible while writes
still emit "google" (leaving the existing #[serde(rename_all = "lowercase")] in
place).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5b743e09-61ea-4796-9432-b83ac956297c
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (25)
Cargo.tomlcrates/aisix-admin/src/openapi.rscrates/aisix-core/src/models/model.rscrates/aisix-core/src/models/schema.rscrates/aisix-provider-google/Cargo.tomlcrates/aisix-provider-google/src/lib.rscrates/aisix-provider-openai/src/bridge.rscrates/aisix-proxy/Cargo.tomlcrates/aisix-proxy/src/lib.rscrates/aisix-proxy/src/messages.rscrates/aisix-proxy/src/passthrough.rscrates/aisix-proxy/src/rerank.rscrates/aisix-server/Cargo.tomlcrates/aisix-server/src/main.rsdocs/configuration/models.mddocs/configuration/provider-keys.mddocs/integration/anthropic-messages.mddocs/overview/core-concepts.mddocs/overview/what-is-aisix-ai-gateway.mddocs/quickstart/first-model-first-key-first-request.mddocs/reference/provider-compatibility.mddocs/tutorials/openai-client-to-anthropic-upstream.mdtests/e2e/src/cases/cross-provider-matrix-e2e.test.tstests/e2e/src/cases/error-envelope-normalization-e2e.test.tstests/e2e/src/cases/responses-endpoint-e2e.test.ts
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
This PR renames the Gemini provider identifier to Google across the data plane to align with models.dev’s canonical google provider ID, while keeping the upstream Gemini/OpenAI-compatible behavior unchanged.
Changes:
- Renames the Rust provider enum/crate dependency path from Gemini/Gemini crate naming to Google.
- Updates provider strings in tests, schemas, OpenAPI, docs, and hub registration.
- Keeps Google Gemini traffic routed through the OpenAI-compatible bridge implementation.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
tests/e2e/src/cases/responses-endpoint-e2e.test.ts | Updates non-OpenAI provider test case from gemini to google. |
tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts | Updates provider union and error-normalization case to google. |
tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts | Updates matrix provider type and case to google. |
docs/tutorials/openai-client-to-anthropic-upstream.md | Updates tutorial provider example to google. |
docs/reference/provider-compatibility.md | Updates documented provider list to google. |
docs/quickstart/first-model-first-key-first-request.md | Updates quickstart api_base guidance to use google. |
docs/overview/what-is-aisix-ai-gateway.md | Updates overview provider enum list to google. |
docs/overview/core-concepts.md | Updates core concepts provider enum list to google. |
docs/integration/anthropic-messages.md | Updates non-Anthropic upstream provider list to google. |
docs/configuration/provider-keys.md | Updates provider-key api_base table and guidance to google. |
docs/configuration/models.md | Updates model configuration provider list to google. |
crates/aisix-server/src/main.rs | Registers the renamed Provider::Google bridge in the hub. |
crates/aisix-server/Cargo.toml | Switches server dependency to aisix-provider-google. |
crates/aisix-proxy/src/rerank.rs | Updates rerank unsupported-provider match arm to Provider::Google. |
crates/aisix-proxy/src/passthrough.rs | Updates passthrough default base provider prefix to google. |
crates/aisix-proxy/src/messages.rs | Updates message-path tests and registrations to Provider::Google. |
crates/aisix-proxy/src/lib.rs | Updates proxy matrix tests to use google. |
crates/aisix-proxy/Cargo.toml | Switches proxy dev dependency to aisix-provider-google. |
crates/aisix-provider-openai/src/bridge.rs | Adds Google-specific default-base handling for the OpenAI-compatible bridge. |
crates/aisix-provider-google/src/lib.rs | Renames crate docs/constants and relabels bridge name to google. |
crates/aisix-provider-google/Cargo.toml | Renames package to aisix-provider-google. |
crates/aisix-core/src/models/schema.rs | Updates model JSON schema provider enum to google. |
crates/aisix-core/src/models/model.rs | Renames Provider::Gemini to Provider::Google. |
crates/aisix-admin/src/openapi.rs | Updates OpenAPI model provider enum to google. |
Cargo.toml | Updates workspace member path to aisix-provider-google. |
Cargo.lock | Updates lockfile package/dependency names to aisix-provider-google. |
Comments suppressed due to low confidence (2)
crates/aisix-provider-google/src/lib.rs:33
- The public factory is still named
gemini_bridgeeven though the crate and provider ID have been renamed togoogle. This leaves downstream callers importingaisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogousdeepseek_bridgefactory.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts:100 - This case now uses provider
google, but the nearby explanatory comment still describes the “gemini bridge.” That makes the test documentation inconsistent with the renamed provider ID.
provider: "google",
upstreamModelId: "gemini-2.0-flash",
displayName: "err-norm-gemini",
// The gemini bridge talks to Google's OpenAI-compatibility
// endpoint per <https://ai.google.dev/gemini-api/docs/openai>,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Add cohere and jina to OpenAPI Model.provider enum - Update docs/feature-matrix.md and provider-keys.md - Fix test name and doc comments in provider-google crate
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Align the data-plane provider ID with models.dev's canonical provider identifier (
google). The upstream API endpoint and behavior are unchanged — only the wire-level provider string changes from"gemini"to"google".Changes:
Provider::Gemini→Provider::Googleaisix-provider-gemini→aisix-provider-googlePart of api7/AISIX-Cloud#290 — the CP will start sending
"google"as the provider id for Google models to match models.dev.Summary by CodeRabbit
Provider Updates
Documentation