{"record":{"id":"67f1cb97e2eefda8","repo":"BoundaryML/baml","slug":"model-must-be-provided","errorCode":null,"errorMessage":"model must be provided","messagePattern":"model must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-lib/llm-client/src/clients/aws_bedrock.rs","lineNumber":251,"sourceCode":"        }\n\n        match self.endpoint_url.as_ref() {\n            Some(endpoint_url) => env_vars.extend(endpoint_url.required_env_vars()),\n            None => {}\n        }\n\n        env_vars.extend(self.role_selection.required_env_vars());\n        env_vars.extend(self.allowed_role_metadata.required_env_vars());\n        env_vars.extend(self.supported_request_modes.required_env_vars());\n        if let Some(c) = self.inference_config.as_ref() {\n            env_vars.extend(c.required_env_vars())\n        }\n        env_vars\n    }\n\n    pub fn resolve(&self, ctx: &EvaluationContext<'_>) -> Result<ResolvedAwsBedrock> {\n        let Some(model) = self.model.as_ref() else {\n            return Err(anyhow::anyhow!(\"model must be provided\"));\n        };\n\n        let role_selection = self.role_selection.resolve(ctx)?;\n\n        let region = match self.region.as_ref() {\n            Some(region) => {\n                let region = region.resolve(ctx)?;\n                if region.is_empty() {\n                    return Err(anyhow::anyhow!(\"region cannot be empty\"));\n                }\n                Some(region)\n            }\n            None => match ctx.get_env_var(\"AWS_REGION\") {\n                Ok(region) if !region.is_empty() => Some(region),\n                _ => match ctx.get_env_var(\"AWS_DEFAULT_REGION\") {\n                    Ok(region) if !region.is_empty() => Some(region),\n                    _ => None,\n                },","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-lib/llm-client/src/clients/aws_bedrock.rs#L233-L269","documentation":"AwsBedrock::resolve requires a `model` field on the AWS Bedrock client config. When the config has no model set, resolution aborts with \"model must be provided\" before any API call is made. This is a fail-fast validation of a required client property.","triggerScenarios":"Calling resolve() on an AwsBedrock client-spec whose `model` property is absent (e.g. a BAML client block for aws-bedrock that omits `model`, or a programmatically constructed client with model=None).","commonSituations":"Writing a bedrock client block in BAML with only region/credentials configured; copying an OpenAI-style client config where model was inferred; typo'ing the model field name so it lands in unknown properties.","solutions":["Add a `model` field to your aws-bedrock client config (e.g. `model anthropic.claude-3-sonnet-20240229-v1:0`).","If building the config programmatically, set `model: Some(...)` on the AwsBedrock struct.","If the model is meant to come from context, set it via dynamic client resolution rather than leaving it None."],"exampleFix":"// before\nclient \"MyBedrock\" {\n  provider \"aws-bedrock\"\n  options {\n    region \"us-east-1\"\n  }\n}\n// after\nclient \"MyBedrock\" {\n  provider \"aws-bedrock\"\n  options {\n    region \"us-east-1\"\n    model \"anthropic.claude-3-sonnet-20240229-v1:0\"\n  }\n}","handlingStrategy":"validation","validationCode":"// Rust: before resolving an AwsBedrock client\nif client.model.as_ref().map_or(true, |m| m.is_empty()) {\n    return Err(anyhow::anyhow!(\"aws-bedrock client requires a `model` option\"));\n}","typeGuard":"fn has_model(c: &AwsBedrock) -> bool { c.model.is_some() }","tryCatchPattern":null,"preventionTips":["Always include `model` in every aws-bedrock client block.","Validate BAML configs in CI before deploy (baml CLI checks catch this at build time).","Keep a canonical template client per provider to copy from."],"tags":["aws-bedrock","config","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}