{"record":{"id":"cc60ff941ed9e74a","repo":"Mintplex-Labs/anything-llm","slug":"cerebras-api-key-must-be-provided-to-use-agents","errorCode":null,"errorMessage":"Cerebras API key must be provided to use agents.","messagePattern":"Cerebras API key must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/index.js","lineNumber":293,"sourceCode":"      case \"sambanova\":\n        if (!process.env.SAMBANOVA_LLM_API_KEY)\n          throw new Error(\"SambaNova API key must be provided to use agents.\");\n        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\";","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/agents/index.js#L275-L311","documentation":"Setup check in the agent workspace provider switch: the 'cerebras' provider was chosen for agents but the CEREBRAS_API_KEY environment variable is missing, so agent runs cannot authenticate against the Cerebras API and setup aborts.","triggerScenarios":"Cerebras was selected as the agent provider but no API key is configured.","commonSituations":"This error is raised at runtime in server/utils/agents/index.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.","solutions":["Set the CEREBRAS_API_KEY environment variable.","Or select a different agent provider."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}