{"record":{"id":"797987f21614de69","repo":"mem0ai/mem0","slug":"unknown-provideroverride-provideroverride-va","errorCode":null,"errorMessage":"Unknown providerOverride '${providerOverride}'. Valid providers: ${PROVIDERS.join(\", \")}","messagePattern":"Unknown providerOverride '(.+?)'\\. Valid providers: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/llms/aws_bedrock.ts","lineNumber":38,"sourceCode":"  \"snowflake\",\n  \"titan\",\n  \"command\",\n  \"j2\",\n  \"llama\",\n  \"minimax\",\n];\n\n/**\n * Extract the model-family provider from a Bedrock model id\n * (e.g. `anthropic.claude-3-sonnet-...` -> `anthropic`).\n */\nexport function extractProvider(\n  model: string,\n  providerOverride?: string,\n): string {\n  if (providerOverride) {\n    if (!PROVIDERS.includes(providerOverride)) {\n      throw new Error(\n        `Unknown providerOverride '${providerOverride}'. Valid providers: ${PROVIDERS.join(\", \")}`,\n      );\n    }\n    return providerOverride;\n  }\n  for (const provider of PROVIDERS) {\n    const re = new RegExp(\n      `\\\\b${provider.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}\\\\b`,\n    );\n    if (re.test(model)) return provider;\n  }\n  throw new Error(`Unknown provider in model: ${model}`);\n}\n\n/**\n * AWS Bedrock fields (awsRegion / awsAccessKeyId / awsSecretAccessKey /\n * awsSessionToken / client) now live on the shared `LLMConfig`, so the\n * provider is configurable through the standard typed `Memory` config path.","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/llms/aws_bedrock.ts#L20-L56","documentation":"extractProvider() maps a Bedrock model id to a provider family. If you pass an explicit providerOverride, it must be one of the recognized list (ai21, amazon, anthropic, cohere, meta, mistral, stability, writer, deepseek, gpt-oss, perplexity, snowflake, titan, command, j2, llama, minimax); anything else throws immediately with the valid options enumerated.","triggerScenarios":"Calling the Bedrock LLM with config.providerOverride set to e.g. 'openai', 'Claude', 'bedrock', or a custom inference-profile prefix; copy-pasting a provider name from a different SDK's vocabulary; case or whitespace mismatches.","commonSituations":"Using cross-region/custom model ids (e.g. us.anthropic... or a custom ARN) where the model prefix no longer matches a known provider, so the user adds an override with the wrong value; migrating configs from the Python SDK whose provider names differ.","solutions":["Set providerOverride to one of the values listed in the error message, e.g. 'anthropic' or 'amazon'","Fix casing/whitespace: the check is exact and case-sensitive","If your model id already contains a known provider token (e.g. anthropic.claude-3-...), omit providerOverride entirely"],"exampleFix":"// before\nnew AWSBedrockLLM({ model: \"eu.anthropic.claude-3-sonnet...\", providerOverride: \"claude\" });\n\n// after\nnew AWSBedrockLLM({ model: \"eu.anthropic.claude-3-sonnet...\", providerOverride: \"anthropic\" });","handlingStrategy":"validation","validationCode":"const VALID_PROVIDERS = new Set([\"ai21\",\"amazon\",\"anthropic\",\"cohere\",\"meta\",\"mistral\",\"stability\",\"writer\",\"deepseek\",\"gpt-oss\",\"perplexity\",\"snowflake\",\"titan\",\"command\",\"j2\",\"llama\",\"minimax\"]);\nif (override && !VALID_PROVIDERS.has(override)) {\n  throw new Error(`providerOverride '${override}' is not recognized; use a value from the Bedrock provider list`);\n}","typeGuard":"function isUnknownOverrideError(err: unknown): boolean {\n  return err instanceof Error && err.message.startsWith(\"Unknown providerOverride\");\n}","tryCatchPattern":"try { extractProvider(model, override); }\ncatch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unknown providerOverride\")) {\n    throw new Error(\"Fix Bedrock config: providerOverride must be a known provider family\");\n  }\n  throw err;\n}","preventionTips":["Validate providerOverride against the known list at config load time","Prefer full Bedrock model ids (provider-prefixed) so no override is needed","The check is case-sensitive and exact - normalize input before passing"],"tags":["aws-bedrock","configuration","validation","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}