Mintplex-Labs/anything-llm · error · Error

Unknown provider: ${config.provider}. Please use a valid pro

Error message

Unknown provider: ${config.provider}. Please use a valid provider.

What it means

Thrown by AIbitat.#buildProviderForConfig() when config.provider is a string that matches no case in its switch (which lists ~40 providers). The function first short-circuits if config.provider is an object (custom provider instance); this throw only fires for an unrecognized provider string. It is the single validation gate for provider identity.

Source

Thrown at server/utils/agents/aibitat/index.js:1502

        return new Providers.GiteeAIProvider({ model: config.model });
      case "cohere":
        return new Providers.CohereProvider({ model: config.model });
      case "docker-model-runner":
        return new Providers.DockerModelRunnerProvider({ model: config.model });
      case "privatemode":
        return new Providers.PrivatemodeProvider({ model: config.model });
      case "sambanova":
        return new Providers.SambaNovaProvider({ model: config.model });
      case "lemonade":
        return new Providers.LemonadeProvider({ model: config.model });
      case "omlx":
        return new Providers.OMLXProvider({ model: config.model });
      case "minimax":
        return new Providers.MinimaxProvider({ model: config.model });
      case "cerebras":
        return new Providers.CerebrasProvider({ model: config.model });
      default:
        throw new Error(
          `Unknown provider: ${config.provider}. Please use a valid provider.`
        );
    }
  }

  /**
   * Register a new function to be called by the AIbitat agents.
   * You are also required to specify the which node can call the function.
   * @param functionConfig The function configuration.
   */
  function(functionConfig) {
    this.functions.set(functionConfig.name, functionConfig);
    return this;
  }

  /**
   * Remove a registered function so the agent can no longer call it on its next
   * turn. Used to disable a tool mid-session; restore it by re-running its plugin

View on GitHub (pinned to 526360e320)

Solutions

  1. Match config.provider exactly to one of the case labels in #buildProviderForConfig (lowercase, no spaces).
  2. Check the supported-providers list for your AnythingLLM version.
  3. If the provider was renamed, update the stored config to the new identifier.
  4. Upgrade to a version that supports the provider, or pass a provider object instead of a string.

Example fix

// before - typo in provider identifier
getProviderForConfig({ provider: "anthrpic", model: "claude-3" });
// after - exact match
getProviderForConfig({ provider: "anthropic", model: "claude-3" });
Defensive patterns

Strategy: validation

Validate before calling

// validate provider identifier before instantiating
const KNOWN_PROVIDERS = ["openai","anthropic","azure","ollama","lmstudio","groq","gemini","togetherai","openrouter","mistral","deepseek","xai","zai","bedrock","cohere","localai","generic-openai","perplexity","fireworksai","litellm","apipie","mistral","novita","ppio","cometapi","foundry","giteeai","sambanova","lemonade","omlx","minimax","cerebras","nvidia-nim","moonshotai","textgenwebui","koboldcpp","docker-model-runner","privatemode"];
function validateProvider(provider) {
  if (typeof provider === "string" && !KNOWN_PROVIDERS.includes(provider))
    throw new Error(`Unknown provider: ${provider}`);
}

Type guard

const isKnownProvider = (p) => typeof p === "object" || (typeof p === "string" && KNOWN_PROVIDERS.includes(p));

Try / catch

try {
  aibitat.getProviderForConfig(config);
} catch (error) {
  if (error.message.startsWith("Unknown provider")) {
    // prompt the user to select a supported provider
  } else throw error;
}

Prevention

When it happens

Trigger: config.provider is a string not equal to any of the supported identifiers (openai, anthropic, ollama, lmstudio, groq, azure, gemini, etc.). Causes include a typo, a renamed/deprecated provider identifier, or a provider string from an incompatible version.

Common situations: Typo in the provider setting (e.g., "anthrpic"); a provider renamed between versions; a configuration/database value written by a different build; copy-pasting a provider name with different casing or spacing.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/7f59fa699b23eef1. Report an issue: GitHub.