tberman
09/24/2025, 1:13 AMVaibhav (BAML ๐)
09/24/2025, 1:23 AMtberman
09/24/2025, 3:23 AMtberman
09/24/2025, 4:07 AMRequestBuilder for VertexClienttberman
09/24/2025, 4:07 AMVaibhav (BAML ๐)
09/24/2025, 4:07 AMtberman
09/24/2025, 4:08 AMVaibhav (BAML ๐)
09/24/2025, 4:08 AMtberman
09/24/2025, 4:08 AMVaibhav (BAML ๐)
09/24/2025, 4:08 AMVaibhav (BAML ๐)
09/24/2025, 4:08 AMtberman
09/24/2025, 4:08 AMtberman
09/24/2025, 4:09 AMVaibhav (BAML ๐)
09/24/2025, 4:09 AMVaibhav (BAML ๐)
09/24/2025, 4:09 AMtberman
09/24/2025, 4:09 AMVaibhav (BAML ๐)
09/24/2025, 4:09 AMtberman
09/24/2025, 4:09 AMtberman
09/24/2025, 4:09 AMtberman
09/24/2025, 4:09 AMVaibhav (BAML ๐)
09/24/2025, 4:10 AMVaibhav (BAML ๐)
09/24/2025, 4:10 AMtberman
09/24/2025, 4:15 AMtberman
09/24/2025, 4:15 AMtberman
09/24/2025, 4:15 AMtberman
09/24/2025, 4:16 AMtberman
09/24/2025, 4:16 AMtberman
09/24/2025, 4:16 AMtberman
09/24/2025, 4:16 AMtberman
09/24/2025, 4:24 AMVaibhav (BAML ๐)
09/24/2025, 1:44 PMVaibhav (BAML ๐)
09/24/2025, 1:45 PMaaronv (BAML)
09/24/2025, 3:04 PMtberman
09/24/2025, 3:07 PMtberman
09/24/2025, 3:07 PMaaronv (BAML)
09/24/2025, 3:33 PMaaronv (BAML)
09/24/2025, 3:34 PMtberman
09/24/2025, 3:39 PMtberman
09/24/2025, 3:39 PMtberman
09/24/2025, 3:39 PMaaronv (BAML)
09/24/2025, 4:58 PMtberman
09/24/2025, 7:20 PMtberman
09/24/2025, 7:20 PMtberman
09/24/2025, 7:21 PMregistry := baml.ClientRegistry{}
registry.AddLlmClient("Gemini", "vertex-ai", map[string]any{
"location": "global",
"project_id": "grand-pact-470219-h2",
"model": "gemini-2.5-flash",
"proxy_url": fmt.Sprintf("https://aiplatform.googleapis.com/v1/projects/grand-pact-470219-h2/locations/global/publishers/google/models/gemini-2.5-flash:generateContent?key=%s", os.Getenv("GEMINI_API_KEY")),
})
registry.SetPrimaryClient("Gemini")tberman
09/24/2025, 7:21 PM[2025-09-24T19:19:57Z ERROR baml_runtime::internal::llm_client::primitive::vertex::std_auth] Failed to auth using GcloudApplicationDefaultCredentials strategy
Caused by:
token request failed
[2025-09-24T19:19:57Z ERROR baml_runtime::internal::llm_client::primitive::vertex::std_auth] Failed to auth using MetadataServiceAccount strategy
Caused by:
0: HTTP request failed: client error (Connect)
1: client error (Connect)
2: dns error
3: failed to lookup address information: nodename nor servname provided, or not known
[2025-09-24T19:19:57Z ERROR baml_runtime::internal::llm_client::primitive::vertex::std_auth] Failed to auth using GCloudAuthorizedUser strategy
Caused by:
running `gcloud` command failedtberman
09/24/2025, 7:22 PMtberman
09/24/2025, 7:22 PMtberman
09/24/2025, 7:22 PMtberman
09/24/2025, 7:24 PMaaronv (BAML)
09/24/2025, 7:25 PMtberman
09/24/2025, 7:26 PMaaronv (BAML)
09/24/2025, 7:41 PMclient LLM {
options {
query_params ".."
headers "..."
}
}
so i just need to wire it in for vertexaaronv (BAML)
09/24/2025, 7:45 PMclient LLM {
options {
query_params {
key env.YourKEY
}
}
}aaronv (BAML)
09/24/2025, 7:50 PMtberman
09/24/2025, 8:05 PMtberman
09/24/2025, 8:05 PMaaronv (BAML)
09/24/2025, 8:06 PMaaronv (BAML)
09/24/2025, 8:06 PMtberman
09/24/2025, 8:09 PMaaronv (BAML)
09/24/2025, 8:34 PMtberman
09/24/2025, 8:36 PMtberman
09/24/2025, 8:37 PMaaronv (BAML)
09/24/2025, 8:37 PMaaronv (BAML)
09/24/2025, 8:37 PMaaronv (BAML)
09/24/2025, 10:48 PMaaronv (BAML)
09/24/2025, 10:48 PMtberman
09/24/2025, 10:50 PMaaronv (BAML)
09/24/2025, 10:50 PMaaronv (BAML)
09/24/2025, 11:21 PMtberman
09/24/2025, 11:25 PMtberman
09/25/2025, 5:19 PMtberman
09/25/2025, 5:19 PMFFI function error: Failed to create BAML runtime: error: Error validating field `float` in class `float`: Field name cannot be a BAML language keyword.tberman
09/25/2025, 5:19 PMVaibhav (BAML ๐)
09/25/2025, 5:20 PMaaronv (BAML)
09/25/2025, 5:20 PMVaibhav (BAML ๐)
09/25/2025, 5:20 PMtberman
09/25/2025, 5:22 PMisFloattberman
09/25/2025, 5:22 PMtberman
09/25/2025, 5:22 PMtberman
09/25/2025, 5:22 PMtberman
09/25/2025, 5:23 PMtberman
09/25/2025, 5:23 PMVaibhav (BAML ๐)
09/25/2025, 5:23 PMVaibhav (BAML ๐)
09/25/2025, 5:24 PMtberman
09/25/2025, 5:33 PMtberman
09/25/2025, 5:33 PMtberman
09/25/2025, 5:33 PMtberman
09/25/2025, 5:33 PMclient<llm> Gemini {
provider vertex-ai
options {
location "global"
project_id "grand-pact-470219-h2"
model "gemini-2.5-flash"
query_params {
key env.GEMINI_API_KEY
}
}
retry_policy Exponential
}tberman
09/25/2025, 5:33 PMtberman
09/25/2025, 5:37 PMaaronv (BAML)
09/25/2025, 5:38 PMtberman
09/25/2025, 5:40 PMaaronv (BAML)
09/25/2025, 5:42 PMtberman
09/25/2025, 5:43 PMtberman
09/25/2025, 5:43 PMtberman
09/25/2025, 5:43 PMtberman
09/25/2025, 5:44 PMtberman
09/25/2025, 5:44 PM{
"error": {
"code": 401,
"message": "API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication",
"status": "UNAUTHENTICATED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "CREDENTIALS_MISSING",
"domain": "googleapis.com",
"metadata": {
"method": "google.cloud.aiplatform.v1.PredictionService.GenerateContent",
"service": "aiplatform.googleapis.com"
}
}
]
}
}aaronv (BAML)
09/25/2025, 5:46 PMtberman
09/25/2025, 5:46 PMtberman
09/25/2025, 5:47 PMaaronv (BAML)
09/25/2025, 5:48 PMaaronv (BAML)
09/25/2025, 5:48 PMglobal as the location as well on my endtberman
09/25/2025, 5:49 PMaaronv (BAML)
09/25/2025, 5:49 PMaaronv (BAML)
09/25/2025, 5:49 PMtberman
09/25/2025, 5:50 PMtberman
09/25/2025, 5:50 PMtberman
09/25/2025, 5:50 PMYou hit the right REST method, but two things in your cURL make Vertex AI treat it like an OAuth-only call:
Youโre calling the global location.
Youโre using the non-regional host (aiplatform.googleapis.com) with an API key.
With Vertex AI, API-key auth works on the publisher endpoints when you call a region (for example us-central1) and include the key (header or ?key=). Using global generally assumes OAuth/ADC.
Google Cloud
+2
Google Cloud
+2
Try either of these (pick a region your model supports, e.g. us-central1):aaronv (BAML)
09/25/2025, 5:51 PMclient<llm> VertexWithQueryParams {
provider vertex-ai
options {
model gemini-2.5-flash
location us-central1
project_id "gloo-ai"
query_params {
key env.VERTEX_API_KEY
}
}
}aaronv (BAML)
09/25/2025, 5:51 PMtberman
09/25/2025, 5:51 PMtberman
09/25/2025, 5:51 PMtberman
09/25/2025, 5:52 PMtberman
09/25/2025, 5:53 PMtberman
09/25/2025, 5:53 PMtberman
09/25/2025, 5:53 PMtberman
09/25/2025, 5:53 PMtberman
09/25/2025, 5:53 PMtberman
09/25/2025, 5:53 PMaaronv (BAML)
09/25/2025, 5:53 PMaaronv (BAML)
09/25/2025, 5:53 PMtberman
09/25/2025, 5:54 PMtberman
09/25/2025, 5:54 PMtberman
09/25/2025, 5:54 PMtberman
09/25/2025, 5:54 PMtberman
09/25/2025, 5:54 PMtberman
09/25/2025, 5:54 PMaaronv (BAML)
09/25/2025, 5:55 PMclient<llm> VertexClaude {
provider vertex-ai
options {
model "claude-3-5-sonnet@20240620"
location us-east5
anthropic_version "vertex-2023-10-16"
credentials env.INTEG_TESTS_GOOGLE_APPLICATION_CREDENTIALS_CONTENT
}
}
Where:
the env var is a json blob:
https://cdn.discordapp.com/attachments/1420216485581820007/1420831203774173257/image.png?ex=68d6d3ac&is=68d5822c&hm=bbd431e8166ce37cc2cc5bd2b6fb86ae9379089d781fb81ec9d1d5576f19dbe8&aaronv (BAML)
09/25/2025, 5:56 PMaaronv (BAML)
09/25/2025, 5:58 PMaaronv (BAML)
09/25/2025, 5:58 PMaaronv (BAML)
09/25/2025, 6:07 PMclient<llm> VertexWithQueryParams {
provider vertex-ai
options {
model gemini-2.5-flash
location global
project_id "gloo-ai"
query_params {
key env.VERTEX_API_KEY
}
}
}
curl -X POST 'https://aiplatform.googleapis.com/v1/projects/gloo-ai/locations/global/publishers/google/models/gemini-2.5-flash:generateContent?key=xyz' -H "content-type: application/json" -d "{
\"contents\": [
{
\"role\": \"user\",
\"parts\": [
{
\"text\": \"Write a nice story.\"
}
]
}
]
}"
Something tells me there's something you need to enable on your accountaaronv (BAML)
09/25/2025, 6:20 PMtberman
09/25/2025, 7:26 PMaaronv (BAML)
09/25/2025, 7:27 PMtberman
09/25/2025, 10:28 PMtberman
09/25/2025, 10:28 PMtberman
09/25/2025, 10:28 PMtberman
09/25/2025, 10:28 PMaaronv (BAML)
09/26/2025, 1:26 AMaaronv (BAML)
09/26/2025, 1:26 AMtberman
09/26/2025, 2:05 PM