Skip to content

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Gemini

Page as Markdown

Learn how to configure Gemini models in kagent.

Gemini is Google’s AI model family that can be accessed directly through the Google AI Studio API.

Before you begin

Make sure that your Google Cloud account has a project with the Gemini API enabled.

Configuring Gemini

  1. Get your API key from Google AI Studio.

  2. Create a Kubernetes Secret that stores the API key.

    kubectl create secret generic kagent-gemini -n kagent --from-literal GOOGLE_API_KEY=<your_api_key>
  3. Create a ModelConfig resource using the Gemini provider.

You can find out the latest model names and capabilities on the Gemini API docs. Once you have chosen a model, replace the model field with the name such as gemini-2.5-pro.

apiVersion: kagent.dev/v1alpha2
kind: ModelConfig
metadata:
  name: gemini-model-config
  namespace: kagent
spec:
  apiKeySecret: kagent-gemini
  apiKeySecretKey: GOOGLE_API_KEY
  model: gemini-2.5-flash
  provider: Gemini
  gemini: {}
  1. Apply the above resource to the cluster.

Once the resource is applied, you can select the model from the Model dropdown in the UI when creating or updating agents.