---
title: "Gemini CLI Multi-Model Setup: Connect to Claude, GPT, Groq, and 20+ Providers via Bifrost"
description: "Google&#x27;s Gemini CLI has rapidly become a go-to terminal-based coding agent, offering advanced reasoning capabilities and tight integration with the Google ecosystem. But production engineering teams rarely operate within a single provider&#x27;s walled garden. Codebases demand different models for different tasks: a reasoning-heavy model for"
image: https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/07/gemini-cli-multi-model-setup-connect-to-claude-gpt-groq-and--bifrost-paper-waves.optimized.png
---

Try Bifrost Enterprise free for 14 days. [Request access](https://www.getmaxim.ai/#enterprise-trial)

Google's Gemini CLI has rapidly become a go-to terminal-based coding agent, offering advanced reasoning capabilities and tight integration with the Google ecosystem. But production engineering teams rarely operate within a single provider's walled garden. Codebases demand different models for different tasks: a reasoning-heavy model for architectural decisions, a fast inference engine for lint-and-fix loops, and a cost-efficient option for boilerplate generation. Gemini CLI, out of the box, only speaks to Google's own API.

[Bifrost](https://docs.getbifrost.ai/overview) opens that boundary. As a high-performance, open-source [AI gateway](https://www.getmaxim.ai/articles/top-5-llm-gateways-in-2026-a-production-ready-comparison/), Bifrost translates Gemini CLI's GenAI API requests into the native format of any downstream provider, letting developers point their favorite terminal agent at Claude, GPT-5, Llama on Groq, Mistral, or self-hosted models through Ollama. The entire configuration happens through [Bifrost CLI](https://docs.getbifrost.ai/quickstart/cli/getting-started), an interactive launcher that removes every manual step from the process.

## The Multi-Provider Problem in Terminal-Based Coding Agents

Engineering organizations today maintain API keys across multiple LLM providers. A team might use Anthropic for code review, OpenAI for documentation generation, and a Groq-hosted open-source model for rapid iteration during debugging. Each provider has its own authentication scheme, SDK, and endpoint format.

Terminal coding agents like Gemini CLI compound this fragmentation. They are designed around a single provider's API surface. Switching providers means rewriting environment variables, adjusting authentication flows, and verifying that the target model supports the tool-calling capabilities the agent depends on. For a single developer experimenting locally, this friction is manageable. For a team of 20 engineers who need standardized access, governed usage, and centralized monitoring, it becomes an operational bottleneck.

Bifrost addresses this by acting as a unified translation layer. It accepts requests in Google's GenAI format (what Gemini CLI natively produces) and forwards them to whichever provider and model is configured, handling format translation, authentication, [automatic failover](https://docs.getbifrost.ai/features/fallbacks), and [load balancing](https://docs.getbifrost.ai/features/keys-management) transparently. The gateway introduces only [11 microseconds of overhead](https://docs.getbifrost.ai/overview) at sustained throughput of 5,000 requests per second, so performance impact on interactive coding sessions is negligible.

## Connecting Gemini CLI to Bifrost: A Step-by-Step Walkthrough

The setup requires two terminal windows and about 90 seconds.

**Launch the Bifrost gateway:**

```bash
npx -y @maximhq/bifrost
```

This starts the gateway at `http://localhost:8080` with a [built-in web UI](https://docs.getbifrost.ai/quickstart/gateway/setting-up) for configuring providers and monitoring traffic in real time.

**Launch Bifrost CLI in a second terminal:**

```bash
npx -y @maximhq/bifrost-cli
```

The CLI presents an interactive setup wizard with four prompts:

- **Gateway URL**: Confirm or update the Bifrost endpoint (defaults to `http://localhost:8080`).
- **Virtual key**: Optionally enter a [Bifrost virtual key](https://docs.getbifrost.ai/features/governance/virtual-keys) for authentication and governance. The CLI stores it in the OS keyring rather than writing it to disk.
- **Agent selection**: Pick Gemini CLI from the harness list. If it is not yet installed, the CLI offers to run `npm install -g @google/gemini-cli` automatically.
- **Model selection**: A searchable, filterable list of every model available on the gateway appears. Select any model from any [configured provider](https://docs.getbifrost.ai/providers/supported-providers/overview), not just Google's offerings.

Pressing Enter launches Gemini CLI with the correct `GOOGLE_GEMINI_BASE_URL`, API key, and model flag already configured. No `export` statements, no `.bashrc` edits.

## Pointing Gemini CLI at Non-Google Models

Bifrost's API translation layer converts Gemini CLI's GenAI-format requests into the target provider's native format. This means every model accessible through the gateway is available inside Gemini CLI using the `provider/model-name` syntax with the `-m` flag:

- **Anthropic**: `gemini -m anthropic/claude-sonnet-4-5-20250929`
- **OpenAI**: `gemini -m openai/gpt-5`
- **Groq**: `gemini -m groq/llama-3.3-70b-versatile`
- **Mistral**: `gemini -m mistral/mistral-large-latest`
- **xAI**: `gemini -m xai/grok-3`
- **Self-hosted (Ollama)**: `gemini -m ollama/llama3`

The full list of [supported providers](https://docs.getbifrost.ai/providers/supported-providers/overview) spans over 20 options, including Azure, AWS Bedrock, Google Vertex, Cerebras, Cohere, Perplexity, Nebius, Replicate, vLLM, and SGL.

One critical requirement: the target model must support tool-use capabilities. Gemini CLI depends on [function calling](https://docs.getbifrost.ai/cli-agents/gemini-cli#using-non-google-models-with-gemini-cli) for file operations, terminal commands, and code editing. Models that lack tool-calling support will not work correctly for agentic coding tasks.

## Vertex AI and Enterprise Google Cloud Routing

Organizations that run Gemini models through Google Cloud's Vertex AI infrastructure can also route that traffic through Bifrost. This unlocks the gateway's governance, observability, and failover features without changing the underlying cloud provider relationship.

The [Vertex AI configuration](https://docs.getbifrost.ai/cli-agents/gemini-cli#google-cloud--vertex-ai) requires setting `GOOGLE_GENAI_USE_VERTEXAI=true` alongside the Bifrost base URL. Bifrost handles GCP authentication and project routing transparently. For enterprises with strict data residency requirements, Bifrost's [in-VPC deployment](https://docs.getbifrost.ai/enterprise/invpc-deployments) option ensures all traffic stays within the private network perimeter.

This architecture is particularly valuable for regulated industries where LLM requests must traverse approved infrastructure. Bifrost sits inside the VPC, manages credentials through [vault integrations](https://docs.getbifrost.ai/enterprise/secret-management) with HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault, and enforces compliance controls through [audit logs](https://docs.getbifrost.ai/enterprise/audit-logs) that satisfy SOC 2, HIPAA, and GDPR requirements.

## Running Parallel Sessions with the Tabbed Terminal UI

Bifrost CLI does not terminate after starting a single Gemini CLI session. It maintains a [persistent tabbed interface](https://docs.getbifrost.ai/quickstart/cli/getting-started#tabbed-session-ui) in the terminal, allowing developers to operate multiple coding sessions simultaneously.

Each tab displays a real-time status badge indicating whether the session is actively processing, idle and awaiting input, or has triggered an alert. Press `Ctrl+B` to enter tab mode, where keyboard shortcuts enable quick navigation:

- `n` to open a new tab with a fresh agent session (can be a different model or even a different agent entirely)
- `h` and `l` to move between tabs
- `1` through `9` to jump directly to a specific tab
- `x` to close a tab

This workflow lets a developer run Gemini CLI pointed at `gemini-2.5-pro` for a complex refactoring task in one tab, while a second tab uses `groq/llama-3.3-70b-versatile` for fast, iterative test generation. Each session routes through Bifrost independently, with separate model configurations and independent token tracking.

## Cost Control, Rate Limiting, and Team-Wide Observability

When Gemini CLI usage scales across an engineering team, uncontrolled spending and zero visibility into usage patterns become real operational risks. Bifrost's governance layer provides the controls that Google's native API lacks at the gateway level.

- **Per-developer budgets**: [Virtual keys](https://docs.getbifrost.ai/features/governance/virtual-keys) assign each engineer or team a unique credential with configurable spend limits, rate caps, and model access permissions. One developer might have access to Gemini 2.5 Pro and Claude Sonnet, while an intern's key is restricted to Gemini Flash and open-source models on Groq.
- **Hierarchical rate limits**: [Budget and rate limit controls](https://docs.getbifrost.ai/features/governance/budget-and-limits) operate at the virtual key, team, and organization level, preventing any single user or runaway script from exhausting shared API quotas.
- **Real-time metrics**: Every Gemini CLI request flowing through Bifrost generates [Prometheus metrics](https://docs.getbifrost.ai/features/observability/prometheus) and [OpenTelemetry traces](https://docs.getbifrost.ai/features/observability/otel). Teams can monitor token consumption, error rates, provider latency, and request volume across all active coding sessions through Grafana, Datadog, New Relic, or any OTLP-compatible backend.
- **Semantic caching for repeated queries**: Developers working on similar codebases often issue near-identical prompts. Bifrost's [semantic caching](https://docs.getbifrost.ai/features/semantic-caching) layer detects semantically similar requests and serves cached responses, reducing both cost and round-trip latency for common patterns.

## Resilience Through Automatic Failover

Provider outages during an active coding session are disruptive. Bifrost's [fallback system](https://docs.getbifrost.ai/features/fallbacks) mitigates this by rerouting requests to backup providers when the primary target is unavailable or rate-limited.

For example, a team could configure Gemini 2.5 Pro as the primary model with Claude Sonnet as the fallback. If Google's API returns errors or exceeds rate limits, Bifrost seamlessly switches to the Anthropic endpoint. The developer's Gemini CLI session continues without interruption, and the failover event is logged for operational review. The enterprise tier extends this with [adaptive load balancing](https://docs.getbifrost.ai/enterprise/adaptive-load-balancing), which uses real-time health signals to predictively distribute traffic before outages cause failures.

## Getting Started

Bifrost is [open source on GitHub](https://github.com/maximhq/bifrost) and requires two commands to get Gemini CLI connected to any provider. For engineering teams that need enterprise-grade governance, adaptive failover, SSO through identity providers like Okta and Entra, and VPC-isolated deployments for their terminal coding workflows, [book a Bifrost demo](https://www.getmaxim.ai/book-a-demo) to evaluate the platform against your requirements.

## Read next

[![9 Best AWS Bedrock Alternatives](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/9-best-aws-bedrock-alternatives-bifrost-1920x1080.png) AWS Bedrock alternatives are model platforms that serve foundation models outside Amazon's managed service. This guide compares nine of them, including Google Vertex AI, Microsoft Foundry, Together AI, and vLLM, and shows how to run several behind one API.](https://www.getmaxim.ai/articles/9-best-aws-bedrock-alternatives/)

[![13 Best AI Coding Agents for Enterprise Teams](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/13-best-ai-coding-agents-for-enterprise-teams-bifrost-1920x1080.png) AI coding agents are tools that plan, edit, and test code across a repository from a single instruction. This guide compares 13 of them, including Claude Code, GitHub Copilot, Cursor, and Kiro, on the controls enterprise teams check before a rollout.](https://www.getmaxim.ai/articles/13-best-ai-coding-agents-for-enterprise-teams/)

[![11 Best LLM Proxies: Open Source and Managed](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/11-best-llm-proxies-open-source-and-managed-bifrost-1920x1080.png) An LLM proxy sits between applications and model providers and forwards their requests. This guide compares 11 open-source and managed options, including Bifrost, Cloudflare AI Gateway, Kong AI Gateway, and Azure API Management, on routing, failover, caching, and governance.](https://www.getmaxim.ai/articles/11-best-llm-proxies-open-source-and-managed/)

## More in AI Gateway

[![How to Run Claude Code with OpenAI, Gemini, Bedrock, and Any LLM Using Bifrost CLI](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/07/how-to-run-claude-code-with-openai-gemini-bedrock-and-any-ll-bifrost-paper-waves.optimized.png) Claude Code is one of the most capable agentic coding tools available today, bringing AI-powered development directly into the terminal. However, it is locked to Anthropic's model family by default. This means teams that want to experiment with GPT-5, Gemini 2.5 Pro, Groq, or models](https://www.getmaxim.ai/articles/how-to-run-claude-code-with-openai-gemini-bedrock-and-any-llm-using-bifrost-cli/)

[![OpenAI Codex CLI Beyond GPT: Switch Between Claude, Gemini, Llama, and More Using Bifrost](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/07/openai-codex-cli-beyond-gpt-switch-between-claude-gemini-lla-bifrost-paper-waves.optimized.png) OpenAI's Codex CLI has earned a strong reputation as a terminal-based coding agent with robust code generation and completion capabilities. It ships with native support for GPT models and ChatGPT OAuth authentication, making it a natural choice for developers already embedded in the OpenAI ecosystem. But modern](https://www.getmaxim.ai/articles/openai-codex-cli-beyond-gpt-switch-between-claude-gemini-llama-and-more-using-bifrost/)

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "Maxim Articles",
        "url": "https://www.getmaxim.ai/articles/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w256h256/2025/08/thumbnail.png",
            "width": 60,
            "height": 60
        }
    },
    "author": {
        "@type": "Person",
        "name": "Kuldeep Paul",
        "image": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2025/08/1727978381919.jpeg",
            "width": 800,
            "height": 800
        },
        "url": "https://www.getmaxim.ai/articles/author/kuldeep/",
        "sameAs": []
    },
    "headline": "Gemini CLI Multi-Model Setup: Connect to Claude, GPT, Groq, and 20+ Providers via Bifrost",
    "url": "https://www.getmaxim.ai/articles/gemini-cli-multi-model-setup-connect-to-claude-gpt-groq-and-20-providers-via-bifrost/",
    "datePublished": "2026-03-17T19:41:41.000Z",
    "dateModified": "2026-10-16T06:15:29.000Z",
    "image": {
        "@type": "ImageObject",
        "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/07/gemini-cli-multi-model-setup-connect-to-claude-gpt-groq-and--bifrost-paper-waves.optimized.png",
        "width": 1200,
        "height": 630
    },
    "keywords": "AI Gateway",
    "description": "Google's Gemini CLI has rapidly become a go-to terminal-based coding agent, offering advanced reasoning capabilities and tight integration with the Google ecosystem. But production engineering teams rarely operate within a single provider's walled garden. Codebases demand different models for different tasks: a reasoning-heavy model for architectural decisions, a fast inference engine for lint-and-fix loops, and a cost-efficient option for boilerplate generation. Gemini CLI, out of the box, only",
    "mainEntityOfPage": "https://www.getmaxim.ai/articles/gemini-cli-multi-model-setup-connect-to-claude-gpt-groq-and-20-providers-via-bifrost/"
}
```
