{"record":{"id":"8fa80c2eb38f2f4e","repo":"Mintplex-Labs/anything-llm","slug":"no-workspace-agent-provider-set-please-set-your-a","errorCode":null,"errorMessage":"No workspace agent provider set. Please set your agent provider in the workspace's settings","messagePattern":"No workspace agent provider set\\. Please set your agent provider in the workspace's settings","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/index.js","lineNumber":296,"sourceCode":"        break;\n      case \"lemonade\":\n        if (!process.env.LEMONADE_LLM_BASE_PATH)\n          throw new Error(\"Lemonade base path must be provided to use agents.\");\n        break;\n      case \"omlx\":\n        if (!process.env.OMLX_LLM_BASE_PATH)\n          throw new Error(\"OMLX base path must be provided to use agents.\");\n        break;\n      case \"minimax\":\n        if (!process.env.MINIMAX_API_KEY)\n          throw new Error(\"Minimax API key must be provided to use agents.\");\n        break;\n      case \"cerebras\":\n        if (!process.env.CEREBRAS_API_KEY)\n          throw new Error(\"Cerebras API key must be provided to use agents.\");\n        break;\n      default:\n        throw new Error(\n          \"No workspace agent provider set. Please set your agent provider in the workspace's settings\"\n        );\n    }\n  }\n\n  /**\n   * Finds the default model for a given provider. If no default model is set for it's associated ENV then\n   * it will return a reasonable base model for the provider if one exists.\n   * @param {string} provider - The provider to find the default model for.\n   * @returns {string|null} The default model for the provider.\n   */\n  providerDefault(provider = this.provider) {\n    switch (provider) {\n      case \"openai\":\n        return process.env.OPEN_MODEL_PREF ?? \"gpt-4.1-nano\";\n      case \"anthropic\":\n        return process.env.ANTHROPIC_MODEL_PREF ?? \"claude-sonnet-4-6\";\n      case \"lmstudio\":","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/index.js#L278-L314","documentation":"Thrown by checkSetup()'s default case (server/utils/agents/index.js:295) when this.provider is a non-empty string that matches no supported provider case. This is distinct from the null-provider throws in #fetchModel/#providerSetupAndCheck: here a provider IS set but is unrecognized, deprecated, renamed, or otherwise not in the switch.","triggerScenarios":"workspace.agentProvider (or system LLM_PROVIDER) holds a value not present in the switch - a typo, a removed/renamed provider id from another version, or an all-whitespace string that bypassed the !provider check.","commonSituations":"Upgrading/downgrading AnythingLLM where a provider id was renamed/removed but the DB still stores the old value; manual DB edit of agentProvider; typo in .env LLM_PROVIDER.","solutions":["Open Workspace Settings -> Agent Configuration and re-select a currently supported provider.","If LLM_PROVIDER is the source, correct its value in .env to a supported provider id and restart.","For stale DB values, set the workspace row's agentProvider to null or a current provider id."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const SUPPORTED_PROVIDERS = new Set(['openai','anthropic','azure','ollama','lmstudio','groq','togetherai','mistral','openrouter','generic-openai','perplexity','textgenwebui','bedrock','fireworksai','deepseek','litellm','apipie','xai','zai','novita','nvidia-nim','ppio','gemini','moonshotai','cometapi','foundry','giteeai','cohere','docker-model-runner','privatemode','sambanova','lemonade','omlx','minimax','cerebras','koboldcpp','localai','anythingllm-router']);\nfunction isValidProvider(p) { return typeof p === 'string' && SUPPORTED_PROVIDERS.has(p); }\nif (provider && !isValidProvider(provider)) return rejectProvider(provider);","typeGuard":null,"tryCatchPattern":"try { await agent.init(); } catch (e) { if (/No workspace agent provider set/.test(e.message)) return reconfigureProvider(); throw e; }","preventionTips":["Keep an allow-list of provider ids and validate on save.","On version upgrades, migrate or null out deprecated provider ids.","Trim/normalize agentProvider strings before storing."],"tags":["config","agent-provider","agents"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}