{"record":{"id":"ca313322e7da1c87","repo":"BoundaryML/baml","slug":"aws-bedrock-support-was-not-compiled-into-this-build-enable","errorCode":null,"errorMessage":"AWS Bedrock support was not compiled into this build (enable the `bedrock` feature)","messagePattern":"AWS Bedrock support was not compiled into this build \\(enable the `bedrock` feature\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/primitive/mod.rs","lineNumber":150,"sourceCode":"                    OpenAIClientProviderVariant::Generic => {\n                        OpenAIClient::dynamic_new_generic(value, ctx).map(Into::into)\n                    }\n                    OpenAIClientProviderVariant::Responses => {\n                        OpenAIClient::dynamic_new_responses(value, ctx).map(Into::into)\n                    }\n                    OpenAIClientProviderVariant::Transcriptions => {\n                        OpenAIClient::dynamic_new_transcriptions(value, ctx).map(Into::into)\n                    }\n                    OpenAIClientProviderVariant::OpenRouter => {\n                        OpenAIClient::dynamic_new_openrouter(value, ctx).map(Into::into)\n                    }\n                }\n            }\n            ClientProvider::Anthropic => AnthropicClient::dynamic_new(value, ctx).map(Into::into),\n            #[cfg(feature = \"bedrock\")]\n            ClientProvider::AwsBedrock => AwsClient::dynamic_new(value, ctx).map(Into::into),\n            #[cfg(not(feature = \"bedrock\"))]\n            ClientProvider::AwsBedrock => anyhow::bail!(\n                \"AWS Bedrock support was not compiled into this build (enable the `bedrock` feature)\"\n            ),\n            ClientProvider::GoogleAi => GoogleAIClient::dynamic_new(value, ctx).map(Into::into),\n            ClientProvider::Vertex => VertexClient::dynamic_new(value, ctx).map(Into::into),\n            ClientProvider::Strategy(strategy_client_provider) => {\n                unimplemented!(\n                    \"Strategy client providers are not supported yet in LLMPrimitiveProvider\"\n                )\n            } // \"openai\" => OpenAIClient::dynamic_new(value, ctx).map(Into::into),\n              // \"openai-generic\" => OpenAIClient::dynamic_new_generic(value, ctx).map(Into::into),\n              // \"azure-openai\" => OpenAIClient::dynamic_new_azure(value, ctx).map(Into::into),\n              // \"ollama\" => OpenAIClient::dynamic_new_ollama(value, ctx).map(Into::into),\n              // \"anthropic\" => AnthropicClient::dynamic_new(value, ctx).map(Into::into),\n              // \"google-ai\" => GoogleAIClient::dynamic_new(value, ctx).map(Into::into),\n              // \"vertex-ai\" => VertexClient::dynamic_new(value, ctx).map(Into::into),\n              // // dynamic_new is not implemented for aws::AwsClient\n              // other => {\n              //     let options = [","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/primitive/mod.rs#L132-L168","documentation":"BAML compiles AWS Bedrock support behind the optional `bedrock` cargo feature. When a config declares an aws-bedrock client but the runtime binary was built without that feature, dynamic client construction bails with this message. The configuration itself may be fine; the build simply lacks the provider.","triggerScenarios":"Using a BAML runtime build compiled without the `bedrock` feature (e.g. a language client distribution that excludes Bedrock) while a prompt's client block specifies provider \"aws-bedrock\".","commonSituations":"Installing a prebuilt baml language-client package that ships without Bedrock support, or building BAML from source with default features and then pointing a project at Bedrock; also happens in some Python/Node bindings built for size.","solutions":["Use a BAML build/distribution compiled with the `bedrock` feature enabled.","Build BAML from source with `--features bedrock`.","Switch the prompt's client provider to one available in your build (e.g. openai, anthropic, google-ai).","Check your installed binding's feature set / docs to confirm Bedrock support before configuring it."],"exampleFix":"// before\ncargo build -p baml-runtime --no-default-features\n// after\ncargo build -p baml-runtime --features bedrock","handlingStrategy":"fallback","validationCode":"// Detect support before configuring\nconst supportsBedrock = /* runtime feature check or docs */ true;\nif (clientProvider === 'aws-bedrock' && !supportsBedrock) throw new Error('This BAML build lacks the `bedrock` feature; use another provider or a Bedrock-enabled build.');","typeGuard":null,"tryCatchPattern":"try { await b.MyPrompt(...) } catch (e) { if (String(e).includes('not compiled into this build')) { /* switch to openai/anthropic client or reinstall a bedrock-enabled build */ } else throw e; }","preventionTips":["Confirm your BAML distribution includes the `bedrock` feature before using aws-bedrock providers.","Build from source with --features bedrock if needed.","Keep a non-Bedrock fallback client in your generator config."],"tags":["aws-bedrock","feature-flag","build","missing-dependency"],"backgroundTag":"feature-not-enabled","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"}