{"record":{"id":"2f6042a4b16ca0af","repo":"mem0ai/mem0","slug":"unsupported-llm-provider-provider","errorCode":null,"errorMessage":"Unsupported LLM provider: ${provider}","messagePattern":"Unsupported LLM provider: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/utils/factory.ts","lineNumber":149,"sourceCode":"        return new LangchainLLM(config);\n      case \"deepseek\":\n        return new DeepSeekLLM(config);\n      case \"xai\":\n        return new XAILLM(config);\n      case \"sarvam\":\n        return new SarvamLLM(config);\n      case \"aws_bedrock\":\n        return new AWSBedrockLLM(config);\n      case \"litellm\":\n        return new LiteLLM(config);\n      case \"minimax\":\n        return new MiniMaxLLM(config);\n      case \"together\":\n        return new TogetherLLM(config);\n      case \"vllm\":\n        return new VllmLLM(config);\n      default:\n        throw new Error(`Unsupported LLM provider: ${provider}`);\n    }\n  }\n}\n\nexport class VectorStoreFactory {\n  static create(provider: string, config: VectorStoreConfig): VectorStore {\n    switch (provider.toLowerCase()) {\n      case \"memory\":\n        return new MemoryVectorStore(config);\n      case \"baidu\":\n        return new BaiduDB(config as any);\n      case \"qdrant\":\n        return new Qdrant(config as any);\n      case \"chroma\":\n        return new ChromaDB(config as any);\n      case \"redis\":\n        return new RedisDB(config as any);\n      case \"valkey\":","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/utils/factory.ts#L131-L167","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use an exact provider identifier from the switch in LLMFactory.create (mem0-ts/src/oss/src/utils/factory.ts).","Verify you did not put the model name in the provider field; model goes in config.model.","If the provider is unsupported in TS, choose the closest supported provider or extend the factory via a local fork/PR."],"exampleFix":"// before\nllm: { provider: 'bedrock', config: { model: 'anthropic.claude-3-sonnet' } }\n// after\nllm: { provider: 'aws_bedrock', config: { model: 'anthropic.claude-3-sonnet' } }","handlingStrategy":"validation","validationCode":"const SUPPORTED_LLMS = ['openai','openai_structured','anthropic','aws_bedrock','litellm','minimax','together','vllm'];\nfunction assertLlmProvider(provider: string) {\n  if (!SUPPORTED_LLMS.includes(provider.toLowerCase()))\n    throw new Error(`Unsupported LLM '${provider}'. Supported: ${SUPPORTED_LLMS.join(', ')}`);\n}","typeGuard":"const isKnownLlm = (p: string): boolean => SUPPORTED_LLMS.includes(p.toLowerCase());","tryCatchPattern":"try { new Memory(cfg) } catch (e) { if (e instanceof Error && /Unsupported LLM provider/.test(e.message)) { return badConfigResponse(e.message); } throw e; }","preventionTips":["Never put a model name in the provider field; model belongs in config.model.","Type your config with mem0-ts types so provider is a literal union if available.","Log the provider value at startup to catch typos early."],"tags":["configuration","llm","typescript","factory"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}