{"record":{"id":"fed3c24a9489fbf5","repo":"Budibase/budibase","slug":"litellm-should-be-configured-contact-support-if-t","errorCode":null,"errorMessage":"LiteLLM should be configured. Contact support if the issue persists.","messagePattern":"LiteLLM should be configured\\. Contact support if the issue persists\\.","errorType":"http","errorClass":"HTTPError","httpStatus":500,"severity":"critical","filePath":"packages/server/src/sdk/workspace/ai/llm/litellm.ts","lineNumber":192,"sourceCode":"  return (await response.json()) as AIQuotaUsageResponse\n}\n\nconst getLiteLLMProviderOptions = (hasTools: boolean) => {\n  if (!hasTools) return\n  return {\n    openai: {\n      parallelToolCalls: true,\n    },\n  }\n}\n\nasync function getLiteLLMModelSettings(): Promise<{\n  apiKey: string\n  baseUrl: string\n}> {\n  const { secretKey } = await getKeySettings()\n  if (!secretKey) {\n    throw new HTTPError(\n      \"LiteLLM should be configured. Contact support if the issue persists.\",\n      500\n    )\n  }\n\n  return {\n    apiKey: secretKey,\n    baseUrl: environment.LITELLM_URL,\n  }\n}\n\nasync function uploadFile({\n  stream,\n  filename,\n  purpose,\n  model,\n  apiKey,\n}: {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/llm/litellm.ts#L174-L210","documentation":"Thrown by getLiteLLMModelSettings when the LiteLLM proxy secret key cannot be resolved from key settings. Model settings (apiKey/baseUrl) cannot be built without it, so LiteLLM-backed LLM calls fail fast with HTTPError 500 advising contacting support.","triggerScenarios":"Any LLM call routed through LiteLLM when getKeySettings() returns no secretKey — LiteLLM integration not configured for the environment/tenant, or the stored key settings record is empty/corrupted.","commonSituations":"Fresh installations where LiteLLM keys were never provisioned; key settings wiped by a config reset/migration; multi-tenant setups where the tenant lacks LiteLLM configuration.","solutions":["Configure the LiteLLM secret key in the environment/tenant settings (admin/_env configuration)","Verify the key settings record exists and is readable in the database","Restart services after updating the LiteLLM configuration","If self-hosting and the key should exist, check backend-core environment LITELLM_* variables and key provisioning scripts"],"exampleFix":"// before: calling litellm path without configured key\nconst settings = await getLiteLLMModelSettings() // throws\n// after: guard first\nconst { secretKey } = await getKeySettings()\nif (!secretKey) {\n  console.error(\"LiteLLM not configured\")\n  return fallbackProvider()\n}","handlingStrategy":"validation","validationCode":"const { secretKey } = await getKeySettings()\nif (!secretKey) {\n  throw new Error(\"LiteLLM secret key is not configured for this environment\")\n}","typeGuard":null,"tryCatchPattern":"try {\n  const settings = await getLiteLLMModelSettings()\n} catch (e) {\n  if (e instanceof HTTPError && e.message.includes(\"LiteLLM should be configured\")) {\n    return { error: \"LiteLLM is not configured — contact your administrator\" }\n  }\n  throw e\n}","preventionTips":["Provision LiteLLM keys during environment bootstrap scripts","Alert on empty key settings after config resets or migrations","Verify per-tenant LiteLLM configuration in multi-tenant deployments"],"tags":["litellm","configuration","secret-key","budibase-ai"],"backgroundTag":"missing-credentials","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}