{"record":{"id":"a9ceee60ae14d538","repo":"Budibase/budibase","slug":"provider-provider-not-found-in-litellm","errorCode":null,"errorMessage":"Provider ${provider} not found in LiteLLM","messagePattern":"Provider (.+?) not found in LiteLLM","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/sdk/workspace/ai/configs/litellm.ts","lineNumber":675,"sourceCode":"      `Error fetching LiteLLM model cost map: ${text || res.statusText}`,\n      res.status\n    )\n  }\n\n  const json = await res.json()\n  return json as LiteLLMModelCostMap\n}\n\nasync function mapToLiteLLMProvider(provider: string) {\n  if (provider === BUDIBASE_AI_PROVIDER_ID) {\n    return \"custom_openai\"\n  }\n\n  const providers = await fetchPublicProviders()\n  const result = providers.find(p => p.provider === provider)?.litellm_provider\n\n  if (!result) {\n    throw new Error(`Provider ${provider} not found in LiteLLM`)\n  }\n  return result\n}\n","sourceCodeStart":657,"sourceCodeEnd":679,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/configs/litellm.ts#L657-L679","documentation":"getLiteLLMProvider (the function containing this throw) maps a Budibase provider name to LiteLLM's litellm_provider identifier by looking it up in fetchPublicProviders(). If the provider string is not present in the fetched provider list, it throws this plain Error because no mapping exists.","triggerScenarios":"Calling the provider-mapping path with a provider value that LiteLLM does not list — e.g. a typo'd provider name, a provider supported by Budibase but not by the deployed LiteLLM version, or a case-mismatched string (exact p.provider === provider comparison).","commonSituations":"New AI provider added to Budibase before the LiteLLM proxy was upgraded; user-supplied provider strings from older configs; environment where the LiteLLM cost/providers list is a subset.","solutions":["Check the exact provider string against the list returned by /public/providers/fields and use the matching value.","Upgrade the LiteLLM proxy so it lists the desired provider.","Fix casing/spelling of the provider parameter — the lookup is an exact match."],"exampleFix":"// before\nawait getLiteLLMProvider(\"OpenAi\")\n// after (match p.provider exactly as returned by LiteLLM)\nawait getLiteLLMProvider(\"openai\")","handlingStrategy":"validation","validationCode":"const providers = await fetchPublicProviders()\nconst known = new Set(providers.map(p => p.provider))\nif (!known.has(provider)) {\n  throw new Error(`Provider \"${provider}\" not offered by LiteLLM; known: ${[...known].join(\", \")}`)\n}","typeGuard":null,"tryCatchPattern":"try {\n  const litellmProvider = await getLiteLLMProvider(provider)\n} catch (e) {\n  if (e.message.includes(\"not found in LiteLLM\")) {\n    logger.warn(`Provider ${provider} unsupported by LiteLLM proxy`)\n    return null\n  }\n  throw e\n}","preventionTips":["Copy provider strings exactly from /public/providers/fields output.","Keep Budibase and LiteLLM provider catalogs in sync via upgrades.","Validate user-supplied provider names against the fetched list before mapping."],"tags":["validation","litellm","provider-mapping","lookup-failed"],"backgroundTag":"unknown-provider","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}