mem0ai/mem0 · error · Error

Unknown LLM provider: ${providerId}

Error message

Unknown LLM provider: ${providerId}

What it means

Thrown by buildOssLlmConfig when the requested LLM provider id is not in the LLM_PROVIDERS catalog used by the open-source (OSS) setup wizard. The wizard maps a fixed set of provider ids (e.g. openai, anthropic, ollama) to defaults (defaultModel, defaultUrl); an unrecognized id cannot be configured, so the build aborts before writing config.

Source

Thrown at integrations/openclaw/cli/oss-wizard.ts:83

  return `mem0_${dims}d`;
}

// ============================================================================
// Config builders
// ============================================================================

export interface LlmConfigInput {
  apiKey?: string;
  model?: string;
  url?: string;
}

export function buildOssLlmConfig(
  providerId: string,
  input: LlmConfigInput,
): { provider: string; config: Record<string, unknown> } {
  const def = LLM_PROVIDERS.find((p) => p.id === providerId);
  if (!def) throw new Error(`Unknown LLM provider: ${providerId}`);

  const config: Record<string, unknown> = {
    model: input.model || def.defaultModel,
  };
  if (input.apiKey) config.apiKey = input.apiKey;
  if (providerId === "ollama") {
    config.url = input.url || def.defaultUrl;
  }
  return { provider: providerId, config };
}

export interface EmbedderConfigInput {
  apiKey?: string;
  model?: string;
  url?: string;
}

export function buildOssEmbedderConfig(

View on GitHub (pinned to 001c235229)

Solutions

  1. Use one of the ids listed in LLM_PROVIDERS in oss-wizard.ts — check the export for the current catalog before calling.
  2. If wizarding interactively, pick the provider from the prompt list rather than typing free-form.
  3. After a plugin upgrade, re-run the OSS wizard to regenerate config if the stored provider id no longer resolves.

Example fix

// before
buildOssLlmConfig('open_ai', { apiKey }); // Unknown LLM provider: open_ai

// after
buildOssLlmConfig('openai', { apiKey }); // matches LLM_PROVIDERS entry
Defensive patterns

Strategy: validation

Validate before calling

import { LLM_PROVIDERS } from './oss-wizard.ts';
const knownLlm = LLM_PROVIDERS.map((p) => p.id);
if (!knownLlm.includes(providerId)) {
  throw new Error(`provider must be one of: ${knownLlm.join(', ')}`);
}

Type guard

function isKnownLlmProvider(id: string): boolean {
  return LLM_PROVIDERS.some((p) => p.id === id);
}

Prevention

When it happens

Trigger: Passing a provider id not present in LLM_PROVIDERS — a typo ('open_ai'), a renamed provider from a newer wizard version, or a custom provider id read from an old config file. Callers that read provider from user input or from openclaw.json and forward it verbatim.

Common situations: Upgrading the plugin changes the provider list and an old config refers to a removed/renamed id; user types a provider name at the wizard prompt with different casing or spelling; scripting the wizard with a hardcoded id that drifted.

Related errors


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