BerriAI/litellm · error · HTTPException
Provider {custom_llm_provider} api base not found
Error message
Provider {custom_llm_provider} api base not found What it means
HTTPException raised when the provider config for the pass-through route exists but get_api_base returns no base URL for custom_llm_provider — the provider has no default/known API base and none was configured. The pass-through cannot construct a target URL.
Source
Thrown at litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py:126
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
"""
Factory function for creating pass-through endpoints for LLM providers.
"""
from litellm.types.utils import LlmProviders
from litellm.utils import ProviderConfigManager
provider_config: Final = ProviderConfigManager.get_provider_model_info(
provider=LlmProviders(custom_llm_provider),
model=None,
)
if provider_config is None:
raise HTTPException(status_code=404, detail=f"Provider {custom_llm_provider} not found")
base_target_url: Final = provider_config.get_api_base()
if base_target_url is None:
raise HTTPException(status_code=404, detail=f"Provider {custom_llm_provider} api base not found")
encoded_endpoint = httpx.URL(endpoint).path
# Ensure endpoint starts with '/' for proper URL construction
if not encoded_endpoint.startswith("/"):
encoded_endpoint = "/" + encoded_endpoint
# Construct the full target URL using httpx, preserving any base path
# prefix that the operator configured on base_target_url.
base_url: Final = httpx.URL(base_target_url)
updated_url: Final = base_url.copy_with(
path=HttpPassThroughEndpointHelpers.join_base_and_endpoint_path(base_url, encoded_endpoint)
)
# Add or update query parameters
provider_api_key: Final = passthrough_endpoint_router.get_credentials(
custom_llm_provider=custom_llm_provider,
region_name=None,View on GitHub (pinned to 77b7c6c40c)
Solutions
- Configure the api base for the provider in the proxy config (api_base), then retry.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py:126 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/133616eaaf6d23cf.
Report an issue: GitHub.