mem0ai/mem0 · error · ValueError
Unknown provider_override '{explicit_provider}'. Valid provi
Error message
Unknown provider_override '{explicit_provider}'. Valid providers: {', '.join(PROVIDERS)} What it means
Raised by extract_provider() when config.provider_override (or the explicit_provider argument) is set to a string not in the module's PROVIDERS allowlist (ai21, amazon, anthropic, cohere, meta, mistral, stability, writer, deepseek, gpt-oss, perplexity, snowflake, titan, command, j2, llama, minimax). The override exists to disambiguate model IDs; an unrecognized value is rejected before any AWS call.
Source
Thrown at mem0/llms/aws_bedrock.py:30
from mem0.configs.llms.aws_bedrock import AWSBedrockConfig
from mem0.configs.llms.base import BaseLlmConfig
from mem0.llms.base import LLMBase
from mem0.memory.utils import extract_json
logger = logging.getLogger(__name__)
PROVIDERS = [
"ai21", "amazon", "anthropic", "cohere", "meta", "mistral", "stability", "writer",
"deepseek", "gpt-oss", "perplexity", "snowflake", "titan", "command", "j2", "llama",
"minimax",
]
def extract_provider(model: str, explicit_provider: Optional[str] = None) -> str:
"""Extract provider from model identifier, or return explicit_provider when set."""
if explicit_provider:
if explicit_provider not in PROVIDERS:
raise ValueError(
f"Unknown provider_override '{explicit_provider}'. Valid providers: {', '.join(PROVIDERS)}"
)
return explicit_provider
for provider in PROVIDERS:
if re.search(rf"\b{re.escape(provider)}\b", model):
return provider
raise ValueError(f"Unknown provider in model: {model}")
class AWSBedrockLLM(LLMBase):
"""
AWS Bedrock LLM integration for Mem0.
Supports all available Bedrock models with automatic provider detection.
"""
def __init__(self, config: Optional[Union[AWSBedrockConfig, BaseLlmConfig, Dict]] = None):
"""View on GitHub (pinned to 001c235229)
Solutions
- Use the exact lowercase provider key from the error message's valid list (e.g. anthropic, amazon, mistral)
- Remove provider_override entirely and let automatic detection infer the provider from the model ID prefix
- Upgrade mem0ai if the provider you need was added in a later version of the allowlist
Example fix
// before
{"llm": {"provider": "aws_bedrock", "config": {"model": "anthropic.claude-3-5-sonnet-20240620-v1:0", "provider_override": "Anthropic"}}} # ValueError
# after
{"llm": {"provider": "aws_bedrock", "config": {"model": "anthropic.claude-3-5-sonnet-20240620-v1:0", "provider_override": "anthropic"}}} Defensive patterns
Strategy: validation
Validate before calling
PROVIDERS = {"ai21","amazon","anthropic","cohere","meta","mistral","stability","writer",
"deepseek","gpt-oss","perplexity","snowflake","titan","command","j2","llama","minimax"}
override = llm_config.get("provider_override")
if override is not None:
assert override.lower() in PROVIDERS, f"provider_override must be one of {sorted(PROVIDERS)}" Type guard
PROVIDERS = {"ai21","amazon","anthropic","cohere","meta","mistral","stability","writer",
"deepseek","gpt-oss","perplexity","snowflake","titan","command","j2","llama","minimax"}
def is_valid_provider_override(p: str) -> bool:
return p in PROVIDERS Try / catch
try:
llm = AWSBedrockLLM(config)
except ValueError as e:
if "provider_override" in str(e):
config["provider_override"] = config["provider_override"].lower()
llm = AWSBedrockLLM(config) # retry with normalized casing
else:
raise Prevention
- Use exact lowercase provider keys
- Omit provider_override unless detection actually fails
- Re-check the allowlist after upgrading mem0ai
When it happens
Trigger: Setting provider_override: "Anthropic" (wrong case), "bedrock", "openai", or a typo like "anthrpoic" in the LLM config; passing an unsupported new provider name before this mem0 version's allowlist includes it.
Common situations: Copy-pasting provider names from AWS console ARNs; case-sensitive mismatch; expecting a provider added in a newer mem0 release while running an older one.
Related errors
- Unknown provider in model: {model}
- The 'boto3' library is required. Please install it using 'pi
- AWS credentials not found. Please set AWS_ACCESS_KEY_ID, AWS
- Unauthorized access to Bedrock. Please ensure your AWS crede
- AWS Bedrock error: {e}
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/8d8ed627035cc55a.
Report an issue: GitHub.