{"record":{"id":"b16797d46875649e","repo":"Budibase/budibase","slug":"no-available-llm-configurations","errorCode":null,"errorMessage":"No available LLM configurations","messagePattern":"No available LLM configurations","errorType":"http","errorClass":"HTTPError","httpStatus":500,"severity":"error","filePath":"packages/server/src/sdk/workspace/ai/llm/utils.ts","lineNumber":117,"sourceCode":"\n  const llm = await createLLM(configToUse._id)\n\n  if (\n    !llm ||\n    !options?.reasoningEffort ||\n    !(await supportsReasoningEffort(configToUse))\n  ) {\n    return llm\n  }\n  return applyReasoningEffort(llm, options.reasoningEffort)\n}\n\nexport async function getDefaultLLMOrThrow(\n  options?: GetDefaultLLMOptions\n): Promise<LLMResponse> {\n  const llm = await getDefaultLLM(options)\n  if (!llm) {\n    throw new HTTPError(\"No available LLM configurations\", 500)\n  }\n  return llm\n}\n","sourceCodeStart":99,"sourceCodeEnd":121,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/llm/utils.ts#L99-L121","documentation":"getDefaultLLMOrThrow resolves the workspace's default LLM configuration; if getDefaultLLM finds none (no LLM configs exist, none are enabled, or none match the requested options), it throws HTTPError 500 \"No available LLM configurations\". It is the guard used by chat, providerOptions and llm so callers fail fast when the workspace has no usable AI provider.","triggerScenarios":"Calling chat/providerOptions/llm helpers (or getDefaultLLMOrThrow directly) in a workspace that has zero LLM configurations, all configurations disabled, or none matching the options filter (e.g. specific provider requested).","commonSituations":"Fresh/self-hosted Budibase install where no AI/LLM config was created; AI config deleted or disabled by an admin; self-hosted environment without Budibase AI proxy credentials; environment variable for the AI service missing.","solutions":["Create an LLM/AI configuration for the workspace in the Budibase admin/settings UI.","Verify the existing LLM configuration is enabled and points at a reachable provider with valid credentials.","Check self-hosted env vars for the AI proxy (Budibase AI) are set and the service is reachable.","If calling getDefaultLLMOrThrow directly, catch the HTTPError and fall back to an explicit LLM config."],"exampleFix":"// before\nconst llm = await getDefaultLLMOrThrow()\n// after\nlet llm\ntry {\n  llm = await getDefaultLLMOrThrow()\n} catch (e) {\n  llm = await getLLM({ provider: \"openai\", credentials })\n}","handlingStrategy":"try-catch","validationCode":"const configs = await getLLMConfigs(workspaceId) // or inspect admin state\nif (!configs || configs.filter(c => c.enabled).length === 0) {\n  throw new Error(\"Workspace has no enabled LLM configuration\")\n}","typeGuard":"null","tryCatchPattern":"try {\n  const llm = await getDefaultLLMOrThrow(options)\n} catch (e) {\n  if (e instanceof HTTPError && e.status === 500 && e.message === \"No available LLM configurations\") {\n    // fall back to an explicitly configured provider or disable AI features\n  }\n  throw e\n}","preventionTips":["Provision at least one enabled LLM config per workspace during setup","Check AI configuration health after upgrades or config migrations","Gate AI features behind a config-exists check in the UI","For self-hosting, verify Budibase AI proxy env vars before enabling AI features"],"tags":["ai","configuration","http-error-500"],"backgroundTag":"missing-llm-configuration","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}