{"record":{"id":"7f59fa699b23eef1","repo":"Mintplex-Labs/anything-llm","slug":"unknown-provider-config-provider-please-use-a","errorCode":null,"errorMessage":"Unknown provider: ${config.provider}. Please use a valid provider.","messagePattern":"Unknown provider: (.+?)\\. Please use a valid provider\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/aibitat/index.js","lineNumber":1502,"sourceCode":"        return new Providers.GiteeAIProvider({ model: config.model });\n      case \"cohere\":\n        return new Providers.CohereProvider({ model: config.model });\n      case \"docker-model-runner\":\n        return new Providers.DockerModelRunnerProvider({ model: config.model });\n      case \"privatemode\":\n        return new Providers.PrivatemodeProvider({ model: config.model });\n      case \"sambanova\":\n        return new Providers.SambaNovaProvider({ model: config.model });\n      case \"lemonade\":\n        return new Providers.LemonadeProvider({ model: config.model });\n      case \"omlx\":\n        return new Providers.OMLXProvider({ model: config.model });\n      case \"minimax\":\n        return new Providers.MinimaxProvider({ model: config.model });\n      case \"cerebras\":\n        return new Providers.CerebrasProvider({ model: config.model });\n      default:\n        throw new Error(\n          `Unknown provider: ${config.provider}. Please use a valid provider.`\n        );\n    }\n  }\n\n  /**\n   * Register a new function to be called by the AIbitat agents.\n   * You are also required to specify the which node can call the function.\n   * @param functionConfig The function configuration.\n   */\n  function(functionConfig) {\n    this.functions.set(functionConfig.name, functionConfig);\n    return this;\n  }\n\n  /**\n   * Remove a registered function so the agent can no longer call it on its next\n   * turn. Used to disable a tool mid-session; restore it by re-running its plugin","sourceCodeStart":1484,"sourceCodeEnd":1520,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/aibitat/index.js#L1484-L1520","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Match config.provider exactly to one of the case labels in #buildProviderForConfig (lowercase, no spaces).","Check the supported-providers list for your AnythingLLM version.","If the provider was renamed, update the stored config to the new identifier.","Upgrade to a version that supports the provider, or pass a provider object instead of a string."],"exampleFix":"// before - typo in provider identifier\ngetProviderForConfig({ provider: \"anthrpic\", model: \"claude-3\" });\n// after - exact match\ngetProviderForConfig({ provider: \"anthropic\", model: \"claude-3\" });","handlingStrategy":"validation","validationCode":"// validate provider identifier before instantiating\nconst 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\"];\nfunction validateProvider(provider) {\n  if (typeof provider === \"string\" && !KNOWN_PROVIDERS.includes(provider))\n    throw new Error(`Unknown provider: ${provider}`);\n}","typeGuard":"const isKnownProvider = (p) => typeof p === \"object\" || (typeof p === \"string\" && KNOWN_PROVIDERS.includes(p));","tryCatchPattern":"try {\n  aibitat.getProviderForConfig(config);\n} catch (error) {\n  if (error.message.startsWith(\"Unknown provider\")) {\n    // prompt the user to select a supported provider\n  } else throw error;\n}","preventionTips":["Store provider identifiers exactly as defined in the switch (lowercase, hyphenated where applicable).","Validate provider strings at the settings boundary before persisting them.","After upgrades, migrate any renamed provider identifiers in stored config."],"tags":["provider","configuration","aibitat","validation"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}