Mintplex-Labs/anything-llm · error · Error
Unknown provider: . Please use a valid provider.
Error message
Unknown provider: ${config.provider}. Please use a valid provider. What it means
Thrown by AIbitat's getProvider switch when config.provider matches none of the compiled provider cases (openai, anthropic, and many others ending at privatemode, sambanova, lemonade, omlx, minimax, cerebras in this build). The provider identifier comes from persisted workspace/system config, so the error means the stored provider string is not one this build knows how to construct.
Solutions
- Re-select the LLM provider in workspace/system settings and save — this rewrites config.provider with a valid slug.
- Upgrade AnythingLLM to the version that introduced the provider you want (e.g. cerebras, minimax, omlx are late additions).
- Inspect the persisted config (workspace settings payload) and correct the provider string to the exact slug the switch expects.
- After fixing config, restart the chat/agent session so a fresh provider instance is built.
Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED_PROVIDERS = new Set([
"openai", "anthropic", "azure", "lmstudio", "ollama", "localai",
"native", "gemini", "openrouter", "mistral", "groq",
/* ...keep in sync with your build's getProvider switch */
]);
function assertProviderKnown(config) {
if (!SUPPORTED_PROVIDERS.has(config.provider))
throw new Error(
`Provider '${config.provider}' is not available in this build. Re-select the LLM provider in settings.`
);
} Type guard
/** @param {string} p */
function isKnownProvider(p, supported) {
return typeof p === "string" && supported.has(p);
} Try / catch
try {
aibitat.getProvider(config);
} catch (e) {
if (/^Unknown provider:/.test(e.message)) {
// re-select provider in workspace settings to rewrite config.provider, or upgrade the app
return respondProviderInvalid(config.provider);
}
throw e;
} Prevention
- After upgrading or downgrading AnythingLLM, re-save the LLM provider selection in settings so persisted slugs match the build.
- Never hand-edit provider slugs in the database; use the settings UI which writes valid values.
- Maintain the supported-provider list from your build's getProvider switch in deploy validation scripts.
When it happens
Trigger: A workspace whose config.provider holds a value from a different AnythingLLM version (provider added later, or downgraded build), a hand-edited database/config entry with a typo, or a provider whose case string doesn't match exactly (the switch keys are lowercase slugs).
Common situations: Downgrading AnythingLLM after using a newly added provider; restoring a database backup from a newer instance; provider slug renamed between versions (config not migrated); custom builds compiled without a provider module.
Related errors
- ENV: No valid LLM_PROVIDER value found in environment! Using
- ENV: No TTS_PROVIDER value found in environment!
- No valid image generation provider was set. Got
- The agent model failed to respond
- An error occurred while downloading the model
AI-assisted analysis of Mintplex-Labs/anything-llm@f92433b4ea (2026-08-18).
Data as JSON: /api/errors/7f59fa699b23eef1.
Report an issue: GitHub.
Appendix: source
Thrown at server/utils/agents/aibitat/index.js:1519
return new Providers.XAIProvider({ model: config.model });
case "zai":
return new Providers.ZAIProvider({ model: config.model });
case "novita":
return new Providers.NovitaProvider({ model: config.model });
case "ppio":
return new Providers.PPIOProvider({ model: config.model });
case "gemini":
return new Providers.GeminiProvider({ model: config.model });
case "cometapi":
return new Providers.CometApiProvider({ model: config.model });
case "foundry":
return new Providers.FoundryProvider({ model: config.model });
case "giteeai":
return new Providers.GiteeAIProvider({ model: config.model });
case "cohere":
return new Providers.CohereProvider({ model: config.model });
case "llmman":
return new Providers.LlmmanProvider({ 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 });
case "vertex":
return new Providers.VertexProvider({ model: config.model });
default:
throw new Error(
`Unknown provider: ${config.provider}. Please use a valid provider.`
);View on GitHub (pinned to f92433b4ea)