Skip to content

Google Vertex AI

Avant exchanges the workspace’s assertion through Workload Identity Federation in your project, impersonates a service account there, and calls Vertex AI (Gemini Enterprise Agent Platform). Usage is billed to your GCP project. Read How provider setup works first.

  1. A service account with roles/aiplatform.user.
  2. A Workload Identity pool and OIDC provider that trust https://identity.avant.codes. Create these once and reuse them.
  3. A roles/iam.workloadIdentityUser grant on the service account for the workspace’s exact subject. Add one per workspace.
Terminal window
PROJECT_ID="<your-project>"
SA_ID="avant-byoc"
SA_EMAIL="${SA_ID}@${PROJECT_ID}.iam.gserviceaccount.com"
gcloud services enable aiplatform.googleapis.com iam.googleapis.com \
sts.googleapis.com iamcredentials.googleapis.com --project "$PROJECT_ID"
gcloud iam service-accounts create "$SA_ID" --project "$PROJECT_ID" \
--display-name "Avant BYOC inference"
gcloud projects add-iam-policy-binding "$PROJECT_ID" \
--member "serviceAccount:${SA_EMAIL}" --role roles/aiplatform.user
gcloud iam workload-identity-pools create avant-byoc \
--project "$PROJECT_ID" --location global --display-name "Avant BYOC"
gcloud iam workload-identity-pools providers create-oidc avant-oidc \
--project "$PROJECT_ID" --location global --workload-identity-pool avant-byoc \
--issuer-uri https://identity.avant.codes \
--attribute-mapping "google.subject=assertion.sub"
gcloud iam workload-identity-pools providers describe avant-oidc \
--project "$PROJECT_ID" --location global --workload-identity-pool avant-byoc \
--format='value(name)'

The last command prints the Workload Identity Provider resource: projects/<number>/locations/global/workloadIdentityPools/avant-byoc/providers/avant-oidc.

Then grant the workspace’s subject:

Terminal window
BINDING_SUBJECT="avant:binding:..."
PROJECT_NUMBER="$(gcloud projects describe "$PROJECT_ID" --format='value(projectNumber)')"
gcloud iam service-accounts add-iam-policy-binding "$SA_EMAIL" --project "$PROJECT_ID" \
--member "principal://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/avant-byoc/subject/${BINDING_SUBJECT}" \
--role roles/iam.workloadIdentityUser

The dashboard’s create form shows these commands with your values filled in.

Field Value
GCP project ID $PROJECT_ID
Location global, us, eu, or a single region such as us-east5
Service account email $SA_EMAIL
Workload Identity Provider resource The output of describe above
Terminal window
avant workspace create --name vertex --mode byoc-gcp \
--project-id "$PROJECT_ID" --location global --service-account "$SA_EMAIL" \
--workload-identity-provider projects/<number>/locations/global/workloadIdentityPools/avant-byoc/providers/avant-oidc
avant workspace verify vertex

Verify impersonates the service account and makes one read-only Vertex AI call.

The location is where inference runs, and it decides which models you can reach. Some partner models are only offered in a single region, not at global, us or eu. To reach one, set that region as the location. To keep requests inside a region, also set Inference location in the policy.

Claude models use the Messages API. Gemini, Grok and other partner models use Chat Completions. Codex isn’t supported, because Vertex AI’s OpenAI-compatible endpoint has no Responses API.

ModelAPILocationsHarnesses
gemini-3.7-flashChat Completionsglobal, us, euOpenCode, Pi, Oh My Pi
gemini-3.8-flashChat Completionsglobal, us, euOpenCode, Pi, Oh My Pi
gemini-4-argonChat Completionsglobal, us, euOpenCode, Pi, Oh My Pi
gemini-4-carbonChat Completionsglobal, us, euOpenCode, Pi, Oh My Pi
gemini-4-hydrogenChat Completionsglobal, us, euOpenCode, Pi, Oh My Pi
gemini-4-neon (default)Chat Completionsglobal, us, euOpenCode, Pi, Oh My Pi
claude-sonnet-5Messagesglobal, us, euClaude Code, OpenCode, Pi, Oh My Pi
claude-opus-5Messagesglobal, us, euClaude Code, OpenCode, Pi, Oh My Pi
claude-opus-5-5Messagesglobal, us, euClaude Code, OpenCode, Pi, Oh My Pi
claude-sonnet-5-5Messagesglobal, us, euClaude Code, OpenCode, Pi, Oh My Pi
claude-haiku-5-5Messagesglobal, us, euClaude Code, OpenCode, Pi, Oh My Pi
claude-fable-5Messagesglobal, us, euClaude Code, OpenCode, Pi, Oh My Pi
claude-fable-5-1Messagesglobal, us, euClaude Code, OpenCode, Pi, Oh My Pi
claude-fable-5-2Messagesglobal, us, euClaude Code, OpenCode, Pi, Oh My Pi
grok-4.6Chat CompletionsglobalOpenCode, Pi, Oh My Pi
grok-4.7Chat CompletionsglobalOpenCode, Pi, Oh My Pi

You also need access to each partner model in your project’s Model Garden.

Remove the roles/iam.workloadIdentityUser grant, or delete the service account.

There’s also an OpenTofu module in infra/customer-onboarding in the Avant repository that creates the same resources.