refactor: rename provider 'gemini' to 'google' to match models.dev - #279

Merged
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google
May 14, 2026
Merged

refactor: rename provider 'gemini' to 'google' to match models.dev#279
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google

Conversation

@jarvis9443

@jarvis9443jarvis9443 commented May 14, 2026

Copy link
Copy Markdown
Contributor

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::GeminiProvider::Google
  • Rename crate aisix-provider-geminiaisix-provider-google
  • Update all schema enums, OpenAPI specs, test fixtures, and docs

Part 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

    • Replaced "gemini" with "google" across model/provider-key configurations and runtime provider registry; provider enum now lists Google instead of Gemini.
    • Default API-base handling and OpenAI-compatible bridge now recognize the "google" provider.
  • Documentation

    • All docs, quickstarts, and compatibility guides updated to reference "google" in examples and provider lists.

Review Change Stack

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
CopilotAI review requested due to automatic review settings May 14, 2026 14:37
@coderabbitai

coderabbitaiBot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jarvis9443 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ef06c-ea20-4897-bc36-edd19da64ebd

📥 Commits

Reviewing files that changed from the base of the PR and between 76733a4 and 23bc15a.

📒 Files selected for processing (4)
  • docs/configuration/models.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/reference/provider-compatibility.md
📝 Walkthrough

Walkthrough

This PR replaces the upstream provider identity gemini with google across core types/schemas, provider crate and OpenAI-compatible bridge, workspace and crate dependencies, routing defaults, integration and E2E tests, and documentation.

Changes

Provider Identity Refactor: Gemini → Google

Layer / File(s)Summary
Core Provider Type Definition
crates/aisix-core/src/models/model.rs, crates/aisix-core/src/models/schema.rs, crates/aisix-admin/src/openapi.rs
Provider enum replaces Gemini with Google. Default base URL mapping, as_str, JSON schema, and OpenAPI provider enum updated; unit test updated to assert Provider::Google.default_base_url().
Google Provider Bridge Implementation
crates/aisix-provider-google/Cargo.toml, crates/aisix-provider-google/src/lib.rs, crates/aisix-provider-openai/src/bridge.rs
Crate/package renamed to aisix-provider-google. Introduces GOOGLE_DEFAULT_BASE and google_bridge(); OpenAiBridge maps name "google" to GOOGLE_DEFAULT_BASE. Unit tests updated to construct bridges with with_name("google").
Workspace and Dependency Wiring
Cargo.toml, crates/aisix-proxy/Cargo.toml, crates/aisix-server/Cargo.toml, crates/aisix-server/src/main.rs
Workspace members and crate dependency entries updated to reference aisix-provider-google. Server startup imports google_bridge and registers Provider::Google in the Hub.
Request Routing and Default Base Selection
crates/aisix-proxy/src/passthrough.rs, crates/aisix-proxy/src/rerank.rs
Provider-prefix default-base lookup now handles "google" (Generative Language /v1beta/openai shim); rerank mapping updated to use Provider::Google where previously Provider::Gemini was handled.
Integration Test Fixtures and Constants
crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
Test constants and fixtures renamed/repointed: MATRIX_GOOGLE_PK_ID, GOOGLE_PK_ID; fixture JSON provider fields set to "google" and imports adjusted to use google_bridge.
End-to-End and Matrix Tests
tests/e2e/src/cases/*, crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
E2E provider unions and case entries updated to use provider: "google". Matrix test wiring and SSE/shared helpers switched to Provider::Google and google_bridge() imports.
Documentation Updates
docs/* (models, provider-keys, integration guides, quickstart, feature matrix, compatibility)
User-facing docs updated to list google instead of gemini, update canonical api_base table and tolerance guidance, and reflect provider enum changes and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: renaming the provider from 'gemini' to 'google' throughout the codebase to match models.dev canonical naming.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

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 win

Preserve 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f57ed6 and 1a70017.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • Cargo.toml
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/model.rs
  • crates/aisix-core/src/models/schema.rs
  • crates/aisix-provider-google/Cargo.toml
  • crates/aisix-provider-google/src/lib.rs
  • crates/aisix-provider-openai/src/bridge.rs
  • crates/aisix-proxy/Cargo.toml
  • crates/aisix-proxy/src/lib.rs
  • crates/aisix-proxy/src/messages.rs
  • crates/aisix-proxy/src/passthrough.rs
  • crates/aisix-proxy/src/rerank.rs
  • crates/aisix-server/Cargo.toml
  • crates/aisix-server/src/main.rs
  • docs/configuration/models.md
  • docs/configuration/provider-keys.md
  • docs/integration/anthropic-messages.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/quickstart/first-model-first-key-first-request.md
  • docs/reference/provider-compatibility.md
  • docs/tutorials/openai-client-to-anthropic-upstream.md
  • tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts
  • tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
  • tests/e2e/src/cases/responses-endpoint-e2e.test.ts

Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/tutorials/openai-client-to-anthropic-upstream.md

CopilotAI 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.

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
FileDescription
tests/e2e/src/cases/responses-endpoint-e2e.test.tsUpdates non-OpenAI provider test case from gemini to google.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.tsUpdates provider union and error-normalization case to google.
tests/e2e/src/cases/cross-provider-matrix-e2e.test.tsUpdates matrix provider type and case to google.
docs/tutorials/openai-client-to-anthropic-upstream.mdUpdates tutorial provider example to google.
docs/reference/provider-compatibility.mdUpdates documented provider list to google.
docs/quickstart/first-model-first-key-first-request.mdUpdates quickstart api_base guidance to use google.
docs/overview/what-is-aisix-ai-gateway.mdUpdates overview provider enum list to google.
docs/overview/core-concepts.mdUpdates core concepts provider enum list to google.
docs/integration/anthropic-messages.mdUpdates non-Anthropic upstream provider list to google.
docs/configuration/provider-keys.mdUpdates provider-key api_base table and guidance to google.
docs/configuration/models.mdUpdates model configuration provider list to google.
crates/aisix-server/src/main.rsRegisters the renamed Provider::Google bridge in the hub.
crates/aisix-server/Cargo.tomlSwitches server dependency to aisix-provider-google.
crates/aisix-proxy/src/rerank.rsUpdates rerank unsupported-provider match arm to Provider::Google.
crates/aisix-proxy/src/passthrough.rsUpdates passthrough default base provider prefix to google.
crates/aisix-proxy/src/messages.rsUpdates message-path tests and registrations to Provider::Google.
crates/aisix-proxy/src/lib.rsUpdates proxy matrix tests to use google.
crates/aisix-proxy/Cargo.tomlSwitches proxy dev dependency to aisix-provider-google.
crates/aisix-provider-openai/src/bridge.rsAdds Google-specific default-base handling for the OpenAI-compatible bridge.
crates/aisix-provider-google/src/lib.rsRenames crate docs/constants and relabels bridge name to google.
crates/aisix-provider-google/Cargo.tomlRenames package to aisix-provider-google.
crates/aisix-core/src/models/schema.rsUpdates model JSON schema provider enum to google.
crates/aisix-core/src/models/model.rsRenames Provider::Gemini to Provider::Google.
crates/aisix-admin/src/openapi.rsUpdates OpenAPI model provider enum to google.
Cargo.tomlUpdates workspace member path to aisix-provider-google.
Cargo.lockUpdates 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_bridge even though the crate and provider ID have been renamed to google. This leaves downstream callers importing aisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogous deepseek_bridge factory.
    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.

Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-core/src/models/model.rs
Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/configuration/models.md Outdated
- 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
CopilotAI review requested due to automatic review settings May 14, 2026 14:55

CopilotAI 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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/configuration/models.md
Comment threadtests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
Sign up for freeto 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.

3 participants

@jarvis9443@nic-6443
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

refactor: rename provider 'gemini' to 'google' to match models.dev - #279

Merged
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google
May 14, 2026
Merged

refactor: rename provider 'gemini' to 'google' to match models.dev#279
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google

Conversation

@jarvis9443

@jarvis9443jarvis9443 commented May 14, 2026

Copy link
Copy Markdown
Contributor

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::GeminiProvider::Google
  • Rename crate aisix-provider-geminiaisix-provider-google
  • Update all schema enums, OpenAPI specs, test fixtures, and docs

Part 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

    • Replaced "gemini" with "google" across model/provider-key configurations and runtime provider registry; provider enum now lists Google instead of Gemini.
    • Default API-base handling and OpenAI-compatible bridge now recognize the "google" provider.
  • Documentation

    • All docs, quickstarts, and compatibility guides updated to reference "google" in examples and provider lists.

Review Change Stack

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
CopilotAI review requested due to automatic review settings May 14, 2026 14:37
@coderabbitai

coderabbitaiBot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jarvis9443 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ef06c-ea20-4897-bc36-edd19da64ebd

📥 Commits

Reviewing files that changed from the base of the PR and between 76733a4 and 23bc15a.

📒 Files selected for processing (4)
  • docs/configuration/models.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/reference/provider-compatibility.md
📝 Walkthrough

Walkthrough

This PR replaces the upstream provider identity gemini with google across core types/schemas, provider crate and OpenAI-compatible bridge, workspace and crate dependencies, routing defaults, integration and E2E tests, and documentation.

Changes

Provider Identity Refactor: Gemini → Google

Layer / File(s)Summary
Core Provider Type Definition
crates/aisix-core/src/models/model.rs, crates/aisix-core/src/models/schema.rs, crates/aisix-admin/src/openapi.rs
Provider enum replaces Gemini with Google. Default base URL mapping, as_str, JSON schema, and OpenAPI provider enum updated; unit test updated to assert Provider::Google.default_base_url().
Google Provider Bridge Implementation
crates/aisix-provider-google/Cargo.toml, crates/aisix-provider-google/src/lib.rs, crates/aisix-provider-openai/src/bridge.rs
Crate/package renamed to aisix-provider-google. Introduces GOOGLE_DEFAULT_BASE and google_bridge(); OpenAiBridge maps name "google" to GOOGLE_DEFAULT_BASE. Unit tests updated to construct bridges with with_name("google").
Workspace and Dependency Wiring
Cargo.toml, crates/aisix-proxy/Cargo.toml, crates/aisix-server/Cargo.toml, crates/aisix-server/src/main.rs
Workspace members and crate dependency entries updated to reference aisix-provider-google. Server startup imports google_bridge and registers Provider::Google in the Hub.
Request Routing and Default Base Selection
crates/aisix-proxy/src/passthrough.rs, crates/aisix-proxy/src/rerank.rs
Provider-prefix default-base lookup now handles "google" (Generative Language /v1beta/openai shim); rerank mapping updated to use Provider::Google where previously Provider::Gemini was handled.
Integration Test Fixtures and Constants
crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
Test constants and fixtures renamed/repointed: MATRIX_GOOGLE_PK_ID, GOOGLE_PK_ID; fixture JSON provider fields set to "google" and imports adjusted to use google_bridge.
End-to-End and Matrix Tests
tests/e2e/src/cases/*, crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
E2E provider unions and case entries updated to use provider: "google". Matrix test wiring and SSE/shared helpers switched to Provider::Google and google_bridge() imports.
Documentation Updates
docs/* (models, provider-keys, integration guides, quickstart, feature matrix, compatibility)
User-facing docs updated to list google instead of gemini, update canonical api_base table and tolerance guidance, and reflect provider enum changes and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: renaming the provider from 'gemini' to 'google' throughout the codebase to match models.dev canonical naming.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

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 win

Preserve 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f57ed6 and 1a70017.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • Cargo.toml
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/model.rs
  • crates/aisix-core/src/models/schema.rs
  • crates/aisix-provider-google/Cargo.toml
  • crates/aisix-provider-google/src/lib.rs
  • crates/aisix-provider-openai/src/bridge.rs
  • crates/aisix-proxy/Cargo.toml
  • crates/aisix-proxy/src/lib.rs
  • crates/aisix-proxy/src/messages.rs
  • crates/aisix-proxy/src/passthrough.rs
  • crates/aisix-proxy/src/rerank.rs
  • crates/aisix-server/Cargo.toml
  • crates/aisix-server/src/main.rs
  • docs/configuration/models.md
  • docs/configuration/provider-keys.md
  • docs/integration/anthropic-messages.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/quickstart/first-model-first-key-first-request.md
  • docs/reference/provider-compatibility.md
  • docs/tutorials/openai-client-to-anthropic-upstream.md
  • tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts
  • tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
  • tests/e2e/src/cases/responses-endpoint-e2e.test.ts

Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/tutorials/openai-client-to-anthropic-upstream.md

CopilotAI 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.

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
FileDescription
tests/e2e/src/cases/responses-endpoint-e2e.test.tsUpdates non-OpenAI provider test case from gemini to google.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.tsUpdates provider union and error-normalization case to google.
tests/e2e/src/cases/cross-provider-matrix-e2e.test.tsUpdates matrix provider type and case to google.
docs/tutorials/openai-client-to-anthropic-upstream.mdUpdates tutorial provider example to google.
docs/reference/provider-compatibility.mdUpdates documented provider list to google.
docs/quickstart/first-model-first-key-first-request.mdUpdates quickstart api_base guidance to use google.
docs/overview/what-is-aisix-ai-gateway.mdUpdates overview provider enum list to google.
docs/overview/core-concepts.mdUpdates core concepts provider enum list to google.
docs/integration/anthropic-messages.mdUpdates non-Anthropic upstream provider list to google.
docs/configuration/provider-keys.mdUpdates provider-key api_base table and guidance to google.
docs/configuration/models.mdUpdates model configuration provider list to google.
crates/aisix-server/src/main.rsRegisters the renamed Provider::Google bridge in the hub.
crates/aisix-server/Cargo.tomlSwitches server dependency to aisix-provider-google.
crates/aisix-proxy/src/rerank.rsUpdates rerank unsupported-provider match arm to Provider::Google.
crates/aisix-proxy/src/passthrough.rsUpdates passthrough default base provider prefix to google.
crates/aisix-proxy/src/messages.rsUpdates message-path tests and registrations to Provider::Google.
crates/aisix-proxy/src/lib.rsUpdates proxy matrix tests to use google.
crates/aisix-proxy/Cargo.tomlSwitches proxy dev dependency to aisix-provider-google.
crates/aisix-provider-openai/src/bridge.rsAdds Google-specific default-base handling for the OpenAI-compatible bridge.
crates/aisix-provider-google/src/lib.rsRenames crate docs/constants and relabels bridge name to google.
crates/aisix-provider-google/Cargo.tomlRenames package to aisix-provider-google.
crates/aisix-core/src/models/schema.rsUpdates model JSON schema provider enum to google.
crates/aisix-core/src/models/model.rsRenames Provider::Gemini to Provider::Google.
crates/aisix-admin/src/openapi.rsUpdates OpenAPI model provider enum to google.
Cargo.tomlUpdates workspace member path to aisix-provider-google.
Cargo.lockUpdates 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_bridge even though the crate and provider ID have been renamed to google. This leaves downstream callers importing aisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogous deepseek_bridge factory.
    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.

Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-core/src/models/model.rs
Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/configuration/models.md Outdated
- 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
CopilotAI review requested due to automatic review settings May 14, 2026 14:55

CopilotAI 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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/configuration/models.md
Comment threadtests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
Sign up for freeto 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.

3 participants

@jarvis9443@nic-6443
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

refactor: rename provider 'gemini' to 'google' to match models.dev - #279

Merged
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google
May 14, 2026
Merged

refactor: rename provider 'gemini' to 'google' to match models.dev#279
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google

Conversation

@jarvis9443

@jarvis9443jarvis9443 commented May 14, 2026

Copy link
Copy Markdown
Contributor

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::GeminiProvider::Google
  • Rename crate aisix-provider-geminiaisix-provider-google
  • Update all schema enums, OpenAPI specs, test fixtures, and docs

Part 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

    • Replaced "gemini" with "google" across model/provider-key configurations and runtime provider registry; provider enum now lists Google instead of Gemini.
    • Default API-base handling and OpenAI-compatible bridge now recognize the "google" provider.
  • Documentation

    • All docs, quickstarts, and compatibility guides updated to reference "google" in examples and provider lists.

Review Change Stack

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
CopilotAI review requested due to automatic review settings May 14, 2026 14:37
@coderabbitai

coderabbitaiBot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jarvis9443 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ef06c-ea20-4897-bc36-edd19da64ebd

📥 Commits

Reviewing files that changed from the base of the PR and between 76733a4 and 23bc15a.

📒 Files selected for processing (4)
  • docs/configuration/models.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/reference/provider-compatibility.md
📝 Walkthrough

Walkthrough

This PR replaces the upstream provider identity gemini with google across core types/schemas, provider crate and OpenAI-compatible bridge, workspace and crate dependencies, routing defaults, integration and E2E tests, and documentation.

Changes

Provider Identity Refactor: Gemini → Google

Layer / File(s)Summary
Core Provider Type Definition
crates/aisix-core/src/models/model.rs, crates/aisix-core/src/models/schema.rs, crates/aisix-admin/src/openapi.rs
Provider enum replaces Gemini with Google. Default base URL mapping, as_str, JSON schema, and OpenAPI provider enum updated; unit test updated to assert Provider::Google.default_base_url().
Google Provider Bridge Implementation
crates/aisix-provider-google/Cargo.toml, crates/aisix-provider-google/src/lib.rs, crates/aisix-provider-openai/src/bridge.rs
Crate/package renamed to aisix-provider-google. Introduces GOOGLE_DEFAULT_BASE and google_bridge(); OpenAiBridge maps name "google" to GOOGLE_DEFAULT_BASE. Unit tests updated to construct bridges with with_name("google").
Workspace and Dependency Wiring
Cargo.toml, crates/aisix-proxy/Cargo.toml, crates/aisix-server/Cargo.toml, crates/aisix-server/src/main.rs
Workspace members and crate dependency entries updated to reference aisix-provider-google. Server startup imports google_bridge and registers Provider::Google in the Hub.
Request Routing and Default Base Selection
crates/aisix-proxy/src/passthrough.rs, crates/aisix-proxy/src/rerank.rs
Provider-prefix default-base lookup now handles "google" (Generative Language /v1beta/openai shim); rerank mapping updated to use Provider::Google where previously Provider::Gemini was handled.
Integration Test Fixtures and Constants
crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
Test constants and fixtures renamed/repointed: MATRIX_GOOGLE_PK_ID, GOOGLE_PK_ID; fixture JSON provider fields set to "google" and imports adjusted to use google_bridge.
End-to-End and Matrix Tests
tests/e2e/src/cases/*, crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
E2E provider unions and case entries updated to use provider: "google". Matrix test wiring and SSE/shared helpers switched to Provider::Google and google_bridge() imports.
Documentation Updates
docs/* (models, provider-keys, integration guides, quickstart, feature matrix, compatibility)
User-facing docs updated to list google instead of gemini, update canonical api_base table and tolerance guidance, and reflect provider enum changes and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: renaming the provider from 'gemini' to 'google' throughout the codebase to match models.dev canonical naming.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

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 win

Preserve 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f57ed6 and 1a70017.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • Cargo.toml
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/model.rs
  • crates/aisix-core/src/models/schema.rs
  • crates/aisix-provider-google/Cargo.toml
  • crates/aisix-provider-google/src/lib.rs
  • crates/aisix-provider-openai/src/bridge.rs
  • crates/aisix-proxy/Cargo.toml
  • crates/aisix-proxy/src/lib.rs
  • crates/aisix-proxy/src/messages.rs
  • crates/aisix-proxy/src/passthrough.rs
  • crates/aisix-proxy/src/rerank.rs
  • crates/aisix-server/Cargo.toml
  • crates/aisix-server/src/main.rs
  • docs/configuration/models.md
  • docs/configuration/provider-keys.md
  • docs/integration/anthropic-messages.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/quickstart/first-model-first-key-first-request.md
  • docs/reference/provider-compatibility.md
  • docs/tutorials/openai-client-to-anthropic-upstream.md
  • tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts
  • tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
  • tests/e2e/src/cases/responses-endpoint-e2e.test.ts

Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/tutorials/openai-client-to-anthropic-upstream.md

CopilotAI 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.

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
FileDescription
tests/e2e/src/cases/responses-endpoint-e2e.test.tsUpdates non-OpenAI provider test case from gemini to google.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.tsUpdates provider union and error-normalization case to google.
tests/e2e/src/cases/cross-provider-matrix-e2e.test.tsUpdates matrix provider type and case to google.
docs/tutorials/openai-client-to-anthropic-upstream.mdUpdates tutorial provider example to google.
docs/reference/provider-compatibility.mdUpdates documented provider list to google.
docs/quickstart/first-model-first-key-first-request.mdUpdates quickstart api_base guidance to use google.
docs/overview/what-is-aisix-ai-gateway.mdUpdates overview provider enum list to google.
docs/overview/core-concepts.mdUpdates core concepts provider enum list to google.
docs/integration/anthropic-messages.mdUpdates non-Anthropic upstream provider list to google.
docs/configuration/provider-keys.mdUpdates provider-key api_base table and guidance to google.
docs/configuration/models.mdUpdates model configuration provider list to google.
crates/aisix-server/src/main.rsRegisters the renamed Provider::Google bridge in the hub.
crates/aisix-server/Cargo.tomlSwitches server dependency to aisix-provider-google.
crates/aisix-proxy/src/rerank.rsUpdates rerank unsupported-provider match arm to Provider::Google.
crates/aisix-proxy/src/passthrough.rsUpdates passthrough default base provider prefix to google.
crates/aisix-proxy/src/messages.rsUpdates message-path tests and registrations to Provider::Google.
crates/aisix-proxy/src/lib.rsUpdates proxy matrix tests to use google.
crates/aisix-proxy/Cargo.tomlSwitches proxy dev dependency to aisix-provider-google.
crates/aisix-provider-openai/src/bridge.rsAdds Google-specific default-base handling for the OpenAI-compatible bridge.
crates/aisix-provider-google/src/lib.rsRenames crate docs/constants and relabels bridge name to google.
crates/aisix-provider-google/Cargo.tomlRenames package to aisix-provider-google.
crates/aisix-core/src/models/schema.rsUpdates model JSON schema provider enum to google.
crates/aisix-core/src/models/model.rsRenames Provider::Gemini to Provider::Google.
crates/aisix-admin/src/openapi.rsUpdates OpenAPI model provider enum to google.
Cargo.tomlUpdates workspace member path to aisix-provider-google.
Cargo.lockUpdates 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_bridge even though the crate and provider ID have been renamed to google. This leaves downstream callers importing aisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogous deepseek_bridge factory.
    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.

Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-core/src/models/model.rs
Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/configuration/models.md Outdated
- 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
CopilotAI review requested due to automatic review settings May 14, 2026 14:55

CopilotAI 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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/configuration/models.md
Comment threadtests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
Sign up for freeto 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.

3 participants

@jarvis9443@nic-6443
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

refactor: rename provider 'gemini' to 'google' to match models.dev - #279

Merged
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google
May 14, 2026
Merged

refactor: rename provider 'gemini' to 'google' to match models.dev#279
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google

Conversation

@jarvis9443

@jarvis9443jarvis9443 commented May 14, 2026

Copy link
Copy Markdown
Contributor

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::GeminiProvider::Google
  • Rename crate aisix-provider-geminiaisix-provider-google
  • Update all schema enums, OpenAPI specs, test fixtures, and docs

Part 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

    • Replaced "gemini" with "google" across model/provider-key configurations and runtime provider registry; provider enum now lists Google instead of Gemini.
    • Default API-base handling and OpenAI-compatible bridge now recognize the "google" provider.
  • Documentation

    • All docs, quickstarts, and compatibility guides updated to reference "google" in examples and provider lists.

Review Change Stack

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
CopilotAI review requested due to automatic review settings May 14, 2026 14:37
@coderabbitai

coderabbitaiBot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jarvis9443 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ef06c-ea20-4897-bc36-edd19da64ebd

📥 Commits

Reviewing files that changed from the base of the PR and between 76733a4 and 23bc15a.

📒 Files selected for processing (4)
  • docs/configuration/models.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/reference/provider-compatibility.md
📝 Walkthrough

Walkthrough

This PR replaces the upstream provider identity gemini with google across core types/schemas, provider crate and OpenAI-compatible bridge, workspace and crate dependencies, routing defaults, integration and E2E tests, and documentation.

Changes

Provider Identity Refactor: Gemini → Google

Layer / File(s)Summary
Core Provider Type Definition
crates/aisix-core/src/models/model.rs, crates/aisix-core/src/models/schema.rs, crates/aisix-admin/src/openapi.rs
Provider enum replaces Gemini with Google. Default base URL mapping, as_str, JSON schema, and OpenAPI provider enum updated; unit test updated to assert Provider::Google.default_base_url().
Google Provider Bridge Implementation
crates/aisix-provider-google/Cargo.toml, crates/aisix-provider-google/src/lib.rs, crates/aisix-provider-openai/src/bridge.rs
Crate/package renamed to aisix-provider-google. Introduces GOOGLE_DEFAULT_BASE and google_bridge(); OpenAiBridge maps name "google" to GOOGLE_DEFAULT_BASE. Unit tests updated to construct bridges with with_name("google").
Workspace and Dependency Wiring
Cargo.toml, crates/aisix-proxy/Cargo.toml, crates/aisix-server/Cargo.toml, crates/aisix-server/src/main.rs
Workspace members and crate dependency entries updated to reference aisix-provider-google. Server startup imports google_bridge and registers Provider::Google in the Hub.
Request Routing and Default Base Selection
crates/aisix-proxy/src/passthrough.rs, crates/aisix-proxy/src/rerank.rs
Provider-prefix default-base lookup now handles "google" (Generative Language /v1beta/openai shim); rerank mapping updated to use Provider::Google where previously Provider::Gemini was handled.
Integration Test Fixtures and Constants
crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
Test constants and fixtures renamed/repointed: MATRIX_GOOGLE_PK_ID, GOOGLE_PK_ID; fixture JSON provider fields set to "google" and imports adjusted to use google_bridge.
End-to-End and Matrix Tests
tests/e2e/src/cases/*, crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
E2E provider unions and case entries updated to use provider: "google". Matrix test wiring and SSE/shared helpers switched to Provider::Google and google_bridge() imports.
Documentation Updates
docs/* (models, provider-keys, integration guides, quickstart, feature matrix, compatibility)
User-facing docs updated to list google instead of gemini, update canonical api_base table and tolerance guidance, and reflect provider enum changes and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: renaming the provider from 'gemini' to 'google' throughout the codebase to match models.dev canonical naming.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

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 win

Preserve 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f57ed6 and 1a70017.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • Cargo.toml
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/model.rs
  • crates/aisix-core/src/models/schema.rs
  • crates/aisix-provider-google/Cargo.toml
  • crates/aisix-provider-google/src/lib.rs
  • crates/aisix-provider-openai/src/bridge.rs
  • crates/aisix-proxy/Cargo.toml
  • crates/aisix-proxy/src/lib.rs
  • crates/aisix-proxy/src/messages.rs
  • crates/aisix-proxy/src/passthrough.rs
  • crates/aisix-proxy/src/rerank.rs
  • crates/aisix-server/Cargo.toml
  • crates/aisix-server/src/main.rs
  • docs/configuration/models.md
  • docs/configuration/provider-keys.md
  • docs/integration/anthropic-messages.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/quickstart/first-model-first-key-first-request.md
  • docs/reference/provider-compatibility.md
  • docs/tutorials/openai-client-to-anthropic-upstream.md
  • tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts
  • tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
  • tests/e2e/src/cases/responses-endpoint-e2e.test.ts

Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/tutorials/openai-client-to-anthropic-upstream.md

CopilotAI 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.

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
FileDescription
tests/e2e/src/cases/responses-endpoint-e2e.test.tsUpdates non-OpenAI provider test case from gemini to google.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.tsUpdates provider union and error-normalization case to google.
tests/e2e/src/cases/cross-provider-matrix-e2e.test.tsUpdates matrix provider type and case to google.
docs/tutorials/openai-client-to-anthropic-upstream.mdUpdates tutorial provider example to google.
docs/reference/provider-compatibility.mdUpdates documented provider list to google.
docs/quickstart/first-model-first-key-first-request.mdUpdates quickstart api_base guidance to use google.
docs/overview/what-is-aisix-ai-gateway.mdUpdates overview provider enum list to google.
docs/overview/core-concepts.mdUpdates core concepts provider enum list to google.
docs/integration/anthropic-messages.mdUpdates non-Anthropic upstream provider list to google.
docs/configuration/provider-keys.mdUpdates provider-key api_base table and guidance to google.
docs/configuration/models.mdUpdates model configuration provider list to google.
crates/aisix-server/src/main.rsRegisters the renamed Provider::Google bridge in the hub.
crates/aisix-server/Cargo.tomlSwitches server dependency to aisix-provider-google.
crates/aisix-proxy/src/rerank.rsUpdates rerank unsupported-provider match arm to Provider::Google.
crates/aisix-proxy/src/passthrough.rsUpdates passthrough default base provider prefix to google.
crates/aisix-proxy/src/messages.rsUpdates message-path tests and registrations to Provider::Google.
crates/aisix-proxy/src/lib.rsUpdates proxy matrix tests to use google.
crates/aisix-proxy/Cargo.tomlSwitches proxy dev dependency to aisix-provider-google.
crates/aisix-provider-openai/src/bridge.rsAdds Google-specific default-base handling for the OpenAI-compatible bridge.
crates/aisix-provider-google/src/lib.rsRenames crate docs/constants and relabels bridge name to google.
crates/aisix-provider-google/Cargo.tomlRenames package to aisix-provider-google.
crates/aisix-core/src/models/schema.rsUpdates model JSON schema provider enum to google.
crates/aisix-core/src/models/model.rsRenames Provider::Gemini to Provider::Google.
crates/aisix-admin/src/openapi.rsUpdates OpenAPI model provider enum to google.
Cargo.tomlUpdates workspace member path to aisix-provider-google.
Cargo.lockUpdates 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_bridge even though the crate and provider ID have been renamed to google. This leaves downstream callers importing aisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogous deepseek_bridge factory.
    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.

Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-core/src/models/model.rs
Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/configuration/models.md Outdated
- 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
CopilotAI review requested due to automatic review settings May 14, 2026 14:55

CopilotAI 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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/configuration/models.md
Comment threadtests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
Sign up for freeto 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.

3 participants

@jarvis9443@nic-6443
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

refactor: rename provider 'gemini' to 'google' to match models.dev - #279

Merged
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google
May 14, 2026
Merged

refactor: rename provider 'gemini' to 'google' to match models.dev#279
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google

Conversation

@jarvis9443

@jarvis9443jarvis9443 commented May 14, 2026

Copy link
Copy Markdown
Contributor

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::GeminiProvider::Google
  • Rename crate aisix-provider-geminiaisix-provider-google
  • Update all schema enums, OpenAPI specs, test fixtures, and docs

Part 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

    • Replaced "gemini" with "google" across model/provider-key configurations and runtime provider registry; provider enum now lists Google instead of Gemini.
    • Default API-base handling and OpenAI-compatible bridge now recognize the "google" provider.
  • Documentation

    • All docs, quickstarts, and compatibility guides updated to reference "google" in examples and provider lists.

Review Change Stack

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
CopilotAI review requested due to automatic review settings May 14, 2026 14:37
@coderabbitai

coderabbitaiBot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jarvis9443 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ef06c-ea20-4897-bc36-edd19da64ebd

📥 Commits

Reviewing files that changed from the base of the PR and between 76733a4 and 23bc15a.

📒 Files selected for processing (4)
  • docs/configuration/models.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/reference/provider-compatibility.md
📝 Walkthrough

Walkthrough

This PR replaces the upstream provider identity gemini with google across core types/schemas, provider crate and OpenAI-compatible bridge, workspace and crate dependencies, routing defaults, integration and E2E tests, and documentation.

Changes

Provider Identity Refactor: Gemini → Google

Layer / File(s)Summary
Core Provider Type Definition
crates/aisix-core/src/models/model.rs, crates/aisix-core/src/models/schema.rs, crates/aisix-admin/src/openapi.rs
Provider enum replaces Gemini with Google. Default base URL mapping, as_str, JSON schema, and OpenAPI provider enum updated; unit test updated to assert Provider::Google.default_base_url().
Google Provider Bridge Implementation
crates/aisix-provider-google/Cargo.toml, crates/aisix-provider-google/src/lib.rs, crates/aisix-provider-openai/src/bridge.rs
Crate/package renamed to aisix-provider-google. Introduces GOOGLE_DEFAULT_BASE and google_bridge(); OpenAiBridge maps name "google" to GOOGLE_DEFAULT_BASE. Unit tests updated to construct bridges with with_name("google").
Workspace and Dependency Wiring
Cargo.toml, crates/aisix-proxy/Cargo.toml, crates/aisix-server/Cargo.toml, crates/aisix-server/src/main.rs
Workspace members and crate dependency entries updated to reference aisix-provider-google. Server startup imports google_bridge and registers Provider::Google in the Hub.
Request Routing and Default Base Selection
crates/aisix-proxy/src/passthrough.rs, crates/aisix-proxy/src/rerank.rs
Provider-prefix default-base lookup now handles "google" (Generative Language /v1beta/openai shim); rerank mapping updated to use Provider::Google where previously Provider::Gemini was handled.
Integration Test Fixtures and Constants
crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
Test constants and fixtures renamed/repointed: MATRIX_GOOGLE_PK_ID, GOOGLE_PK_ID; fixture JSON provider fields set to "google" and imports adjusted to use google_bridge.
End-to-End and Matrix Tests
tests/e2e/src/cases/*, crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
E2E provider unions and case entries updated to use provider: "google". Matrix test wiring and SSE/shared helpers switched to Provider::Google and google_bridge() imports.
Documentation Updates
docs/* (models, provider-keys, integration guides, quickstart, feature matrix, compatibility)
User-facing docs updated to list google instead of gemini, update canonical api_base table and tolerance guidance, and reflect provider enum changes and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: renaming the provider from 'gemini' to 'google' throughout the codebase to match models.dev canonical naming.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

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 win

Preserve 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f57ed6 and 1a70017.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • Cargo.toml
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/model.rs
  • crates/aisix-core/src/models/schema.rs
  • crates/aisix-provider-google/Cargo.toml
  • crates/aisix-provider-google/src/lib.rs
  • crates/aisix-provider-openai/src/bridge.rs
  • crates/aisix-proxy/Cargo.toml
  • crates/aisix-proxy/src/lib.rs
  • crates/aisix-proxy/src/messages.rs
  • crates/aisix-proxy/src/passthrough.rs
  • crates/aisix-proxy/src/rerank.rs
  • crates/aisix-server/Cargo.toml
  • crates/aisix-server/src/main.rs
  • docs/configuration/models.md
  • docs/configuration/provider-keys.md
  • docs/integration/anthropic-messages.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/quickstart/first-model-first-key-first-request.md
  • docs/reference/provider-compatibility.md
  • docs/tutorials/openai-client-to-anthropic-upstream.md
  • tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts
  • tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
  • tests/e2e/src/cases/responses-endpoint-e2e.test.ts

Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/tutorials/openai-client-to-anthropic-upstream.md

CopilotAI 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.

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
FileDescription
tests/e2e/src/cases/responses-endpoint-e2e.test.tsUpdates non-OpenAI provider test case from gemini to google.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.tsUpdates provider union and error-normalization case to google.
tests/e2e/src/cases/cross-provider-matrix-e2e.test.tsUpdates matrix provider type and case to google.
docs/tutorials/openai-client-to-anthropic-upstream.mdUpdates tutorial provider example to google.
docs/reference/provider-compatibility.mdUpdates documented provider list to google.
docs/quickstart/first-model-first-key-first-request.mdUpdates quickstart api_base guidance to use google.
docs/overview/what-is-aisix-ai-gateway.mdUpdates overview provider enum list to google.
docs/overview/core-concepts.mdUpdates core concepts provider enum list to google.
docs/integration/anthropic-messages.mdUpdates non-Anthropic upstream provider list to google.
docs/configuration/provider-keys.mdUpdates provider-key api_base table and guidance to google.
docs/configuration/models.mdUpdates model configuration provider list to google.
crates/aisix-server/src/main.rsRegisters the renamed Provider::Google bridge in the hub.
crates/aisix-server/Cargo.tomlSwitches server dependency to aisix-provider-google.
crates/aisix-proxy/src/rerank.rsUpdates rerank unsupported-provider match arm to Provider::Google.
crates/aisix-proxy/src/passthrough.rsUpdates passthrough default base provider prefix to google.
crates/aisix-proxy/src/messages.rsUpdates message-path tests and registrations to Provider::Google.
crates/aisix-proxy/src/lib.rsUpdates proxy matrix tests to use google.
crates/aisix-proxy/Cargo.tomlSwitches proxy dev dependency to aisix-provider-google.
crates/aisix-provider-openai/src/bridge.rsAdds Google-specific default-base handling for the OpenAI-compatible bridge.
crates/aisix-provider-google/src/lib.rsRenames crate docs/constants and relabels bridge name to google.
crates/aisix-provider-google/Cargo.tomlRenames package to aisix-provider-google.
crates/aisix-core/src/models/schema.rsUpdates model JSON schema provider enum to google.
crates/aisix-core/src/models/model.rsRenames Provider::Gemini to Provider::Google.
crates/aisix-admin/src/openapi.rsUpdates OpenAPI model provider enum to google.
Cargo.tomlUpdates workspace member path to aisix-provider-google.
Cargo.lockUpdates 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_bridge even though the crate and provider ID have been renamed to google. This leaves downstream callers importing aisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogous deepseek_bridge factory.
    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.

Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-core/src/models/model.rs
Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/configuration/models.md Outdated
- 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
CopilotAI review requested due to automatic review settings May 14, 2026 14:55

CopilotAI 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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/configuration/models.md
Comment threadtests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
Sign up for freeto 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.

3 participants

@jarvis9443@nic-6443
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

refactor: rename provider 'gemini' to 'google' to match models.dev - #279

Merged
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google
May 14, 2026
Merged

refactor: rename provider 'gemini' to 'google' to match models.dev#279
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google

Conversation

@jarvis9443

@jarvis9443jarvis9443 commented May 14, 2026

Copy link
Copy Markdown
Contributor

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::GeminiProvider::Google
  • Rename crate aisix-provider-geminiaisix-provider-google
  • Update all schema enums, OpenAPI specs, test fixtures, and docs

Part 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

    • Replaced "gemini" with "google" across model/provider-key configurations and runtime provider registry; provider enum now lists Google instead of Gemini.
    • Default API-base handling and OpenAI-compatible bridge now recognize the "google" provider.
  • Documentation

    • All docs, quickstarts, and compatibility guides updated to reference "google" in examples and provider lists.

Review Change Stack

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
CopilotAI review requested due to automatic review settings May 14, 2026 14:37
@coderabbitai

coderabbitaiBot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jarvis9443 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ef06c-ea20-4897-bc36-edd19da64ebd

📥 Commits

Reviewing files that changed from the base of the PR and between 76733a4 and 23bc15a.

📒 Files selected for processing (4)
  • docs/configuration/models.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/reference/provider-compatibility.md
📝 Walkthrough

Walkthrough

This PR replaces the upstream provider identity gemini with google across core types/schemas, provider crate and OpenAI-compatible bridge, workspace and crate dependencies, routing defaults, integration and E2E tests, and documentation.

Changes

Provider Identity Refactor: Gemini → Google

Layer / File(s)Summary
Core Provider Type Definition
crates/aisix-core/src/models/model.rs, crates/aisix-core/src/models/schema.rs, crates/aisix-admin/src/openapi.rs
Provider enum replaces Gemini with Google. Default base URL mapping, as_str, JSON schema, and OpenAPI provider enum updated; unit test updated to assert Provider::Google.default_base_url().
Google Provider Bridge Implementation
crates/aisix-provider-google/Cargo.toml, crates/aisix-provider-google/src/lib.rs, crates/aisix-provider-openai/src/bridge.rs
Crate/package renamed to aisix-provider-google. Introduces GOOGLE_DEFAULT_BASE and google_bridge(); OpenAiBridge maps name "google" to GOOGLE_DEFAULT_BASE. Unit tests updated to construct bridges with with_name("google").
Workspace and Dependency Wiring
Cargo.toml, crates/aisix-proxy/Cargo.toml, crates/aisix-server/Cargo.toml, crates/aisix-server/src/main.rs
Workspace members and crate dependency entries updated to reference aisix-provider-google. Server startup imports google_bridge and registers Provider::Google in the Hub.
Request Routing and Default Base Selection
crates/aisix-proxy/src/passthrough.rs, crates/aisix-proxy/src/rerank.rs
Provider-prefix default-base lookup now handles "google" (Generative Language /v1beta/openai shim); rerank mapping updated to use Provider::Google where previously Provider::Gemini was handled.
Integration Test Fixtures and Constants
crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
Test constants and fixtures renamed/repointed: MATRIX_GOOGLE_PK_ID, GOOGLE_PK_ID; fixture JSON provider fields set to "google" and imports adjusted to use google_bridge.
End-to-End and Matrix Tests
tests/e2e/src/cases/*, crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
E2E provider unions and case entries updated to use provider: "google". Matrix test wiring and SSE/shared helpers switched to Provider::Google and google_bridge() imports.
Documentation Updates
docs/* (models, provider-keys, integration guides, quickstart, feature matrix, compatibility)
User-facing docs updated to list google instead of gemini, update canonical api_base table and tolerance guidance, and reflect provider enum changes and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: renaming the provider from 'gemini' to 'google' throughout the codebase to match models.dev canonical naming.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

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 win

Preserve 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f57ed6 and 1a70017.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • Cargo.toml
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/model.rs
  • crates/aisix-core/src/models/schema.rs
  • crates/aisix-provider-google/Cargo.toml
  • crates/aisix-provider-google/src/lib.rs
  • crates/aisix-provider-openai/src/bridge.rs
  • crates/aisix-proxy/Cargo.toml
  • crates/aisix-proxy/src/lib.rs
  • crates/aisix-proxy/src/messages.rs
  • crates/aisix-proxy/src/passthrough.rs
  • crates/aisix-proxy/src/rerank.rs
  • crates/aisix-server/Cargo.toml
  • crates/aisix-server/src/main.rs
  • docs/configuration/models.md
  • docs/configuration/provider-keys.md
  • docs/integration/anthropic-messages.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/quickstart/first-model-first-key-first-request.md
  • docs/reference/provider-compatibility.md
  • docs/tutorials/openai-client-to-anthropic-upstream.md
  • tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts
  • tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
  • tests/e2e/src/cases/responses-endpoint-e2e.test.ts

Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/tutorials/openai-client-to-anthropic-upstream.md

CopilotAI 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.

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
FileDescription
tests/e2e/src/cases/responses-endpoint-e2e.test.tsUpdates non-OpenAI provider test case from gemini to google.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.tsUpdates provider union and error-normalization case to google.
tests/e2e/src/cases/cross-provider-matrix-e2e.test.tsUpdates matrix provider type and case to google.
docs/tutorials/openai-client-to-anthropic-upstream.mdUpdates tutorial provider example to google.
docs/reference/provider-compatibility.mdUpdates documented provider list to google.
docs/quickstart/first-model-first-key-first-request.mdUpdates quickstart api_base guidance to use google.
docs/overview/what-is-aisix-ai-gateway.mdUpdates overview provider enum list to google.
docs/overview/core-concepts.mdUpdates core concepts provider enum list to google.
docs/integration/anthropic-messages.mdUpdates non-Anthropic upstream provider list to google.
docs/configuration/provider-keys.mdUpdates provider-key api_base table and guidance to google.
docs/configuration/models.mdUpdates model configuration provider list to google.
crates/aisix-server/src/main.rsRegisters the renamed Provider::Google bridge in the hub.
crates/aisix-server/Cargo.tomlSwitches server dependency to aisix-provider-google.
crates/aisix-proxy/src/rerank.rsUpdates rerank unsupported-provider match arm to Provider::Google.
crates/aisix-proxy/src/passthrough.rsUpdates passthrough default base provider prefix to google.
crates/aisix-proxy/src/messages.rsUpdates message-path tests and registrations to Provider::Google.
crates/aisix-proxy/src/lib.rsUpdates proxy matrix tests to use google.
crates/aisix-proxy/Cargo.tomlSwitches proxy dev dependency to aisix-provider-google.
crates/aisix-provider-openai/src/bridge.rsAdds Google-specific default-base handling for the OpenAI-compatible bridge.
crates/aisix-provider-google/src/lib.rsRenames crate docs/constants and relabels bridge name to google.
crates/aisix-provider-google/Cargo.tomlRenames package to aisix-provider-google.
crates/aisix-core/src/models/schema.rsUpdates model JSON schema provider enum to google.
crates/aisix-core/src/models/model.rsRenames Provider::Gemini to Provider::Google.
crates/aisix-admin/src/openapi.rsUpdates OpenAPI model provider enum to google.
Cargo.tomlUpdates workspace member path to aisix-provider-google.
Cargo.lockUpdates 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_bridge even though the crate and provider ID have been renamed to google. This leaves downstream callers importing aisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogous deepseek_bridge factory.
    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.

Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-core/src/models/model.rs
Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/configuration/models.md Outdated
- 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
CopilotAI review requested due to automatic review settings May 14, 2026 14:55

CopilotAI 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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/configuration/models.md
Comment threadtests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
Sign up for freeto 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.

3 participants

@jarvis9443@nic-6443
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

refactor: rename provider 'gemini' to 'google' to match models.dev - #279

Merged
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google
May 14, 2026
Merged

refactor: rename provider 'gemini' to 'google' to match models.dev#279
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google

Conversation

@jarvis9443

@jarvis9443jarvis9443 commented May 14, 2026

Copy link
Copy Markdown
Contributor

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::GeminiProvider::Google
  • Rename crate aisix-provider-geminiaisix-provider-google
  • Update all schema enums, OpenAPI specs, test fixtures, and docs

Part 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

    • Replaced "gemini" with "google" across model/provider-key configurations and runtime provider registry; provider enum now lists Google instead of Gemini.
    • Default API-base handling and OpenAI-compatible bridge now recognize the "google" provider.
  • Documentation

    • All docs, quickstarts, and compatibility guides updated to reference "google" in examples and provider lists.

Review Change Stack

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
CopilotAI review requested due to automatic review settings May 14, 2026 14:37
@coderabbitai

coderabbitaiBot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jarvis9443 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ef06c-ea20-4897-bc36-edd19da64ebd

📥 Commits

Reviewing files that changed from the base of the PR and between 76733a4 and 23bc15a.

📒 Files selected for processing (4)
  • docs/configuration/models.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/reference/provider-compatibility.md
📝 Walkthrough

Walkthrough

This PR replaces the upstream provider identity gemini with google across core types/schemas, provider crate and OpenAI-compatible bridge, workspace and crate dependencies, routing defaults, integration and E2E tests, and documentation.

Changes

Provider Identity Refactor: Gemini → Google

Layer / File(s)Summary
Core Provider Type Definition
crates/aisix-core/src/models/model.rs, crates/aisix-core/src/models/schema.rs, crates/aisix-admin/src/openapi.rs
Provider enum replaces Gemini with Google. Default base URL mapping, as_str, JSON schema, and OpenAPI provider enum updated; unit test updated to assert Provider::Google.default_base_url().
Google Provider Bridge Implementation
crates/aisix-provider-google/Cargo.toml, crates/aisix-provider-google/src/lib.rs, crates/aisix-provider-openai/src/bridge.rs
Crate/package renamed to aisix-provider-google. Introduces GOOGLE_DEFAULT_BASE and google_bridge(); OpenAiBridge maps name "google" to GOOGLE_DEFAULT_BASE. Unit tests updated to construct bridges with with_name("google").
Workspace and Dependency Wiring
Cargo.toml, crates/aisix-proxy/Cargo.toml, crates/aisix-server/Cargo.toml, crates/aisix-server/src/main.rs
Workspace members and crate dependency entries updated to reference aisix-provider-google. Server startup imports google_bridge and registers Provider::Google in the Hub.
Request Routing and Default Base Selection
crates/aisix-proxy/src/passthrough.rs, crates/aisix-proxy/src/rerank.rs
Provider-prefix default-base lookup now handles "google" (Generative Language /v1beta/openai shim); rerank mapping updated to use Provider::Google where previously Provider::Gemini was handled.
Integration Test Fixtures and Constants
crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
Test constants and fixtures renamed/repointed: MATRIX_GOOGLE_PK_ID, GOOGLE_PK_ID; fixture JSON provider fields set to "google" and imports adjusted to use google_bridge.
End-to-End and Matrix Tests
tests/e2e/src/cases/*, crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
E2E provider unions and case entries updated to use provider: "google". Matrix test wiring and SSE/shared helpers switched to Provider::Google and google_bridge() imports.
Documentation Updates
docs/* (models, provider-keys, integration guides, quickstart, feature matrix, compatibility)
User-facing docs updated to list google instead of gemini, update canonical api_base table and tolerance guidance, and reflect provider enum changes and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: renaming the provider from 'gemini' to 'google' throughout the codebase to match models.dev canonical naming.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

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 win

Preserve 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f57ed6 and 1a70017.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • Cargo.toml
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/model.rs
  • crates/aisix-core/src/models/schema.rs
  • crates/aisix-provider-google/Cargo.toml
  • crates/aisix-provider-google/src/lib.rs
  • crates/aisix-provider-openai/src/bridge.rs
  • crates/aisix-proxy/Cargo.toml
  • crates/aisix-proxy/src/lib.rs
  • crates/aisix-proxy/src/messages.rs
  • crates/aisix-proxy/src/passthrough.rs
  • crates/aisix-proxy/src/rerank.rs
  • crates/aisix-server/Cargo.toml
  • crates/aisix-server/src/main.rs
  • docs/configuration/models.md
  • docs/configuration/provider-keys.md
  • docs/integration/anthropic-messages.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/quickstart/first-model-first-key-first-request.md
  • docs/reference/provider-compatibility.md
  • docs/tutorials/openai-client-to-anthropic-upstream.md
  • tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts
  • tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
  • tests/e2e/src/cases/responses-endpoint-e2e.test.ts

Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/tutorials/openai-client-to-anthropic-upstream.md

CopilotAI 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.

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
FileDescription
tests/e2e/src/cases/responses-endpoint-e2e.test.tsUpdates non-OpenAI provider test case from gemini to google.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.tsUpdates provider union and error-normalization case to google.
tests/e2e/src/cases/cross-provider-matrix-e2e.test.tsUpdates matrix provider type and case to google.
docs/tutorials/openai-client-to-anthropic-upstream.mdUpdates tutorial provider example to google.
docs/reference/provider-compatibility.mdUpdates documented provider list to google.
docs/quickstart/first-model-first-key-first-request.mdUpdates quickstart api_base guidance to use google.
docs/overview/what-is-aisix-ai-gateway.mdUpdates overview provider enum list to google.
docs/overview/core-concepts.mdUpdates core concepts provider enum list to google.
docs/integration/anthropic-messages.mdUpdates non-Anthropic upstream provider list to google.
docs/configuration/provider-keys.mdUpdates provider-key api_base table and guidance to google.
docs/configuration/models.mdUpdates model configuration provider list to google.
crates/aisix-server/src/main.rsRegisters the renamed Provider::Google bridge in the hub.
crates/aisix-server/Cargo.tomlSwitches server dependency to aisix-provider-google.
crates/aisix-proxy/src/rerank.rsUpdates rerank unsupported-provider match arm to Provider::Google.
crates/aisix-proxy/src/passthrough.rsUpdates passthrough default base provider prefix to google.
crates/aisix-proxy/src/messages.rsUpdates message-path tests and registrations to Provider::Google.
crates/aisix-proxy/src/lib.rsUpdates proxy matrix tests to use google.
crates/aisix-proxy/Cargo.tomlSwitches proxy dev dependency to aisix-provider-google.
crates/aisix-provider-openai/src/bridge.rsAdds Google-specific default-base handling for the OpenAI-compatible bridge.
crates/aisix-provider-google/src/lib.rsRenames crate docs/constants and relabels bridge name to google.
crates/aisix-provider-google/Cargo.tomlRenames package to aisix-provider-google.
crates/aisix-core/src/models/schema.rsUpdates model JSON schema provider enum to google.
crates/aisix-core/src/models/model.rsRenames Provider::Gemini to Provider::Google.
crates/aisix-admin/src/openapi.rsUpdates OpenAPI model provider enum to google.
Cargo.tomlUpdates workspace member path to aisix-provider-google.
Cargo.lockUpdates 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_bridge even though the crate and provider ID have been renamed to google. This leaves downstream callers importing aisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogous deepseek_bridge factory.
    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.

Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-core/src/models/model.rs
Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/configuration/models.md Outdated
- 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
CopilotAI review requested due to automatic review settings May 14, 2026 14:55

CopilotAI 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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/configuration/models.md
Comment threadtests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
Sign up for freeto 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.

3 participants

@jarvis9443@nic-6443
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

refactor: rename provider 'gemini' to 'google' to match models.dev - #279

Merged
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google
May 14, 2026
Merged

refactor: rename provider 'gemini' to 'google' to match models.dev#279
nic-6443 merged 4 commits into
mainfrom
fix/rename-gemini-to-google

Conversation

@jarvis9443

@jarvis9443jarvis9443 commented May 14, 2026

Copy link
Copy Markdown
Contributor

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::GeminiProvider::Google
  • Rename crate aisix-provider-geminiaisix-provider-google
  • Update all schema enums, OpenAPI specs, test fixtures, and docs

Part 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

    • Replaced "gemini" with "google" across model/provider-key configurations and runtime provider registry; provider enum now lists Google instead of Gemini.
    • Default API-base handling and OpenAI-compatible bridge now recognize the "google" provider.
  • Documentation

    • All docs, quickstarts, and compatibility guides updated to reference "google" in examples and provider lists.

Review Change Stack

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
CopilotAI review requested due to automatic review settings May 14, 2026 14:37
@coderabbitai

coderabbitaiBot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jarvis9443 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 42 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ef06c-ea20-4897-bc36-edd19da64ebd

📥 Commits

Reviewing files that changed from the base of the PR and between 76733a4 and 23bc15a.

📒 Files selected for processing (4)
  • docs/configuration/models.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/reference/provider-compatibility.md
📝 Walkthrough

Walkthrough

This PR replaces the upstream provider identity gemini with google across core types/schemas, provider crate and OpenAI-compatible bridge, workspace and crate dependencies, routing defaults, integration and E2E tests, and documentation.

Changes

Provider Identity Refactor: Gemini → Google

Layer / File(s)Summary
Core Provider Type Definition
crates/aisix-core/src/models/model.rs, crates/aisix-core/src/models/schema.rs, crates/aisix-admin/src/openapi.rs
Provider enum replaces Gemini with Google. Default base URL mapping, as_str, JSON schema, and OpenAPI provider enum updated; unit test updated to assert Provider::Google.default_base_url().
Google Provider Bridge Implementation
crates/aisix-provider-google/Cargo.toml, crates/aisix-provider-google/src/lib.rs, crates/aisix-provider-openai/src/bridge.rs
Crate/package renamed to aisix-provider-google. Introduces GOOGLE_DEFAULT_BASE and google_bridge(); OpenAiBridge maps name "google" to GOOGLE_DEFAULT_BASE. Unit tests updated to construct bridges with with_name("google").
Workspace and Dependency Wiring
Cargo.toml, crates/aisix-proxy/Cargo.toml, crates/aisix-server/Cargo.toml, crates/aisix-server/src/main.rs
Workspace members and crate dependency entries updated to reference aisix-provider-google. Server startup imports google_bridge and registers Provider::Google in the Hub.
Request Routing and Default Base Selection
crates/aisix-proxy/src/passthrough.rs, crates/aisix-proxy/src/rerank.rs
Provider-prefix default-base lookup now handles "google" (Generative Language /v1beta/openai shim); rerank mapping updated to use Provider::Google where previously Provider::Gemini was handled.
Integration Test Fixtures and Constants
crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
Test constants and fixtures renamed/repointed: MATRIX_GOOGLE_PK_ID, GOOGLE_PK_ID; fixture JSON provider fields set to "google" and imports adjusted to use google_bridge.
End-to-End and Matrix Tests
tests/e2e/src/cases/*, crates/aisix-proxy/src/lib.rs, crates/aisix-proxy/src/messages.rs
E2E provider unions and case entries updated to use provider: "google". Matrix test wiring and SSE/shared helpers switched to Provider::Google and google_bridge() imports.
Documentation Updates
docs/* (models, provider-keys, integration guides, quickstart, feature matrix, compatibility)
User-facing docs updated to list google instead of gemini, update canonical api_base table and tolerance guidance, and reflect provider enum changes and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: renaming the provider from 'gemini' to 'google' throughout the codebase to match models.dev canonical naming.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

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 win

Preserve 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7f57ed6 and 1a70017.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (25)
  • Cargo.toml
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/model.rs
  • crates/aisix-core/src/models/schema.rs
  • crates/aisix-provider-google/Cargo.toml
  • crates/aisix-provider-google/src/lib.rs
  • crates/aisix-provider-openai/src/bridge.rs
  • crates/aisix-proxy/Cargo.toml
  • crates/aisix-proxy/src/lib.rs
  • crates/aisix-proxy/src/messages.rs
  • crates/aisix-proxy/src/passthrough.rs
  • crates/aisix-proxy/src/rerank.rs
  • crates/aisix-server/Cargo.toml
  • crates/aisix-server/src/main.rs
  • docs/configuration/models.md
  • docs/configuration/provider-keys.md
  • docs/integration/anthropic-messages.md
  • docs/overview/core-concepts.md
  • docs/overview/what-is-aisix-ai-gateway.md
  • docs/quickstart/first-model-first-key-first-request.md
  • docs/reference/provider-compatibility.md
  • docs/tutorials/openai-client-to-anthropic-upstream.md
  • tests/e2e/src/cases/cross-provider-matrix-e2e.test.ts
  • tests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
  • tests/e2e/src/cases/responses-endpoint-e2e.test.ts

Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/tutorials/openai-client-to-anthropic-upstream.md

CopilotAI 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.

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
FileDescription
tests/e2e/src/cases/responses-endpoint-e2e.test.tsUpdates non-OpenAI provider test case from gemini to google.
tests/e2e/src/cases/error-envelope-normalization-e2e.test.tsUpdates provider union and error-normalization case to google.
tests/e2e/src/cases/cross-provider-matrix-e2e.test.tsUpdates matrix provider type and case to google.
docs/tutorials/openai-client-to-anthropic-upstream.mdUpdates tutorial provider example to google.
docs/reference/provider-compatibility.mdUpdates documented provider list to google.
docs/quickstart/first-model-first-key-first-request.mdUpdates quickstart api_base guidance to use google.
docs/overview/what-is-aisix-ai-gateway.mdUpdates overview provider enum list to google.
docs/overview/core-concepts.mdUpdates core concepts provider enum list to google.
docs/integration/anthropic-messages.mdUpdates non-Anthropic upstream provider list to google.
docs/configuration/provider-keys.mdUpdates provider-key api_base table and guidance to google.
docs/configuration/models.mdUpdates model configuration provider list to google.
crates/aisix-server/src/main.rsRegisters the renamed Provider::Google bridge in the hub.
crates/aisix-server/Cargo.tomlSwitches server dependency to aisix-provider-google.
crates/aisix-proxy/src/rerank.rsUpdates rerank unsupported-provider match arm to Provider::Google.
crates/aisix-proxy/src/passthrough.rsUpdates passthrough default base provider prefix to google.
crates/aisix-proxy/src/messages.rsUpdates message-path tests and registrations to Provider::Google.
crates/aisix-proxy/src/lib.rsUpdates proxy matrix tests to use google.
crates/aisix-proxy/Cargo.tomlSwitches proxy dev dependency to aisix-provider-google.
crates/aisix-provider-openai/src/bridge.rsAdds Google-specific default-base handling for the OpenAI-compatible bridge.
crates/aisix-provider-google/src/lib.rsRenames crate docs/constants and relabels bridge name to google.
crates/aisix-provider-google/Cargo.tomlRenames package to aisix-provider-google.
crates/aisix-core/src/models/schema.rsUpdates model JSON schema provider enum to google.
crates/aisix-core/src/models/model.rsRenames Provider::Gemini to Provider::Google.
crates/aisix-admin/src/openapi.rsUpdates OpenAPI model provider enum to google.
Cargo.tomlUpdates workspace member path to aisix-provider-google.
Cargo.lockUpdates 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_bridge even though the crate and provider ID have been renamed to google. This leaves downstream callers importing aisix_provider_google::gemini_bridge, which exposes the old provider name in the public API and is inconsistent with the analogous deepseek_bridge factory.
    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.

Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-core/src/models/model.rs
Comment threadcrates/aisix-admin/src/openapi.rs Outdated
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/configuration/models.md Outdated
- 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
CopilotAI review requested due to automatic review settings May 14, 2026 14:55

CopilotAI 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.

Pull request overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 7 comments.

Comment threadcrates/aisix-core/src/models/schema.rs
Comment threadcrates/aisix-provider-openai/src/bridge.rs
Comment threaddocs/reference/provider-compatibility.md
Comment threaddocs/overview/core-concepts.md
Comment threaddocs/overview/what-is-aisix-ai-gateway.md
Comment threaddocs/configuration/models.md
Comment threadtests/e2e/src/cases/error-envelope-normalization-e2e.test.ts
Sign up for freeto 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.

3 participants

@jarvis9443@nic-6443