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.

Google Vertex AI

Page as Markdown

Learn how to configure Google Vertex AI models in kagent.

Configuring Google Vertex AI

Google Vertex AI is supported for Gemini and Anthropic models.

  1. Create the Google Application Default Credentials file and store it in a Kubernetes Secret. If your credentials are in a different location, update the filepath.
kubectl create secret generic kagent-google-creds -n kagent --from-file=~/.config/gcloud/application_default_credentials.json
  1. For Gemini models: create a ModelConfig resource using the GeminiVertexAI provider that references the secret and key name, and specify the Gemini model you want to use. Note the projectID and location are required:
apiVersion: kagent.dev/v1alpha2
kind: ModelConfig
metadata:
  name: gemini-model-config-vertexai
  namespace: kagent
spec:
  apiKeySecret: kagent-google-creds
  apiKeySecretKey: google_creds.json
  model: gemini-2.0-flash-lite
  provider: GeminiVertexAI
  geminiVertexAI:
    projectID: kagent-dev
    location: us-west1
    maxOutputTokens: 1000
  1. For Anthropic models: create a ModelConfig resource using the AnthropicVertexAI provider that references the secret and key name, and specify the Anthropic model you want to use. Note the projectID and location are required:
apiVersion: kagent.dev/v1alpha2
kind: ModelConfig
metadata:
  name: anthropic-model-config-vertexai
  namespace: kagent
spec:
  apiKeySecret: kagent-google-creds
  apiKeySecretKey: google_creds.json
  model: claude-sonnet-4@20250514
  provider: AnthropicVertexAI
  anthropicVertexAI:
    projectID: kagent-dev
    location: us-east5