BoundaryML/baml · error
Invalid client property. Should have been a vertex property
Error message
Invalid client property. Should have been a vertex property but got: {} What it means
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.
Source
Thrown at engine/baml-runtime/src/internal/llm_client/primitive/vertex/vertex_client.rs:58
pub struct VertexClient {
pub name: String,
pub client: reqwest::Client,
pub retry_policy: Option<String>,
pub context: RenderContext_Client,
pub features: ModelFeatures,
properties: ResolvedVertex,
}
fn resolve_properties(
provider: &ClientProvider,
properties: &UnresolvedClientProperty<()>,
ctx: &RuntimeContext,
) -> Result<ResolvedVertex, anyhow::Error> {
let properties = properties.resolve(provider, &ctx.eval_ctx(false))?;
let ResolvedClientProperty::Vertex(mut props) = properties else {
anyhow::bail!(
"Invalid client property. Should have been a vertex property but got: {}",
properties.name()
);
};
if props.anthropic_version.is_none() && props.model.starts_with("claude") {
props.anthropic_version =
Some(internal_llm_client::anthropic::DEFAULT_ANTHROPIC_VERSION.to_string());
}
if let Some(anthropic_version) = &props.anthropic_version {
props
.properties
.entry("anthropic_version".into())
.or_insert_with(|| json!(anthropic_version));
props
.properties
.entry("max_tokens".into())View on GitHub (pinned to bd85ce9dee)
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
Example fix
// before (options copied from another provider)
client<MyVertex> MyClient {
provider vertex
options { api_key ... }
}
// after
client<MyVertex> MyClient {
provider vertex
options {
model gemini-1.5-pro
project_id my-gcp-project
location us-central1
}
} Defensive patterns
Strategy: validation
Validate before calling
function isVertexClient(client) {
return client?.provider === 'vertex' &&
typeof client.options?.model === 'string' &&
(client.options?.project_id === undefined || typeof client.options.project_id === 'string');
} Type guard
function isVertexProps(p) { return !!p && p.provider === 'vertex' && typeof p.options === 'object'; } Try / catch
try {
const resolved = baml_client.withOptions({}).MyClient;
} catch (err) {
if (String(err).includes('Should have been a vertex property')) {
throw new Error('Client options are not vertex-shaped; check provider/options in baml_clients.baml');
}
throw err;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- options.project_id is required when using API key auth with
- No source root contains {}
- Playground server requires either BAML_PLAYGROUND_DEV_PORT o
- Invalid BAML_PLAYGROUND_DEV_PORT: {e}
- manifest schema {got} not supported (max {max}); run `baml s
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/e994b67f583f2f4e.
Report an issue: GitHub.