{"record":{"id":"bf3b587f9da76e66","repo":"Mintplex-Labs/anything-llm","slug":"aws-bedrock-llm-region-is-required-for-aws-bedrock","errorCode":null,"errorMessage":"AWS_BEDROCK_LLM_REGION is required for AWS Bedrock.","messagePattern":"AWS_BEDROCK_LLM_REGION is required for AWS Bedrock\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/utils/AiProviders/bedrock/index.js","lineNumber":65,"sourceCode":"  noSystemPromptModels = [\n    \"amazon.titan-text-express-v1\",\n    \"amazon.titan-text-lite-v1\",\n    \"cohere.command-text-v14\",\n    \"cohere.command-light-text-v14\",\n    \"us.deepseek.r1-v1:0\",\n  ];\n\n  noTemperatureModels = [\n    \"anthropic.claude-opus-4-7\",\n    \"anthropic.claude-opus-4-8\",\n    \"anthropic.claude-sonnet-5\",\n  ];\n\n  constructor(embedder = null, modelPreference = null) {\n    if (!process.env.AWS_BEDROCK_LLM_API_KEY)\n      throw new Error(\"AWS_BEDROCK_LLM_API_KEY is required for AWS Bedrock.\");\n    if (!process.env.AWS_BEDROCK_LLM_REGION)\n      throw new Error(\"AWS_BEDROCK_LLM_REGION is required for AWS Bedrock.\");\n\n    this.className = \"AWSBedrockLLM\";\n    this.model =\n      modelPreference || process.env.AWS_BEDROCK_LLM_MODEL_PREFERENCE;\n    this.region = process.env.AWS_BEDROCK_LLM_REGION;\n\n    const contextWindowLimit = this.promptWindowLimit();\n    this.limits = {\n      history: Math.floor(contextWindowLimit * 0.15),\n      system: Math.floor(contextWindowLimit * 0.15),\n      user: Math.floor(contextWindowLimit * 0.7),\n    };\n\n    this.openai = new OpenAIApi({\n      apiKey: process.env.AWS_BEDROCK_LLM_API_KEY,\n      baseURL: openaiBaseURL(this.region),\n    });\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/20f6d3546c1938bfea1ad304f58a592dddcc5948/server/utils/AiProviders/bedrock/index.js#L47-L83","documentation":"Configuration guard thrown by the AWSBedrockLLM constructor: the API key check passed but AWS_BEDROCK_LLM_REGION is empty/unset, so the client cannot determine which AWS region to send Bedrock requests to.","triggerScenarios":"Thrown at provider construction when AWS_BEDROCK_LLM_REGION is missing.","commonSituations":"AWS Bedrock selected without a region configured.","solutions":["Set the AWS_BEDROCK_LLM_REGION environment variable (e.g. us-east-1).","Configure the Bedrock region in provider settings."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"20f6d3546c1938bfea1ad304f58a592dddcc5948","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}