Budibase/budibase · error · Error

Provider ${config.provider} not found

Error message

Provider ${config.provider} not found

What it means

sanitizeConfig resolves the AI provider id stored on a CustomAIProviderConfig against the live list of LiteLLM providers (fetchLiteLLMProviders). If no provider with that id exists, it throws a plain Error. This runs on every read (fetchAIConfigs) and write (create/update), so it also surfaces when listing configs, not only when creating one.

Source

Thrown at packages/server/src/api/controllers/ai/configs.ts:25

  PASSWORD_REPLACEMENT,
  UserCtx,
  AIConfigType,
  RequiredKeys,
  LLMProvidersResponse,
  AIConfigResponse,
  BUDIBASE_AI_PROVIDER_ID,
} from "@budibase/types"
import sdk from "../../../sdk"
import { isEnvironmentVariableKey } from "../../../sdk/utils"

const sanitizeConfig = async (
  config: CustomAIProviderConfig
): Promise<AIConfigResponse> => {
  const providers = await sdk.ai.configs.fetchLiteLLMProviders()
  const provider = providers.find(p => p.id === config.provider)

  if (!provider) {
    throw new Error(`Provider ${config.provider} not found`)
  }

  const secretFields = provider.credentialFields
    .filter(f => f.field_type === "password")
    .map(f => f.key)
  const credentialsFields = { ...config.credentialsFields }

  for (const field of secretFields) {
    if (
      credentialsFields[field] &&
      !isEnvironmentVariableKey(credentialsFields[field])
    ) {
      credentialsFields[field] = PASSWORD_REPLACEMENT
    }
  }

  const sanitized: AIConfigResponse = {
    ...config,

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Check the config's provider value and compare against ids returned by GET /api/ai/providers (fetchLiteLLMProviders).
  2. Update the config (PUT) to point at an existing provider id, or delete the orphaned config.
  3. Verify the LiteLLM proxy is running and its provider registry is loaded (providers endpoint returns data, not an empty list).
  4. If provider ids changed after redeployment, migrate stored configs to the new ids in one pass.
  5. For fresh setups, create the provider in LiteLLM before creating AI configs that reference it.

Example fix

// before
await api.post("/api/ai/configs", { name: "gpt", provider: "openai-prod-v1", ... })
// after: use an id from the providers list
const providers = await api.get("/api/ai/providers")
await api.post("/api/ai/configs", { name: "gpt", provider: providers[0].id, ... })
Defensive patterns

Strategy: validation

Validate before calling

const providers = await api.get("/api/ai/providers")
const valid = providers.some(p => p.id === config.provider)
if (!valid) throw new Error(`Provider ${config.provider} is not registered in LiteLLM`)

Type guard

const isKnownProvider = (providers: { id: string }[], id: string): id is string =>
  providers.some(p => p.id === id)

Try / catch

try {
  await api.post("/api/ai/configs", config)
} catch (e) {
  if (String(e.message).includes("Provider") && e.message.includes("not found")) {
    const providers = await api.get("/api/ai/providers")
    console.log("Valid provider ids:", providers.map(p => p.id))
  }
}

Prevention

When it happens

Trigger: GET /api/ai/configs when a stored config references a provider id no longer registered in LiteLLM; POST/PUT with body.provider set to an unknown/stale provider id; LiteLLM provisioning changed so provider ids were renamed or removed.

Common situations: LiteLLM was redeployed/reprovisioned and provider ids changed; a config was created against a provider that was later deleted; typo in the provider id in an API call; environment's LiteLLM proxy not synced with the Budibase config database.

Related errors


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