From 61096af29c0bc7b7bd34d93274a237554478522a Mon Sep 17 00:00:00 2001 From: Akhilesh Kumar Date: Wed, 15 Apr 2026 01:57:31 +0000 Subject: [PATCH] docs: Add Gemma 4 routing instructions to README and docs --- README.md | 3 +++ docs/cli/gemma4-routing.md | 48 ++++++++++++++++++++++++++++++++++++++ docs/sidebar.json | 4 ++++ 3 files changed, 55 insertions(+) create mode 100644 docs/cli/gemma4-routing.md diff --git a/README.md b/README.md index 10458b2126..c5d614c693 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ Learn all about Gemini CLI in our [documentation](https://geminicli.com/docs/). ## 🚀 Why Gemini CLI? +- **🚀 Gemma 4 Support**: Route requests to Gemma 4 models (`gemma-4-26b-a4b-it` + or `gemma-4-31b-it`) using the `model.gemma4Variant` configuration setting. + - **🎯 Free tier**: 60 requests/min and 1,000 requests/day with personal Google account. - **🧠 Powerful Gemini 3 models**: Access to improved reasoning and 1M token diff --git a/docs/cli/gemma4-routing.md b/docs/cli/gemma4-routing.md new file mode 100644 index 0000000000..eede0126ea --- /dev/null +++ b/docs/cli/gemma4-routing.md @@ -0,0 +1,48 @@ +# Gemma 4 Routing + +Gemini CLI allows you to seamlessly route your requests to Gemma 4 models. When +enabled, requests that would normally be sent to standard Gemini Pro and Flash +models are automatically redirected to your chosen Gemma 4 variant. + +## Configuration + +You can enable Gemma 4 routing using the CLI settings or by modifying your +`settings.json` file. + +### Via Settings UI + +1. Open the settings dialog by running `/settings`. +2. Navigate to the **Model** section. +3. Locate the **Gemma 4 Variant** setting. +4. Select your preferred model: + - `gemma-4-26b-a4b-it` (Gemma 4 26B A4B IT) + - `gemma-4-31b-it` (Gemma 4 31B IT) +5. Save the settings and restart the CLI if prompted. + +### Via `settings.json` + +You can also set this directly in your `.gemini/settings.json` file: + +```json +{ + "model": { + "gemma4Variant": "gemma-4-31b-it" + } +} +``` + +## How it works + +When a `gemma4Variant` is selected, Gemini CLI intercepts model resolution: + +- Requests for `gemini-pro`, `gemini-flash`, and their associated aliases (like + `auto`, `pro`, `flash`) are routed to the selected Gemma 4 model. +- The **router model** (`flash-lite`) remains unaffected and continues to use + `gemini-2.5-flash-lite`. This ensures fast, lightweight background routing + tasks continue to operate optimally. +- If you do not have preview model access, the CLI normally falls back to stable + models; however, the Gemma 4 variant will still take precedence for Pro and + Flash targets. + +To disable Gemma 4 routing, simply remove the `gemma4Variant` configuration from +your settings or set it to `undefined`/empty in the UI. diff --git a/docs/sidebar.json b/docs/sidebar.json index ad5741699e..fc1268818f 100644 --- a/docs/sidebar.json +++ b/docs/sidebar.json @@ -171,6 +171,10 @@ "label": "Project context (GEMINI.md)", "slug": "docs/cli/gemini-md" }, + { + "label": "Gemma 4 Routing", + "slug": "docs/cli/gemma4-routing" + }, { "label": "Settings", "slug": "docs/cli/settings" }, { "label": "System prompt override",