gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Support GEMINI_MODEL environment variable for model configuration

Open headStyleColorRed opened this issue 3 months ago • 2 comments

Summary

Adds support for configuring the Gemini model via the GEMINI_MODEL environment variable in the A2A server, allowing users to override the default model without code changes. Falls back to DEFAULT_GEMINI_MODEL when not specified.

Details

This change enables to specify which Gemini model to use when starting the A2A server. The implementation follows the existing pattern used for other environment variables in the config file (e.g., DEBUG, GEMINI_YOLO_MODE, GEMINI_API_KEY).

Changes:

  • Modified packages/a2a-server/src/config/config.ts to read process.env['GEMINI_MODEL'] with fallback to DEFAULT_GEMINI_MODEL
  • Maintains backward compatibility - if GEMINI_MODEL is not set, the default model (gemini-2.5-pro) is used

Use case: In the environment one can now set GEMINI_MODEL=gemini-2.0-flash when starting the server, allowing easy model switching for different environments or testing scenarios.

Related Issues

How to Validate

  1. Start the server without GEMINI_MODEL set - should use default model (gemini-2.5-pro)
  2. Start the server with GEMINI_MODEL=gemini-2.0-flash - should use the specified model

Pre-Merge Checklist

  • [x] Updated relevant documentation and README (if needed)
  • [x] Added/updated tests (No tests failing)
  • [x] Noted breaking changes (No breaking changes)
  • [x] Validated on required platforms/methods:
    • [x] MacOS
      • [x] npm run

headStyleColorRed avatar Nov 19 '25 06:11 headStyleColorRed

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Nov 19 '25 06:11 google-cla[bot]

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

Done 👌

headStyleColorRed avatar Nov 19 '25 07:11 headStyleColorRed