Budibase/budibase · error · HTTPError

Error fetching LiteLLM providers: ${text || res.statusText}

Error message

Error fetching LiteLLM providers: ${text || res.statusText}

What it means

fetchPublicProviders hits the LiteLLM proxy's /public/providers/fields endpoint to list supported providers and their litellm_provider mappings. Any non-OK response is converted to an HTTPError carrying the response body text (or statusText) with the upstream status code.

Source

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

  litellm_provider: string
  default_model_placeholder?: string | null
  credential_fields: {
    key: string
    label: string
    placeholder?: string | null
    tooltip?: string | null
    required?: boolean
    field_type?: string
    options?: string[] | null
    default_value?: string | null
  }[]
}

export async function fetchPublicProviders(): Promise<LiteLLMPublicProvider[]> {
  const res = await fetch(`${liteLLMUrl}/public/providers/fields`)
  if (!res.ok) {
    const text = await res.text()
    throw new HTTPError(
      `Error fetching LiteLLM providers: ${text || res.statusText}`,
      res.status
    )
  }

  const json = await res.json()
  return json as LiteLLMPublicProvider[]
}

type LiteLLMModelCostMap = Record<
  string,
  {
    litellm_provider?: string | string[] | null
    mode?: string | string[] | null
    supports_reasoning?: boolean | null
  }
>

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Verify the LiteLLM proxy is up: curl ${liteLLMUrl}/public/providers/fields and compare with the error text.
  2. Correct the LiteLLM URL env var used by the server (host/port misconfiguration is the most common cause).
  3. If 404, upgrade or reconfigure the LiteLLM proxy to a version exposing the public providers endpoint.
  4. Retry after the proxy is healthy; this is a read-only fetch with no local side effects.

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

const res = await fetch(`${liteLLMUrl}/public/providers/fields`)
if (res.status === 404) throw new Error("LiteLLM version lacks /public/providers/fields — upgrade proxy")

Try / catch

try {
  const providers = await fetchPublicProviders()
} catch (e) {
  if (e.message.startsWith("Error fetching LiteLLM providers")) {
    // fall back to a cached provider list or surface a proxy-health alert
    return cachedProviders
  }
  throw e
}

Prevention

When it happens

Trigger: GET /public/providers/fields returning 4xx/5xx — LiteLLM proxy down, wrong liteLLMUrl env configuration, proxy version lacking the /public/providers/fields route (404), or auth rejected.

Common situations: LiteLLM not running in the environment or behind the wrong port; upgrading LiteLLM and the public providers route moved/renamed; network/ingress blocks the call from the server container.

Related errors


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