mem0ai/mem0 · error · Error

Unsupported LLM provider: ${provider}

Error message

Unsupported LLM provider: ${provider}

What it means

Thrown by LLMFactory.create when the LLM provider string does not match any supported case (openai, anthropic, aws_bedrock, litellm, minimax, together, vllm, and others in the switch). It signals that the provider name supplied in the llm config cannot be resolved to an LLM implementation class. Comparison is lowercased, but the name must otherwise exactly match a case.

Source

Thrown at mem0-ts/src/oss/src/utils/factory.ts:149

        return new LangchainLLM(config);
      case "deepseek":
        return new DeepSeekLLM(config);
      case "xai":
        return new XAILLM(config);
      case "sarvam":
        return new SarvamLLM(config);
      case "aws_bedrock":
        return new AWSBedrockLLM(config);
      case "litellm":
        return new LiteLLM(config);
      case "minimax":
        return new MiniMaxLLM(config);
      case "together":
        return new TogetherLLM(config);
      case "vllm":
        return new VllmLLM(config);
      default:
        throw new Error(`Unsupported LLM provider: ${provider}`);
    }
  }
}

export class VectorStoreFactory {
  static create(provider: string, config: VectorStoreConfig): VectorStore {
    switch (provider.toLowerCase()) {
      case "memory":
        return new MemoryVectorStore(config);
      case "baidu":
        return new BaiduDB(config as any);
      case "qdrant":
        return new Qdrant(config as any);
      case "chroma":
        return new ChromaDB(config as any);
      case "redis":
        return new RedisDB(config as any);
      case "valkey":

View on GitHub (pinned to 001c235229)

Solutions

  1. Use an exact provider identifier from the switch in LLMFactory.create (mem0-ts/src/oss/src/utils/factory.ts).
  2. Verify you did not put the model name in the provider field; model goes in config.model.
  3. If the provider is unsupported in TS, choose the closest supported provider or extend the factory via a local fork/PR.

Example fix

// before
llm: { provider: 'bedrock', config: { model: 'anthropic.claude-3-sonnet' } }
// after
llm: { provider: 'aws_bedrock', config: { model: 'anthropic.claude-3-sonnet' } }
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_LLMS = ['openai','openai_structured','anthropic','aws_bedrock','litellm','minimax','together','vllm'];
function assertLlmProvider(provider: string) {
  if (!SUPPORTED_LLMS.includes(provider.toLowerCase()))
    throw new Error(`Unsupported LLM '${provider}'. Supported: ${SUPPORTED_LLMS.join(', ')}`);
}

Type guard

const isKnownLlm = (p: string): boolean => SUPPORTED_LLMS.includes(p.toLowerCase());

Try / catch

try { new Memory(cfg) } catch (e) { if (e instanceof Error && /Unsupported LLM provider/.test(e.message)) { return badConfigResponse(e.message); } throw e; }

Prevention

When it happens

Trigger: new Memory({ llm: { provider: 'bedrock', config: {...} } }) (should be 'aws_bedrock'), provider: 'gpt-4o' (model name passed instead of provider), or a provider only supported in the Python SDK.

Common situations: Confusing model name with provider name; renaming drift between mem0 Python and mem0-ts provider identifiers; typo in config files or env-derived provider strings.

Related errors


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/2f6042a4b16ca0af. Report an issue: GitHub.