Skip to content

Google Vertex

Required secret Overlay
GCP service-account Secret values-google-vertex.yaml

When to use it

Enable the Vertex AI API in your GCP project. The example mounts a GCP service-account JSON file with the Vertex AI User role.

The example uses google/gemini-3.8-flash on the global endpoint. It replaces Gemini 2.5 Flash, which retired on Vertex. Check model and location availability before choosing a different region or model. This example does not use the Gemini Developer API.

Install

kubectl create namespace hermes-agent
kubectl create secret generic vertex-sa --namespace hermes-agent \
  --from-file=sa.json=/path/to/sa.json

helm upgrade --install hermes-agent ./charts/hermes-agent \
  --namespace hermes-agent --create-namespace \
  -f charts/hermes-agent/values-google-vertex.yaml \
  --set-string config.vertex.project_id='<your-gcp-project>' --wait

If the namespace or Secret already exists, reuse it. Do not put the JSON key in Helm values or commit it. The example mounts a file, not an API key.

Adapt before deploying

On an existing release, the default bootstrap.overwrite: false preserves the PVC's config.yaml. Update the model through Hermes or by editing that file; upgrading the overlay alone does not change a persisted model.

Verification

CI checks this overlay without a cloud account. When the overlay, the Hermes image or the harness changes, it renders the chart, runs the pinned Hermes image with no network and no credentials against a local mock, and asserts the Vertex project, region, google/gemini-3.8-flash request path and a fixed reply. A wrong route or model fails. See provider-contract for the exact checks and how to run it locally.

This is a mock. It does not test IAM, quota or live Vertex inference, and the Secret is checked as a mounted file, not exercised in a Pod. After installing, run one chat against your own project.

Open Raw YAML

Complete overlay

charts/hermes-agent/values-google-vertex.yaml
# values-google-vertex.yaml
#
# Hermes Agent using Google Vertex AI as the model provider (Gemini models via
# Vertex's OpenAI-compatible endpoint). Requires hermes-agent >= v2026.7.1.
#
# Vertex has NO static API key: every request needs a short-lived OAuth2 access
# token, which Hermes mints and auto-refreshes from a service-account JSON (or
# Application Default Credentials). So unlike the other provider examples, the
# credential here is a FILE mounted into the pod, not an env var:
#
# 1. Create a GCP service account with the "Vertex AI User" role and download
#    its JSON key.
# 2. Put the JSON into a Kubernetes Secret:
#      kubectl create secret generic vertex-sa \
#        --namespace hermes-agent \
#        --from-file=sa.json=/path/to/key.json
# 3. Install:
#      helm upgrade --install hermes-agent ./charts/hermes-agent \
#        --namespace hermes-agent --create-namespace \
#        -f charts/hermes-agent/values-google-vertex.yaml \
#        --set-string config.vertex.project_id='<your-gcp-project>' --wait

config:
  model:
    provider: vertex
    # Gemini 2.5 Flash has retired on Vertex. Check availability for your endpoint.
    default: google/gemini-3.8-flash
  # Non-secret Vertex settings live in config.yaml; only the credential file
  # path goes through the environment (VERTEX_CREDENTIALS_PATH below).
  vertex:
    project_id: "REPLACE_ME_GCP_PROJECT"
    # "global" uses the global endpoint. Before selecting a region, check that
    # the model and your consumption option are supported there.
    region: "global"
  terminal:
    backend: local

env:
  # No Vertex API key exists: tokens are minted from the mounted SA JSON.
  # This only overrides the chart's OpenAI placeholder.
  OPENAI_API_KEY: "unused"

extraEnv:
  # Path (inside the container) to the service-account JSON mounted below.
  # Omit it to fall back to ADC (GOOGLE_APPLICATION_CREDENTIALS / metadata
  # server, e.g. GKE Workload Identity).
  - name: VERTEX_CREDENTIALS_PATH
    value: /var/run/secrets/vertex/sa.json
  # The vertex provider needs `google-auth`, which upstream ships as an opt-in
  # extra handled by its lazy-install mechanism: it is NOT baked into the
  # image, and the image disables lazy installs by default. Re-enable them so
  # the first Vertex call can install it into HERMES_LAZY_INSTALL_TARGET on
  # the persistent volume (one-time, needs network egress; survives restarts).
  - name: HERMES_DISABLE_LAZY_INSTALLS
    value: "0"

# Mount the service-account Secret created in step 2.
extraVolumes:
  - name: vertex-sa
    secret:
      secretName: vertex-sa
extraVolumeMounts:
  - name: vertex-sa
    mountPath: /var/run/secrets/vertex
    readOnly: true

# NOTE: as of a recent Hermes security hardening, VERTEX_CREDENTIALS_PATH and
# GOOGLE_APPLICATION_CREDENTIALS are stripped from the environment of
# subprocesses the agent spawns (terminal, execute_code, browser,
# computer_use): they still work for the model's own API calls above. If a
# tool call in your session needs Vertex credentials too (e.g. shelling out to
# `gcloud`), re-allow it explicitly:
#
# config:
#   tools:
#     env_passthrough: ["VERTEX_CREDENTIALS_PATH"]