Budibase/budibase · error · Error

Provider ${provider} not found in LiteLLM

Error message

Provider ${provider} not found in LiteLLM

What it means

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.

Source

Thrown at packages/server/src/sdk/workspace/ai/configs/litellm.ts:675

      `Error fetching LiteLLM model cost map: ${text || res.statusText}`,
      res.status
    )
  }

  const json = await res.json()
  return json as LiteLLMModelCostMap
}

async function mapToLiteLLMProvider(provider: string) {
  if (provider === BUDIBASE_AI_PROVIDER_ID) {
    return "custom_openai"
  }

  const providers = await fetchPublicProviders()
  const result = providers.find(p => p.provider === provider)?.litellm_provider

  if (!result) {
    throw new Error(`Provider ${provider} not found in LiteLLM`)
  }
  return result
}

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Check the exact provider string against the list returned by /public/providers/fields and use the matching value.
  2. Upgrade the LiteLLM proxy so it lists the desired provider.
  3. Fix casing/spelling of the provider parameter — the lookup is an exact match.

Example fix

// before
await getLiteLLMProvider("OpenAi")
// after (match p.provider exactly as returned by LiteLLM)
await getLiteLLMProvider("openai")
Defensive patterns

Strategy: validation

Validate before calling

const providers = await fetchPublicProviders()
const known = new Set(providers.map(p => p.provider))
if (!known.has(provider)) {
  throw new Error(`Provider "${provider}" not offered by LiteLLM; known: ${[...known].join(", ")}`)
}

Try / catch

try {
  const litellmProvider = await getLiteLLMProvider(provider)
} catch (e) {
  if (e.message.includes("not found in LiteLLM")) {
    logger.warn(`Provider ${provider} unsupported by LiteLLM proxy`)
    return null
  }
  throw e
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/a9ceee60ae14d538. Report an issue: GitHub.