{"record":{"id":"e994b67f583f2f4e","repo":"BoundaryML/baml","slug":"invalid-client-property-should-have-been-a-vertex-property","errorCode":null,"errorMessage":"Invalid client property. Should have been a vertex property but got: {}","messagePattern":"Invalid client property\\. Should have been a vertex property but got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/primitive/vertex/vertex_client.rs","lineNumber":58,"sourceCode":"\npub struct VertexClient {\n    pub name: String,\n    pub client: reqwest::Client,\n    pub retry_policy: Option<String>,\n    pub context: RenderContext_Client,\n    pub features: ModelFeatures,\n    properties: ResolvedVertex,\n}\n\nfn resolve_properties(\n    provider: &ClientProvider,\n    properties: &UnresolvedClientProperty<()>,\n    ctx: &RuntimeContext,\n) -> Result<ResolvedVertex, anyhow::Error> {\n    let properties = properties.resolve(provider, &ctx.eval_ctx(false))?;\n\n    let ResolvedClientProperty::Vertex(mut props) = properties else {\n        anyhow::bail!(\n            \"Invalid client property. Should have been a vertex property but got: {}\",\n            properties.name()\n        );\n    };\n\n    if props.anthropic_version.is_none() && props.model.starts_with(\"claude\") {\n        props.anthropic_version =\n            Some(internal_llm_client::anthropic::DEFAULT_ANTHROPIC_VERSION.to_string());\n    }\n\n    if let Some(anthropic_version) = &props.anthropic_version {\n        props\n            .properties\n            .entry(\"anthropic_version\".into())\n            .or_insert_with(|| json!(anthropic_version));\n        props\n            .properties\n            .entry(\"max_tokens\".into())","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/primitive/vertex/vertex_client.rs#L40-L76","documentation":"resolve_properties resolves a BAML client's properties against the provider and expects the result to be a Vertex-specific resolved property. If the resolved property is of any other kind (i.e. the client was declared for a different provider or with malformed options), it bails with this message naming the actual resolved property type.","triggerScenarios":"Declaring a BAML client with provider 'vertex' but whose resolved options are not a Vertex property block — e.g. copying options from an OpenAI/Anthropic client, or using dynamic_runtime context whose properties resolve to a different provider type.","commonSituations":"Copy-pasting a client definition and changing the provider string without changing options, or passing dynamically loaded client properties (dynamic_new) whose shape doesn't match the vertex provider.","solutions":["Check that the client's options block contains Vertex properties (model, project_id, location, etc.) and not another provider's fields","If using dynamic_runtime, ensure the client properties JSON specifies provider 'vertex' and vertex-shaped options","Rename or remove the misconfigured client and re-declare it with the correct provider/options pair"],"exampleFix":"// before (options copied from another provider)\nclient<MyVertex> MyClient {\n  provider vertex\n  options { api_key ... }\n}\n// after\nclient<MyVertex> MyClient {\n  provider vertex\n  options {\n    model gemini-1.5-pro\n    project_id my-gcp-project\n    location us-central1\n  }\n}","handlingStrategy":"validation","validationCode":"function isVertexClient(client) {\n  return client?.provider === 'vertex' &&\n    typeof client.options?.model === 'string' &&\n    (client.options?.project_id === undefined || typeof client.options.project_id === 'string');\n}","typeGuard":"function isVertexProps(p) { return !!p && p.provider === 'vertex' && typeof p.options === 'object'; }","tryCatchPattern":"try {\n  const resolved = baml_client.withOptions({}).MyClient;\n} catch (err) {\n  if (String(err).includes('Should have been a vertex property')) {\n    throw new Error('Client options are not vertex-shaped; check provider/options in baml_clients.baml');\n  }\n  throw err;\n}","preventionTips":["Match the options block to the declared provider; don't copy options across providers","Validate dynamic client properties against the vertex schema before handing them to dynamic_runtime","Lint BAML client definitions so provider/option pairs are checked"],"tags":["vertex-ai","configuration","schema"],"backgroundTag":"invalid-config-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}